From fd520092e5391285f7579d5df13da7dd7062b07f Mon Sep 17 00:00:00 2001
From: Utkarsh Gupta
Date: Tue, 1 Feb 2022 22:36:23 +0530
Subject: [PATCH] Add a button to create a custom link from last guess
---
src/Game.tsx | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/Game.tsx b/src/Game.tsx
index 05617b099..4f8c0dddc 100644
--- a/src/Game.tsx
+++ b/src/Game.tsx
@@ -128,8 +128,14 @@ function Game(props: GameProps) {
setGameNumber((x) => x + 1);
};
- async function share(copiedHint: string, text?: string) {
- const url = seed
+ async function share(
+ copiedHint: string,
+ text?: string,
+ customTarget?: string
+ ) {
+ const url = customTarget
+ ? getChallengeUrl(customTarget)
+ : seed
? window.location.origin + window.location.pathname + currentSeedParams()
: getChallengeUrl(target);
const body = url + (text ? "\n\n" + text : "");
@@ -355,6 +361,29 @@ function Game(props: GameProps) {
)}
+
+
+
);
}