From b2261f9101480afb31322cf620f028cdade0671c Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Sat, 12 Sep 2026 14:30:31 -0700 Subject: new landing page that combines leaderboard + login. fixing worker_id assignment, it'll still be needed until transfer is finished --- jb-ui/src/pages/Work.tsx | 78 ++---------------------------------------------- 1 file changed, 2 insertions(+), 76 deletions(-) (limited to 'jb-ui/src/pages/Work.tsx') diff --git a/jb-ui/src/pages/Work.tsx b/jb-ui/src/pages/Work.tsx index 84cb946..dbe3601 100644 --- a/jb-ui/src/pages/Work.tsx +++ b/jb-ui/src/pages/Work.tsx @@ -11,6 +11,7 @@ import { TaskStatusResponse, TopNPlusBlockOfferWall, } from "@/api_fsb"; +import Preview from "@/pages/Preview"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; @@ -793,81 +794,6 @@ const SurveyEnter = () => { ); }; -type RequestState = "idle" | "working" | "sent" | "failed"; - -const Login = () => { - const [email, setEmail] = useState(""); - const [state, setState] = useState("idle"); - - // const dispatch = useAppDispatch(); - const submit = async (event: FormEvent) => { - event.preventDefault(); - setState("working"); - - try { - const response = await fetch("/auth/magic-link/request", { - method: "POST", - credentials: "include", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - email: email, - }), - }); - - if (!response.ok) throw new Error("Account-link request failed"); - - const body = (await response.json()) as { magic_link?: string }; - console.log(body.magic_link ?? null); - } catch { - setState("failed"); - } - }; - - return ( -
-

- Please Login -

- -
- setEmail(event.target.value)} - placeholder="hello@jamesbillings67.com" - /> - -
- - {state === "sent" && ( -

- Check your email to login. -

- )} - - {state === "failed" &&

Unable to send the link. Please try again.

} -
- ); -}; - const Work = () => { const entered = useAppSelector((state) => state.app.currentBucketEntered); // const assignment_id = useAppSelector((state) => state.app.assignment_id); @@ -886,7 +812,7 @@ const Work = () => { if (isLoading) return
Loading...
; if (isError || !user) { - return ; + return ; } return <>{entered ? : }; -- cgit v1.2.3