update routing

This commit is contained in:
yzned
2025-07-20 18:09:45 +03:00
committed by yzned
parent 42b27b7ddc
commit bba27be7e2
10 changed files with 229 additions and 145 deletions

View File

@@ -1,18 +1,23 @@
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { useAccountStore } from "@/contexts/AccountContext";
import { createFileRoute, useNavigate } from "@tanstack/react-router";
import { observer } from "mobx-react-lite";
import { useState } from "react";
export const Route = createFileRoute("/auth/username")({
component: RouteComponent,
component: () => <RouteComponent />,
});
function RouteComponent() {
const RouteComponent = observer(() => {
const [username, setUsername] = useState("");
const navigate = useNavigate();
const { setUserId } = useAccountStore();
const handleSubmit = () => {
if (username.trim() === "") return;
setUserId("ID");
navigate({
to: "/",
viewTransition: { types: ["warp"] },
@@ -67,4 +72,4 @@ function RouteComponent() {
</div>
</div>
);
}
});