|
@@ -1,9 +1,10 @@
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
+import flagLookup from '../../../../domain/flagLookup';
|
|
|
import useMap from '../../../../hooks/useMap';
|
|
|
import useMarkersFromGuesses from '../../../../hooks/useMarkersFromGuesses';
|
|
|
import styles from './SummaryMap.module.css';
|
|
|
|
|
|
-const RoundSelect = ({ rounds, selected, onSelect }) => (
|
|
|
+const RoundSelect = ({ rounds, coords, selected, onSelect }) => (
|
|
|
<div className={styles.tabs}>
|
|
|
{// fun fact: es6 doesn't have a range(x) function
|
|
|
Array.from(Array(rounds).keys()).map((r) => (r + 1).toString()).map((r) => (
|
|
@@ -12,7 +13,7 @@ const RoundSelect = ({ rounds, selected, onSelect }) => (
|
|
|
key={r}
|
|
|
onClick={() => onSelect(r)}
|
|
|
>
|
|
|
- {r}
|
|
|
+ { r } - { flagLookup(coords[r].country) }
|
|
|
</div>
|
|
|
))}
|
|
|
<div className={styles.tab} onClick={() => onSelect('0')}>
|
|
@@ -50,7 +51,7 @@ const SummaryMap = ({ players, coords }) => {
|
|
|
return (
|
|
|
<div className={styles.container}>
|
|
|
<div className={styles.map} ref={mapDivRef} />
|
|
|
- {singleRound || <RoundSelect rounds={rounds} selected={roundNum} onSelect={setRoundNum} />}
|
|
|
+ {singleRound || <RoundSelect rounds={rounds} coords={coords} selected={roundNum} onSelect={setRoundNum} />}
|
|
|
</div>
|
|
|
);
|
|
|
};
|