|
1 | 1 | import { SyntheticEvent, useContext, useEffect, useState } from "react"; |
2 | 2 | import { GlobeMethods } from "react-globe.gl"; |
3 | | -import { FormattedMessage } from "react-intl"; |
| 3 | +import { FormattedMessage, useIntl } from "react-intl"; |
4 | 4 | import { LocaleContext } from "../i18n/LocaleContext"; |
5 | | -import { Country, LanguageName } from "../lib/country"; |
| 5 | +import {Country, LanguageName} from "../lib/country"; |
6 | 6 | import { Locale } from "../lib/locale"; |
7 | 7 | import { answerName } from "../util/answer"; |
8 | 8 | import { findCentre, turnGlobe } from "../util/globe"; |
@@ -95,6 +95,7 @@ export default function List({ guesses, win, globeRef, practiceMode }: Props) { |
95 | 95 |
|
96 | 96 | const [isSortedByDistance, setIsSortedByDistance] = useState(true); |
97 | 97 | const guessesToDisplay = isSortedByDistance ? orderedGuesses : guesses; |
| 98 | + const intl = useIntl(); |
98 | 99 |
|
99 | 100 | return ( |
100 | 101 | <div className="md:ml-10 md:mr-0 py-8 dark:text-white z-30 mb-20"> |
@@ -152,6 +153,12 @@ export default function List({ guesses, win, globeRef, practiceMode }: Props) { |
152 | 153 | off="miles" |
153 | 154 | /> |
154 | 155 | </div> |
| 156 | + <div className="flex items-center space-x-1"> |
| 157 | + <p> |
| 158 | + <FormattedMessage id="Game9" />:{" "} |
| 159 | + {intl.formatMessage({id:closest?.direction})} |
| 160 | + </p> |
| 161 | + </div> |
155 | 162 | <p> |
156 | 163 | <button |
157 | 164 | onClick={() => setIsSortedByDistance(!isSortedByDistance)} |
|
0 commit comments