Skip to content
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
41 changes: 41 additions & 0 deletions src/app/(user-access)/layout.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.authContainer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
width: 100%;
background-color: var(--white);
}
.authContent {
width: 100%;
max-width: 400px;
box-sizing: border-box;
display: flex;
justify-content: center;
background-color: var(--white);
border-radius: 8px;
padding: 20px;
}
.logoContainer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin: 16px 0;
}
.logo {
width: 100%;
height: auto;
}
@media screen and (min-width: 768px) {
.authContent {
max-width: 351px;
}
}

@media screen and (min-width: 1200px) {
.authContent {
max-width: 520px;
}
}
31 changes: 31 additions & 0 deletions src/app/(user-access)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use client';

import React from 'react';
import styles from './layout.module.css';
import Image from 'next/image';
import { useRouter } from 'next/navigation';

interface AuthLayoutProps {
children: React.ReactNode;
}

export default function AuthLayout({ children }: AuthLayoutProps) {
const router = useRouter();

return (
<div className={styles.authContainer}>
<div className={styles.logoContainer}>
<Image
src="/images/logo_main.svg"
alt="둜고"
width={100}
height={100}
className={styles.logo}
onClick={() => router.push('/')}
style={{ cursor: 'pointer' }}
/>
</div>
<div className={styles.authContent}>{children}</div>
</div>
);
}
25 changes: 5 additions & 20 deletions src/app/(user-access)/login/loginPage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
gap: 18px;
width: 100%;
max-width: 400px;
margin: 0 auto;
}

.inputWrapper {
Expand All @@ -20,6 +19,7 @@
}

.input {
width: 100%;
padding: 8px;
border: 1px solid var(--gray-300);
border-radius: 8px;
Expand All @@ -39,28 +39,13 @@
margin-top: 10px;
}

.logoContainer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin: 16px 0;
margin-top: 209px;
}

.logo {
width: 50%;
height: auto;
.disabled {
background-color: var(--gray-400);
cursor: not-allowed;
opacity: 0.5;
}

.greeting {
margin-top: 16px;
font-size: 20px;
text-align: center;
}

.disabled {
background-color: var(--gray-400);
cursor: not-allowed;
opacity: 0.5;
}
19 changes: 3 additions & 16 deletions src/app/(user-access)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import useAuthStore from '@/store/authStore';
import Button from '@/components/Button';
import styles from './loginPage.module.css';
import axiosInstance from '@/lib/axiosInstance';
import Image from 'next/image';
import { ERROR_MESSAGES } from '@/constants/message';

type LoginFormInputs = {
Expand All @@ -21,6 +20,7 @@ type CustomUseFormReturn<TFieldValues extends FieldValues = FieldValues> =
isValid: boolean;
};
};

export default function LoginPage() {
const {
register,
Expand All @@ -35,7 +35,7 @@ export default function LoginPage() {

const onSubmit = async (data: LoginFormInputs) => {
try {
const response = await axiosInstance.post('/login', data);
const response = await axiosInstance.post('/auth/login', data);
const { accessToken } = response.data;

setAccessToken(accessToken);
Expand All @@ -49,19 +49,7 @@ export default function LoginPage() {
return (
<form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
<div className={styles.inputWrapper}>
<div className={styles.logoContainer}>
<Image
src="/images/logo_main.svg"
alt="둜고"
width={100}
height={100}
className={styles.logo}
onClick={() => router.push('/')}
style={{ cursor: 'pointer' }}
/>
<p className={styles.greeting}>μ˜€λŠ˜λ„ λ§Œλ‚˜μ„œ λ°˜κ°€μ›Œμš”!</p>
</div>

<p className={styles.greeting}>μ˜€λŠ˜λ„ λ§Œλ‚˜μ„œ λ°˜κ°€μ›Œμš”!</p>
<label htmlFor="email" className={styles.label}>
이메일
</label>
Expand Down Expand Up @@ -102,7 +90,6 @@ export default function LoginPage() {
<p className={styles.errorMessage}>{errors.password.message}</p>
)}
</div>

<Button
type="submit"
disabled={!isValid}
Expand Down
Empty file.