Skip to content

Commit

Permalink
Fixed #2. Updated index.html (not via upload)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarrenSem authored Jul 26, 2023
1 parent d12f605 commit f8c7cb0
Showing 1 changed file with 46 additions and 26 deletions.
72 changes: 46 additions & 26 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,17 @@
.filter(value => value > 0)
.reduce((a, c) => a + Number(c), 0);

const bonus = Math.floor(totalPrizePool * 0.05);
const CL_PERCENT = 5.0;

const percentLink = () => (
<a
href="#"
>
{CL_PERCENT.toFixed(1)}%
</a>
);

const bonus = Math.floor(totalPrizePool * ( CL_PERCENT / 100 ) );

const remaining = totalPrizePool - bonus;

Expand All @@ -92,12 +102,12 @@
const chopValue = count ? Math.floor(remaining / count) : NaN;

const chopTotal = count ? (chopValue * count) : NaN;

return (
<div>

<button
className="btn btn-info mb-2"
className="btn btn-info mb-3"
style={{ width: '10em' }}
onClick={() => insertNewPlace()}
role="button"
Expand All @@ -113,35 +123,45 @@
return ( <div key={index}
className="d-flex align-items-center mb-2"
>

<input
type="number" step="10"
className="form-control mr-2"
style={{ width: '8.9em' }}
value={place || ''}
onChange={({ target: { value } }) => updatePlace(index, value)}
ref={el => inputRefs.current[index] = el}
aria-label={LABEL_INPUT(index)}
title={LABEL_INPUT(index)}
/>

<button
// style={{ height: '20px', marginLeft: '10px' }}
className="btn btn-danger btn-sm"
onClick={() => removePlace(index)}
role="button"
aria-label={LABEL_REMOVE(index)}
title={LABEL_REMOVE(index)}
>X</button>


<label
style={{ display: 'flex', alignItems: 'center' }}
>
<span
style={{ minWidth: '2em', textAlign: 'right' }}
className="mr-1"
>
{ordinal(index+1)}
</span>

<input
type="number" step="10"
className="form-control ml-1 mr-2"
style={{ width: '7.5em' }}
value={place || ''}
onChange={({ target: { value } }) => updatePlace(index, value)}
ref={el => inputRefs.current[index] = el}
aria-label={LABEL_INPUT(index)}
title={LABEL_INPUT(index)}
/>

<button
// style={{ height: '20px', marginLeft: '10px' }}
className="btn btn-danger btn-sm"
onClick={() => removePlace(index)}
role="button"
aria-label={LABEL_REMOVE(index)}
title={LABEL_REMOVE(index)}
>X</button>
</label>
</div> );

} )
: <div className="mb-1 text-muted"><small> ~ {zero[0]}<b>{zero[1]}</b>{zero[2]} ~ </small></div>
}

<button
className="btn btn-primary my-1"
className="btn btn-primary mb-1"
style={{ width: '10em' }}
onClick={() => appendNewPlace()}
role="button"
Expand All @@ -165,7 +185,7 @@
}
</div>

{totalPrizePool > 0 && <div>( after first giving 5% to <strong>Chip Leader{bonus > 0 ? `: $${bonus}` : ''}</strong> )</div>}
{totalPrizePool > 0 && <div>( after first giving {percentLink()} to <strong>Chip Leader{bonus > 0 ? `: $${bonus}` : ''}</strong> )</div>}

</div>
);
Expand Down

0 comments on commit f8c7cb0

Please # to comment.