fix: don't show vf target if it isn't your score

This commit is contained in:
zkldi
2022-11-11 22:44:27 +00:00
parent 740707d668
commit d161fe6403
+27 -24
View File
@@ -53,31 +53,34 @@ export default function VF6Cell({
return (
<td>
<strong className="underline-on-hover">{score.calculatedData.VF6}</strong>
<br />
{vf6Target !== 0 && vf6Target && (
<div>
{score.calculatedData.VF6! >= vf6Target ? (
<small className="text-success">{vf6Target}VF Target Achieved!</small>
) : vf6Target > maxVF ? (
<small className="text-muted">
{vf6Target}VF Not Possible (Max {maxVF})
</small>
) : (
Object.entries(targets).map(([k, v], i) => (
<React.Fragment key={k}>
<VF6TargetCell
vf6Target={vf6Target!}
targetScore={v}
targetDelta={v === null ? null : v - score.scoreData.score}
clearType={k}
showClearType={i !== 0 || score.scoreData.lamp === "FAILED"}
/>
<br />
</React.Fragment>
))
)}
</div>
{vf6Target !== 0 && vf6Target && user?.id === score.userID && (
<>
<br />
<div>
{score.calculatedData.VF6! >= vf6Target ? (
<small className="text-success">{vf6Target}VF Target Achieved!</small>
) : vf6Target > maxVF ? (
<small className="text-muted">
{vf6Target}VF Not Possible (Max {maxVF})
</small>
) : (
Object.entries(targets).map(([k, v], i) => (
<React.Fragment key={k}>
<VF6TargetCell
vf6Target={vf6Target!}
targetScore={v}
targetDelta={v === null ? null : v - score.scoreData.score}
clearType={k}
showClearType={i !== 0 || score.scoreData.lamp === "FAILED"}
/>
<br />
</React.Fragment>
))
)}
</div>
</>
)}
</td>
);