-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: my page refactor #139
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cb26311
refactor: add success toast
gahyuun 456d58f
fix: implement processChapel
gahyuun 8bc604a
refactor: display UI when no search results
gahyuun 350c30f
fix: set search lectures cache
gahyuun 6939479
feat: implement grade instructions
gahyuun e570614
feat: implement isExpiredGradeUser
gahyuun 3c6aa74
fix: redirect -> useRouter in client side
gahyuun f8b52be
chore: change file name
gahyuun f0c4e62
refactor: use spread in process chapel
gahyuun f39b312
refactor: change lecture delete toast phrase
gahyuun 62d9865
refactor: implement sign in form container
gahyuun 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
20 changes: 20 additions & 0 deletions
20
app/(sub-page)/sign-in/components/sign-in-form-container.tsx
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,20 @@ | ||
'use client'; | ||
import useDialog from '@/app/hooks/useDialog'; | ||
import SignInForm from '@/app/ui/user/sign-in-form/sign-in-form'; | ||
import { DIALOG_KEY } from '@/app/utils/key/dialog-key.util'; | ||
import React from 'react'; | ||
import UpdateInstruction from './update-instruction'; | ||
import { FormState } from '@/app/ui/view/molecule/form/form-root'; | ||
|
||
export default function SignInFormContainer() { | ||
const { open } = useDialog(DIALOG_KEY.UPDATE_INSTRUCTION); | ||
const handleSuccess = (formState?: FormState) => { | ||
if (formState?.message === 'μ¬μ λ‘λ') open(); | ||
}; | ||
return ( | ||
<> | ||
<SignInForm onSuccess={handleSuccess} /> | ||
<UpdateInstruction /> | ||
</> | ||
); | ||
} |
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 useDialog from '@/app/hooks/useDialog'; | ||
import Button from '@/app/ui/view/atom/button/button'; | ||
import { AlertDialog, AlertDialogContent } from '@/app/ui/view/molecule/alert-dialog/alert-dialog'; | ||
import { DIALOG_KEY } from '@/app/utils/key/dialog-key.util'; | ||
import { useRouter } from 'next/navigation'; | ||
|
||
export default function UpdateInstruction() { | ||
const router = useRouter(); | ||
const { isOpen, close } = useDialog(DIALOG_KEY.UPDATE_INSTRUCTION); | ||
return ( | ||
<AlertDialog open={isOpen}> | ||
<AlertDialogContent> | ||
<div className="flex flex-col gap-4"> | ||
<div className="text-xl font-bold">μ λ°μ΄νΈ μλ΄λ¬Έ</div> | ||
<p className="text-gray-800 leading-6"> | ||
<span className="text-primary font-bold">μ‘Έμ μ λΆνν΄</span>κ° 2.0.2 λ²μ μΌλ‘ μ λ°μ΄νΈλ¨μ λ°λΌ, 2024λ 9μ | ||
3μΌ μ΄μ μ μ±μ νλ₯Ό μ λ‘λνμ λͺ¨λ μ¬μ©μκ»μλ μ±μ νλ₯Ό μ¬μ λ‘λν΄ μ£ΌμκΈ° λ°λλλ€. | ||
<br /> | ||
κ°μ¬ν©λλ€. | ||
</p> | ||
<Button | ||
label="νμΈ" | ||
size="xs" | ||
variant="list" | ||
style={{ alignSelf: 'flex-end' }} | ||
onClick={() => { | ||
close(); | ||
router.push('/grade-upload'); | ||
}} | ||
/> | ||
</div> | ||
</AlertDialogContent> | ||
</AlertDialog> | ||
); | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,15 +1,23 @@ | ||
'use client'; | ||
import UpdateInstruction from '@/app/(sub-page)/sign-in/components/update-instruction'; | ||
import Form from '../../view/molecule/form'; | ||
import { authenticate } from '@/app/business/services/user/user.command'; | ||
import { FormState } from '../../view/molecule/form/form-root'; | ||
|
||
export default function SignInForm() { | ||
interface SignInForm { | ||
onSuccess?: (formState?: FormState) => void; | ||
} | ||
export default function SignInForm({ onSuccess }: SignInForm) { | ||
return ( | ||
<Form id="λ‘κ·ΈμΈ" className="space-y-6" action={authenticate}> | ||
<Form.TextInput required={true} label="μμ΄λ" id="authId" placeholder="μμ΄λλ₯Ό μ λ ₯νμΈμ" /> | ||
<Form.PasswordInput required={true} label="λΉλ°λ²νΈ" id="password" placeholder="λΉλ°λ²νΈλ₯Ό μ λ ₯νμΈμ" /> | ||
<div className="pt-6"> | ||
<Form.SubmitButton label="λ‘κ·ΈμΈ" position="center" variant="primary" /> | ||
</div> | ||
</Form> | ||
<> | ||
<Form id="λ‘κ·ΈμΈ" className="space-y-6" action={authenticate} onSuccess={onSuccess}> | ||
<Form.TextInput required={true} label="μμ΄λ" id="authId" placeholder="μμ΄λλ₯Ό μ λ ₯νμΈμ" /> | ||
<Form.PasswordInput required={true} label="λΉλ°λ²νΈ" id="password" placeholder="λΉλ°λ²νΈλ₯Ό μ λ ₯νμΈμ" /> | ||
<div className="pt-6"> | ||
<Form.SubmitButton label="λ‘κ·ΈμΈ" position="center" variant="primary" /> | ||
</div> | ||
</Form> | ||
<UpdateInstruction /> | ||
</> | ||
); | ||
} |
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.
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.
λ‘κ·ΈμΈμμ λ§λ£μ μ μ¬λΆλ₯Ό μλ³νλλ§νΌ SignInPageμ μμΉμν€λ κ²μ μ΄λ¨κΉμ?
μ κ° μκ°νλ λ°©λ²λ μ λ°°κ° μκ°νμλ κ·Έλ¦Όκ³Ό λμΌν κ² κ°μλ°, λͺ¨λ¬μ ν€λ ν¨μλ₯Ό
props
λ‘ μ λ¬νλ λ°©λ²μ ν΅ν΄ λ‘κ·ΈμΈ μ±κ³΅μμ λͺ¨λ¬μ λ ΈμΆνλ λ°©μμ΄ μ’μ보μ¬μ.SignUpForm
μμ ν΄λΉ ꡬ쑰λ₯Ό μ¬μ©νκ³ μμ΄μ!