🎨 Amelioration du style des exemples

pull/256/head
Mael 2018-06-13 17:48:22 +02:00
parent a86bcd8829
commit d743153afa
2 changed files with 34 additions and 23 deletions

View File

@ -18,16 +18,12 @@
list-style-type: none;
}
#examples .example {
font-weight: 500;
margin: 0.6em;
cursor: pointer;
}
#examples .example.selected .name {
font-weight: bold;
}
#examples .name {
border: none;
border-width: 1px;
border-style: solid;
padding: 0.2em 0.6em;
border-radius: 0.2em;
font-size: 100%;

View File

@ -69,20 +69,35 @@ let Example = ({
rule,
currentExample,
setExample,
themeColours: { colour, textColour }
}) => (
<li
key={nom}
className={classNames('example', {
selected: currentExample && currentExample.name == nom
})}
onClick={() =>
currentExample && currentExample.name == nom
? setExample(null)
: setExample(nom, situation, rule.dottedName)
}>
<button className="name" style={{ color: textColour, background: colour }}>
{capitalise0(nom)}
</button>
</li>
)
themeColours: { colour, textColourOnWhite, textColour }
}) =>
do {
let selected = currentExample && currentExample.name == nom
;<li
key={nom}
className={classNames('example', {
selected
})}
onClick={() =>
selected
? setExample(null)
: setExample(nom, situation, rule.dottedName)
}>
<button
className="name"
style={
selected
? {
background: colour,
color: textColour,
borderColor: textColourOnWhite
}
: {
borderColor: textColourOnWhite,
color: textColourOnWhite
}
}>
{capitalise0(nom)}
</button>
</li>
}