From 0641db1f2d394fb82ac12adf6b958e0f82c54026 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sat, 19 Feb 2022 11:42:27 -0600 Subject: [PATCH] Show sign in button instead of submit answer if logged out. --- web/components/answers-panel.tsx | 34 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/web/components/answers-panel.tsx b/web/components/answers-panel.tsx index 483190ef..4309d8a2 100644 --- a/web/components/answers-panel.tsx +++ b/web/components/answers-panel.tsx @@ -350,6 +350,7 @@ function AnswerBetPanel(props: { function CreateAnswerInput(props: { contract: Contract }) { const { contract } = props + const user = useUser() const [text, setText] = useState('') const [betAmount, setBetAmount] = useState(10) const [amountError, setAmountError] = useState() @@ -451,17 +452,28 @@ function CreateAnswerInput(props: { contract: Contract }) { )} - + {user ? ( + + ) : ( + text && ( + + ) + )}