-
Notifications
You must be signed in to change notification settings - Fork 3
π Fix(#168): κΆνμ λ°λ₯Έ νμ΄μ§ μ κ·Ό μ μ΄ #211
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2907ba3
π fix(#82): ν
μ΅μμμμλ§ μ°λλ‘ λ³κ²½
un0211 3f5ee1d
π fix(#168): 곡μ κ³μ μΌλ‘ νλ μμ² μ ν
un0211 7625cb2
π fix(#168): μμ±μκ° μλ κ²½μ° λμ보λ κ΄λ¦¬ νμ΄μ§ μ κ·Όμ 리λ€μ΄λ νΈ
un0211 b427566
π¨ design(#168): λμ보λ κ΄λ¦¬νμ΄μ§ μλ¬λ¬Έκ΅¬ κ°μ
un0211 c82b2a6
π fix(#168): λμ보λ κ΄λ¦¬νμ΄μ§ μ κ·Ό μμ μ μ΄, 리λ€μ΄λ νΈ ν
νμ λ³κ²½
un0211 4f1ac10
π fix(#168): λμ보λ μ κ·Ό μ μ΄
un0211 a8ed44a
π¨ design(#168, #41): 곡μ λμ보λ λΉλ‘κ·ΈμΈ μνμΌλ λ μ΄μμ κ½ μ°¨κ²
un0211 4e3d79b
π fix(#168): 곡μ κ³μ μμ λͺ¨λ μμ κΈ°λ₯ λΉνμ±ν
un0211 4f0fe33
π fix(#4, #21): λ³κ²½μ¬ν μμ μ λ²νΌ λΉνμ±ν (λκΈμμ , μ»¬λΌ μμ
un0211 37fc272
π fix(#168): 리λ€μ΄λ νΈ μμ (λλ©, 404)
un0211 d6f2901
Merge branch 'develop' into feature/fix-redirect
un0211 3f6b993
π fix(#168): λ©€λ²κ° μλ λ‘κ·ΈμΈ ν μ¬λλ μμ λ²νΌ λΉνμ±ν
un0211 f2896fa
Merge branch 'develop' into feature/fix-redirect
un0211 b179824
Merge branch 'develop' into feature/fix-redirect
un0211 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,23 +1,40 @@ | ||
| import { useRouter } from 'next/router'; | ||
| import { useSelector } from 'react-redux'; | ||
|
|
||
| import useRedirectIfAuthenticated from '@/hooks/useRedirectIfAuthenticated'; | ||
| import useRedirectIfAuth from '@/hooks/useRedirectIfAuth'; | ||
| import useRedirectIfNotAuth from '@/hooks/useRedirectIfNotAuth'; | ||
| import { RootState } from '@/store/store'; | ||
|
|
||
| export default function Redirect({ children }: { children: React.ReactNode }) { | ||
| const router = useRouter(); | ||
| const currentPath = router.asPath; | ||
| const { user } = useSelector((state: RootState) => state.user); | ||
| const currentPath = router.pathname; | ||
|
|
||
| if (['/', '/signup', '/signin'].includes(currentPath)) { | ||
| const isRedirecting = useRedirectIfAuthenticated(); | ||
| const redirectIfAuth = useRedirectIfAuth(); | ||
| const redirectIfNotAuth = useRedirectIfNotAuth(); | ||
|
|
||
| if (currentPath === '/' && user) { | ||
| router.replace('/mydashboard'); | ||
| } | ||
|
|
||
| if (currentPath === '/404') { | ||
| const nextPath = user ? '/mydashboard' : '/'; | ||
| setTimeout(() => router.push(nextPath), 3000); | ||
| } | ||
|
|
||
| if (['/signup', '/signin'].includes(currentPath)) { | ||
| const isRedirecting = redirectIfAuth(); | ||
| if (isRedirecting) { | ||
| return <></>; | ||
| } | ||
| } | ||
| if (['/mypage', '/mydashboard'].includes(currentPath) || currentPath.startsWith('/dashboard')) { | ||
| const isRedirecting = useRedirectIfNotAuth(); | ||
|
|
||
| if (['/mypage', '/mydashboard'].includes(currentPath)) { | ||
| const isRedirecting = redirectIfNotAuth(); | ||
| if (isRedirecting) { | ||
| return <></>; | ||
| } | ||
| } | ||
|
|
||
| return children; | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ©€λ²μΈμ§ μΌμΌμ΄ νμΈνκΈ° λ²κ±°λ‘μΈ κ² κ°μ, λ©€λ²λ§ ν μ μλ μΌμ ν΄μ μλ¬κ° λλ©΄ λ©€λ²κ° μλ κ²μΌλ‘ νλ¨νμ΅λλ€
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ΅ λ©€λ²κ° μλλ©΄ λ°λ‘ μ 리λ€μ΄λ νΈ λλ€μ!! νμΈνμ΅λλ€! π
2024-07-07.5.06.53.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μκ±°λ 리λ€μ΄λ νΈ μλλΌ κ³΅μ λμ보λμμ λ©€λ²κ° μλκ²½μ° λ²νΌ λΉνμ±ν νλ €κ³ λ©€λ²μΈμ§ νμΈνλ λΆλΆμ΄μμ!
μ΄κ±° λ°λ‘ μμκ° λ¦¬λ€μ΄λ νΈ λΆλΆμ λλ€ (ν΅ν©ν΄μ μ¬μ©ν μ μκ² λ€μ)
μ½λλ μμ λ€ λ§λ€κ³ 리ν©ν λ§ ν΄λ³Όκ²μ γ γ νμΈ κ°μ¬ν©λλ€!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ κ·Έλ λ€μ λ²νΌ λΉνμ±ν!!! μλͺ»λ΄€μ΅λλ€ γ γ γ γ
λ€μ νμΈν΄λ³΄λ μ λ©λλ€!! κ³ μνμ ¨μ΄μ!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄κ²λ μλκ³ , 곡μ λμ보λμμ λ©€λ²κ° μλ λ‘κ·ΈμΈ ν μ¬λμ κ²½μ° μμ μ΄ λΆκ°λ₯νκ² λΉνμ±νν μ½λμ λλ€ γ γ

λμ€μ μ£Όμλ μΆκ°νκ³ μ½λλ μ€λ³΅ μκ² κ°μ ν κ²μ!! ν μ€νΈνκ³ μ½λ©νΈ λ¨κ²¨μ£Όμ μ κ°μ¬ν©λλ€!!