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
61 changes: 61 additions & 0 deletions src/app/login/SocialLogin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
'use client';

import Naver from '@/shared/assets/icons/naver.svg';
import Kakao from '@/shared/assets/icons/kakao.svg';
import Google from '@/shared/assets/icons/google.svg';
import tw from '@/shared/utills/tw';
import Welcome from './Welcome';
import { useState } from 'react';

function SocialLogin() {
const [isModalOpen, setIsModalOpen] = useState(false);

const socialButtons = [
{
id: 'naver',
label: 'Naver 로그인',
icon: <Naver />,
style: 'bg-[#00C73C]',
},
{
id: 'kakao',
label: 'Kakao 로그인',
icon: <Kakao />,
style: 'bg-[#FEE500] text-primary',
},
{
id: 'google',
label: 'Google 로그인',
icon: <Google />,
style: 'bg-[#EBEBEB] text-primary',
},
];

// TODO: 백엔드 연동 로직 구현 필요
const handleLogin = (id: string) => {
console.log(id);
setIsModalOpen(true);
};

return (
<>
<div className="flex flex-col gap-5 mt-12 px-3 w-full max-w-[23.75rem]">
{socialButtons.map(({ id, label, icon, style }) => (
<button
key={id}
type="button"
onClick={() => handleLogin(id)}
className={tw('flex-center gap-2 px-5 py-1 w-full rounded-lg', style)}
>
{icon}
<span className="text-xl">{label}</span>
</button>
))}
</div>

{/* 웰컴 모달 (임시) */}
<Welcome open={isModalOpen} onClose={() => setIsModalOpen(false)} />
</>
);
}
export default SocialLogin;
56 changes: 56 additions & 0 deletions src/app/login/Welcome.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
'use client';

import Image from 'next/image';

import Button from '@/shared/components/button/Button';
import ModalLayout from '@/shared/components/modalPop/ModalLayout';
import Ssury from '@/shared/assets/ssury/ssury_jump.webp';
import { useRouter } from 'next/navigation';

interface Props {
open: boolean;
onClose: () => void;
}

function Welcome({ open, onClose }: Props) {
const router = useRouter();

return (
<ModalLayout
open={open}
onClose={onClose}
title="환영합니다!"
description="바텐더 쑤리가 안내해드릴게요"
buttons={
<>
<Button
type="button"
color="purple"
onClick={() => {
onClose();
router.push('/recipe');
}}
>
칵테일 레시피 보러가기
</Button>
<Button
type="button"
onClick={() => {
onClose();
router.push('/recommend');
}}
>
칵테일 취향 추천받기
</Button>
</>
}
>
<div className="flex-center">
<div className="relative w-32 h-32" aria-hidden>
<Image src={Ssury} alt="" fill className="object-contain" />
</div>
</div>
</ModalLayout>
);
}
export default Welcome;
30 changes: 30 additions & 0 deletions src/app/login/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Image from 'next/image';
import type { Metadata } from 'next';
import loginBg from '@/shared/assets/images/login_bg.webp';
import SocialLogin from './SocialLogin';

export const metadata: Metadata = {
title: 'SSOUL | 로그인',
description: '칵테일을 좋아하는 사람들을 위한 서비스 로그인 페이지',
};

function Page() {
return (
<div className="relative flex flex-1 flex-col items-center justify-center gap-4 min-h-screen">
<div
className="absolute bottom-0 left-1/2 -translate-x-1/2 w-full max-w-[75rem] h-full -z-10"
aria-hidden
>
<Image src={loginBg} alt="" fill className="object-cover md:object-contain object-bottom" />
</div>

<div className="flex flex-col gap-3 text-center">
<h1 className="text-4xl font-bold">로그인</h1>
<p>3초 로그인으로 SSOUL을 가볍게 즐겨보세요🍸</p>
</div>

<SocialLogin />
</div>
);
}
export default Page;
7 changes: 7 additions & 0 deletions src/shared/assets/icons/google.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/shared/assets/icons/kakao.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/shared/assets/icons/naver.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/shared/assets/images/login_bg.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion src/shared/components/modalPop/ModalLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ function ModalLayout({
{children && <div className="mt-5 py-2 text-white">{children}</div>}

{buttons && (
<div className={tw('flex justify-center gap-2 pt-8', size === 'sm' && 'pt-5')}>
<div
className={tw(
'flex flex-col md:flex-row justify-center gap-2 pt-8',
size === 'sm' && 'pt-5'
)}
>
{buttons}
</div>
)}
Expand Down
Loading