From f6d999c9560375475d3c56002392509222f2859f Mon Sep 17 00:00:00 2001 From: Phil Date: Thu, 15 Sep 2022 16:15:00 +0100 Subject: [PATCH] Removed old Twitch signup page. --- web/pages/twitch.tsx | 120 ------------------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 web/pages/twitch.tsx diff --git a/web/pages/twitch.tsx b/web/pages/twitch.tsx deleted file mode 100644 index 7ca892e8..00000000 --- a/web/pages/twitch.tsx +++ /dev/null @@ -1,120 +0,0 @@ -import { useState } from 'react' - -import { Page } from 'web/components/page' -import { Col } from 'web/components/layout/col' -import { ManifoldLogo } from 'web/components/nav/manifold-logo' -import { useSaveReferral } from 'web/hooks/use-save-referral' -import { SEO } from 'web/components/SEO' -import { Spacer } from 'web/components/layout/spacer' -import { firebaseLogin, getUserAndPrivateUser } from 'web/lib/firebase/users' -import { track } from 'web/lib/service/analytics' -import { Row } from 'web/components/layout/row' -import { Button } from 'web/components/button' -import { useTracking } from 'web/hooks/use-tracking' -import { linkTwitchAccountRedirect } from 'web/lib/twitch/link-twitch-account' -import { usePrivateUser, useUser } from 'web/hooks/use-user' -import { LoadingIndicator } from 'web/components/loading-indicator' -import toast from 'react-hot-toast' - -export default function TwitchLandingPage() { - useSaveReferral() - useTracking('view twitch landing page') - - const user = useUser() - const privateUser = usePrivateUser() - const twitchUser = privateUser?.twitchInfo?.twitchName - - const callback = - user && privateUser - ? () => linkTwitchAccountRedirect(user, privateUser) - : async () => { - const result = await firebaseLogin() - - const userId = result.user.uid - const { user, privateUser } = await getUserAndPrivateUser(userId) - if (!user || !privateUser) return - - await linkTwitchAccountRedirect(user, privateUser) - } - - const [isLoading, setLoading] = useState(false) - - const getStarted = async () => { - try { - setLoading(true) - - const promise = callback() - track('twitch page button click') - await promise - } catch (e) { - console.error(e) - toast.error('Failed to sign up. Please try again later.') - setLoading(false) - } - } - - return ( - - -
- -
- - - - - - - -
-

-
- - Bet - {' '} - on your favorite streams -
-

- -
- Get more out of Twitch with play-money betting markets.{' '} - {!twitchUser && - 'Click the button below to link your Twitch account.'} -
-
-
- - - - {twitchUser ? ( -
-
-
- Twitch account linked -
-
- {twitchUser} -
-
-
- ) : isLoading ? ( - - ) : ( - - )} - - - -
- ) -}