Skip to content
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

페이지 UI: 로그인 #74

Merged
merged 4 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/app/login/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function Loginlayout({ children }: { children: React.ReactNode }) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저번에 말씀드린 것처럼 페이지가 모두 완성되면 한번에 처리하죠!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!

return (
<div style={{ padding: '0 24px' }}>{children}</div>
);
}

export default Loginlayout;
18 changes: 18 additions & 0 deletions src/app/login/page.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.linkContainer {
display: flex;
justify-content: center;
gap: 20px;

li {
position: relative;
color: var(--tertiary);
font-size: 12px;

&:not(:last-child)::after {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굳굳굳!

content: "|";
display: inline-block;
position: absolute;
margin-left: 9px;
}
}
}
67 changes: 67 additions & 0 deletions src/app/login/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/* eslint-disable @typescript-eslint/no-misused-promises */

'use client';

import { useForm } from 'react-hook-form';

import classNames from 'classnames/bind';
import Link from 'next/link';

import Button from '@components/shared/button/Button';
import Header from '@components/shared/header/Header';
import Spacing from '@components/shared/spacing/Spacing';
import TextField from '@components/shared/text-field/TextField';
import Title from '@components/shared/title/Title';
import { ISignIn } from '@remote/api/types/auth';

import styles from './page.module.scss';

const cx = classNames.bind(styles);

function LoginPage() {
const { register, handleSubmit } = useForm<ISignIn>();

// eslint-disable-next-line @typescript-eslint/require-await
const onSubmit = async () => {
// console.log(data);
};
return (
<main>
<Header displayLogo={false} />
<Spacing size={30} />
<form onSubmit={handleSubmit(onSubmit)}>
<Title title="로그인" size={20} />
<TextField
label="아이디"
required
placeholder="아이디"
{...register('id')}
/>
<TextField
label="비밀번호"
required
placeholder="비밀번호"
{...register('password')}
/>
<Spacing size={30} />
<Button type="submit" size="medium" full>
로그인
</Button>
<Spacing size={20} />
</form>
<ul className={cx('linkContainer')}>
<li>
<Link href="/">회원가입</Link>
</li>
<li>
<Link href="/">아이디 찾기</Link>
</li>
<li>
<Link href="/">비밀번호 찾기</Link>
</li>
</ul>
</main>
);
}

export default LoginPage;
2 changes: 1 addition & 1 deletion src/components/shared/text-field/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const TextField = forwardRef<HTMLInputElement, TextFieldProps>(function TextFiel
isPasswordType={isPasswordType}
{...props}
/>
{hasError ? <Spacing size={6} /> : <Spacing size={12} />}
{hasError ? <Spacing size={6} /> : <Spacing size={20} />}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다~

{hasError && (
<>
<Text typography="t7" color={labelColor} display="inline-block">{helpMessage}</Text>
Expand Down
Loading