spec goal overflow

This commit is contained in:
Mashy
2019-08-15 15:37:32 +10:00
parent fbf0eead04
commit 9cc4995959
3 changed files with 31 additions and 25 deletions
+2 -2
View File
@@ -57,7 +57,7 @@
.instance .info svg {
display: inline;
height: 1.25em;
height: 1em;
}
.instance .constructs {
@@ -384,7 +384,7 @@
}
.bonus {
justify-content: flex-end;
justify-content: center;
}
}
+18 -6
View File
@@ -56,6 +56,8 @@ function InfoComponent(args) {
green: [],
blue: [],
};
const overFlow = [];
colours.forEach(c => {
const colourReq = bonus.req[c];
if (colourReqs === 0) return false;
@@ -67,15 +69,24 @@ function InfoComponent(args) {
const dots = range(start, colourReq).map(j => {
const unmet = teamColours[c] < j + 1;
const reqClass = unmet
? 'unmet'
: '';
colourGoals[c].push(
<figure key={j} alt={c.colour} class={reqClass} >
{shapes.vboxColour(c)}
</figure>
);
if (j - start > 4) {
overFlow.push(
<figure key={j} alt={c.colour} class={reqClass} >
{shapes.vboxColour(c)}
</figure>
);
} else {
colourGoals[c].push(
<figure key={j} alt={c.colour} class={reqClass} >
{shapes.vboxColour(c)}
</figure>
);
}
return true;
});
@@ -97,10 +108,11 @@ function InfoComponent(args) {
}
return false;
});
const overFlowObj = overFlow.length ? <div> {overFlow} </div> : null;
return (
<div key={i} class="spec-goal">
{goals}
{overFlowObj}
<div class={`${reqClass} bonus`} >
+ {bonus.bonus}
</div>