-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
refactor: my page refactor
- Loading branch information
Showing
19 changed files
with
182 additions
and
66 deletions.
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.