diff options
| author | Brendan F <EpicWolverine@users.noreply.github.com> | 2023-05-14 23:27:46 -0700 |
|---|---|---|
| committer | Brendan F <EpicWolverine@users.noreply.github.com> | 2023-05-14 23:27:46 -0700 |
| commit | b19215730e8f2f892b77ffcb348e07b6fa272286 (patch) | |
| tree | fa86a49d85194305502e441c937b8d300d5b6d95 | |
| parent | eb5e524888183f120c38b5c66e3018a25184b384 (diff) | |
Add copying results on failure
| -rw-r--r-- | src/components/Result/index.tsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/components/Result/index.tsx b/src/components/Result/index.tsx index 40a95fb..8fa4323 100644 --- a/src/components/Result/index.tsx +++ b/src/components/Result/index.tsx @@ -31,12 +31,11 @@ export function Result({ ); const textForTry = ["Wow!", "Super!", "Congrats!", "Nice!"]; + const copyResult = React.useCallback(() => { + navigator.clipboard.writeText(scoreToEmoji(guesses)); + }, [guesses]); if (didGuess) { - const copyResult = React.useCallback(() => { - navigator.clipboard.writeText(scoreToEmoji(guesses)); - }, [guesses]); - return ( <> <Styled.ResultTitle>{textForTry[currentTry - 1]}</Styled.ResultTitle> @@ -65,6 +64,9 @@ export function Result({ {todaysSolution.name} </Styled.SongTitle> <YouTube id={todaysSolution.youtubeId} /> + <Button onClick={copyResult} variant="red"> + Copy results + </Button> <Styled.TimeToNext> Try again in {hoursToNextDay}{" "} hours </Styled.TimeToNext> |
