Skip to content

Commit e2d4180

Browse files
committed
medal colors
1 parent d783b6c commit e2d4180

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/Results/MapLink.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,32 @@ const makeRed = <T extends Geometry, P extends GeoJsonProperties>(
1919
f: Feature<T, P>
2020
) => ({
2121
...f,
22-
properties: { ...f.properties, title: 'Target', 'marker-color': '#f00' },
22+
properties: { ...f.properties, title: 'Target', 'marker-color': '#ff0000' },
2323
});
2424

25+
const medalColors = ['#d4af37', '#c0c0c0', '#cd7f32'];
26+
27+
const color = (i: number) => medalColors[i] ?? '#444444';
28+
2529
const makePlacements = <P extends GeoJsonProperties>(
2630
f: Feature<Point, P>,
2731
i: number
2832
): Feature<Point, P> => {
29-
if (i >= 9) {
30-
return f;
31-
} else {
32-
return {
33-
...f,
34-
properties: { ...f.properties, 'marker-symbol': i + 1 },
35-
};
36-
}
33+
return {
34+
...f,
35+
properties: {
36+
...f.properties,
37+
'marker-symbol': i < 9 ? i + 1 : undefined,
38+
'marker-color': color(i),
39+
},
40+
};
3741
};
3842

3943
const MapLink: FunctionComponent<Props> = ({ results }) => {
4044
const gameConfig = useAppSelector(selectGameConfig);
4145
const target = gameConfig?.target;
4246

4347
const onClick = useCallback(() => {
44-
const a = document.createElement('a');
4548
let targets: Feature[];
4649
if (!target) {
4750
targets = [];

0 commit comments

Comments
 (0)