Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/handle signed in user in sign page #289

Merged
merged 4 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions client/app/[locale]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
import Link from "next/link"
"use client"

export default function NotFound() {
import { useRouter } from "next/navigation"

import { Button } from "@/components/ui/button"

const NotFound = () => {
const router = useRouter()
const handleClick = () => {
router.back()
}
return (
<div>
<h2>Not Found</h2>
<p>Could not find requested resource</p>
<Link href="/">Return Home</Link>
<div className="flex h-[500px] flex-col items-center justify-center gap-4">
<span className="text-5xl">🥲😢</span>
<h6>{"404 Not Found"}</h6>
<Button type="button" onClick={handleClick}>
返回
</Button>
</div>
)
}

export default NotFound
8 changes: 8 additions & 0 deletions client/modules/auth/components/templates/sign-up/template.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
"use client"

import React from "react"
import { notFound } from "next/navigation"
import SignUpForm from "@/modules/auth/components/forms/sign-up"

import useUserStore from "@/hooks/state/user/store"

const SignUpPageTemplate = () => {
const isUserSignIn = useUserStore((state) => state.isSignIn)

if (isUserSignIn) return notFound()
return (
<div className="flex h-full w-full justify-center">
<div className="mt-8 h-full w-full max-w-[400px]">
Expand Down