feat: frontend
This commit is contained in:
32
ordr-ui/app/page.tsx
Normal file
32
ordr-ui/app/page.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
'use client'
|
||||
import Image from "next/image";
|
||||
import { useAsyncEffect } from 'use-async-effect'
|
||||
import { useShallow } from 'zustand/react/shallow'
|
||||
import { UserResponse } from './client/response'
|
||||
import { useCurrentAuthenticatedUserStore, UserActions } from './providers'
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default function Home() {
|
||||
const authenticatedUserStore: UserResponse & UserActions = useCurrentAuthenticatedUserStore(useShallow((state) => ({
|
||||
...state
|
||||
})))
|
||||
useAsyncEffect(async () => {
|
||||
if(authenticatedUserStore.Id === -1) {
|
||||
await authenticatedUserStore.sync()
|
||||
}
|
||||
})
|
||||
const router = useRouter()
|
||||
|
||||
useEffect(() => {
|
||||
router.push('/orders/0/0')
|
||||
}, [router])
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
|
||||
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
|
||||
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user