Skip to content

Commit

Permalink
Merge pull request #113 from hufs-sports-live/refactor/login
Browse files Browse the repository at this point in the history
[STYLE]: 로그인 pending, error 상태 확인 문구 추가
  • Loading branch information
HiimKwak authored Nov 29, 2023
2 parents 2dfaccd + fcb53d4 commit 0cbc5bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AuthPayload } from '@/types/auth';
export default function Login() {
const [loginData, setLoginData] = useState<AuthPayload>({} as AuthPayload);

const { mutate } = usePostLoginMutation();
const { mutate, status } = usePostLoginMutation();

const { isError: isEmailEmpty } = useValidate(
loginData.email,
Expand Down Expand Up @@ -71,6 +71,14 @@ export default function Login() {
/>
</label>

{status === 'pending' && (
<div className="mx-2 text-gray-4">로그인 중입니다...</div>
)}
{status === 'error' && (
<div className="mx-2 text-red-600">
로그인에 실패하였습니다. 다시 시도하시거나 관리자에게 문의해주세요.
</div>
)}
<Button
className="mt-8 w-full rounded-lg bg-primary p-4 text-xl text-white hover:bg-[#303ECE] disabled:bg-gray-2 disabled:text-gray-4"
type="submit"
Expand Down
3 changes: 0 additions & 3 deletions src/queries/useLogin/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,5 @@ export default function usePostLoginMutation() {

router.push('/admin/league');
},
// onError: () => {
// setIsLoginFailed(true);
// },
});
}

0 comments on commit 0cbc5bf

Please sign in to comment.