-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: $변수명 전체 수정 및 로그인, 회원가입 페이지 에러 수정
- Loading branch information
1 parent
9c6171e
commit 589d805
Showing
29 changed files
with
443 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use client'; // Error components must be Client Components | ||
|
||
import { useEffect } from 'react'; | ||
|
||
export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { | ||
useEffect(() => { | ||
// Log the error to an error reporting service | ||
console.error(error); | ||
}, [error]); | ||
|
||
return ( | ||
<div> | ||
<h2>Something went wrong!</h2> | ||
<button | ||
onClick={ | ||
// Attempt to recover by trying to re-render the segment | ||
() => reset() | ||
}> | ||
Try again | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use client'; | ||
import Loading from '@/components/loading/Loading'; | ||
import { ACCESS_TOKEN_KEY } from '@/lib/axios'; | ||
import { JoinBody, JoinWrap } from '@/styles/loginStyle'; | ||
import { redirect, useRouter } from 'next/navigation'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
function getCookie(name: string) { | ||
const cookieString = document.cookie; | ||
const cookies = cookieString.split('; '); | ||
for (const cookie of cookies) { | ||
const [cookieName] = cookie.split('='); | ||
if (cookieName === name) { | ||
redirect('/folder'); | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
export default function Template({ children }: { children: React.ReactNode }) { | ||
const [isLoading, setIsLoading] = useState(false); | ||
|
||
getCookie(ACCESS_TOKEN_KEY); | ||
|
||
useEffect(() => { | ||
setIsLoading(true); | ||
}, [isLoading]); | ||
|
||
if (!isLoading) return <Loading />; | ||
|
||
return ( | ||
<JoinWrap className='no-header--container signup__wrap'> | ||
<JoinBody>{children}</JoinBody> | ||
</JoinWrap> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.