Skip to content

Commit f8c7cb0

Browse files
authored
Fixed #2. Updated index.html (not via upload)
1 parent d12f605 commit f8c7cb0

File tree

1 file changed

+46
-26
lines changed

1 file changed

+46
-26
lines changed

index.html

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,17 @@
8383
.filter(value => value > 0)
8484
.reduce((a, c) => a + Number(c), 0);
8585

86-
const bonus = Math.floor(totalPrizePool * 0.05);
86+
const CL_PERCENT = 5.0;
87+
88+
const percentLink = () => (
89+
<a
90+
href="#"
91+
>
92+
{CL_PERCENT.toFixed(1)}%
93+
</a>
94+
);
95+
96+
const bonus = Math.floor(totalPrizePool * ( CL_PERCENT / 100 ) );
8797

8898
const remaining = totalPrizePool - bonus;
8999

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

94104
const chopTotal = count ? (chopValue * count) : NaN;
95-
105+
96106
return (
97107
<div>
98108

99109
<button
100-
className="btn btn-info mb-2"
110+
className="btn btn-info mb-3"
101111
style={{ width: '10em' }}
102112
onClick={() => insertNewPlace()}
103113
role="button"
@@ -113,35 +123,45 @@
113123
return ( <div key={index}
114124
className="d-flex align-items-center mb-2"
115125
>
116-
117-
<input
118-
type="number" step="10"
119-
className="form-control mr-2"
120-
style={{ width: '8.9em' }}
121-
value={place || ''}
122-
onChange={({ target: { value } }) => updatePlace(index, value)}
123-
ref={el => inputRefs.current[index] = el}
124-
aria-label={LABEL_INPUT(index)}
125-
title={LABEL_INPUT(index)}
126-
/>
127-
128-
<button
129-
// style={{ height: '20px', marginLeft: '10px' }}
130-
className="btn btn-danger btn-sm"
131-
onClick={() => removePlace(index)}
132-
role="button"
133-
aria-label={LABEL_REMOVE(index)}
134-
title={LABEL_REMOVE(index)}
135-
>X</button>
136-
126+
127+
<label
128+
style={{ display: 'flex', alignItems: 'center' }}
129+
>
130+
<span
131+
style={{ minWidth: '2em', textAlign: 'right' }}
132+
className="mr-1"
133+
>
134+
{ordinal(index+1)}
135+
</span>
136+
137+
<input
138+
type="number" step="10"
139+
className="form-control ml-1 mr-2"
140+
style={{ width: '7.5em' }}
141+
value={place || ''}
142+
onChange={({ target: { value } }) => updatePlace(index, value)}
143+
ref={el => inputRefs.current[index] = el}
144+
aria-label={LABEL_INPUT(index)}
145+
title={LABEL_INPUT(index)}
146+
/>
147+
148+
<button
149+
// style={{ height: '20px', marginLeft: '10px' }}
150+
className="btn btn-danger btn-sm"
151+
onClick={() => removePlace(index)}
152+
role="button"
153+
aria-label={LABEL_REMOVE(index)}
154+
title={LABEL_REMOVE(index)}
155+
>X</button>
156+
</label>
137157
</div> );
138158

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

143163
<button
144-
className="btn btn-primary my-1"
164+
className="btn btn-primary mb-1"
145165
style={{ width: '10em' }}
146166
onClick={() => appendNewPlace()}
147167
role="button"
@@ -165,7 +185,7 @@
165185
}
166186
</div>
167187

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

170190
</div>
171191
);

0 commit comments

Comments
 (0)