From b19215730e8f2f892b77ffcb348e07b6fa272286 Mon Sep 17 00:00:00 2001 From: Brendan F Date: Sun, 14 May 2023 23:27:46 -0700 Subject: Add copying results on failure --- src/components/Result/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/components/Result') 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 ( <> {textForTry[currentTry - 1]} @@ -65,6 +64,9 @@ export function Result({ {todaysSolution.name} + Try again in {hoursToNextDay}{" "} hours -- cgit v1.2.3