Skip to content
3 changes: 3 additions & 0 deletions public/icons/dynamic/icon-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 15 additions & 6 deletions public/icons/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/app/login/_temp/login-temp-actions.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
'use client';

import { MyPageActionButton } from '@/components/pages/user/mypage/mypage-setting-button';
import { useLogout, useWithdraw } from '@/hooks/use-auth';
import { useLogout, useRefresh, useWithdraw } from '@/hooks/use-auth';

const LoginTempActions = () => {
const logout = useLogout();
const withdraw = useWithdraw();
const refresh = useRefresh();

return (
<div className='flex-center'>
<MyPageActionButton onClick={logout}>로그아웃</MyPageActionButton>
<MyPageActionButton onClick={withdraw}>회원탈퇴</MyPageActionButton>
<MyPageActionButton onClick={refresh}>refresh</MyPageActionButton>
</div>
);
};
Expand Down
14 changes: 8 additions & 6 deletions src/app/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import { cookies } from 'next/headers';

// import { redirect } from 'next/navigation';
import { Icon } from '@/components/icon';
import { LoginForm } from '@/components/pages/login';
import { LoginForm, LoginToastEffect } from '@/components/pages/login';
import { AuthSwitch } from '@/components/shared';

import LoginTempActions from './_temp/login-temp-actions';

const LoginPage = async () => {
type PageProps = {
searchParams: Promise<Record<string, string | string[] | undefined>>;
};

const LoginPage = async ({ searchParams }: PageProps) => {
const cookieStore = await cookies();
const accessToken = cookieStore.get('accessToken')?.value;

// if (accessToken) {
// redirect('/');
// }
const searchParamsData = await searchParams;

return (
<div className='flex-col-center min-h-[calc(100dvh-113px)] gap-10 overflow-auto bg-gray-100 px-4 py-15'>
Expand All @@ -22,6 +23,7 @@ const LoginPage = async () => {
<LoginForm />
</div>
<AuthSwitch type='signup' />
<LoginToastEffect error={searchParamsData.error} />
{/* 📜 임시, 삭제 예정 */}
{accessToken && <LoginTempActions />}
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/components/icon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type DynamicIconId =
| 'bell-read'
| 'calendar-1'
| 'calendar-2'
| 'check'
| 'chevron-left-1'
| 'chevron-left-2'
| 'chevron-right-1'
Expand Down Expand Up @@ -78,6 +79,10 @@ export const iconMetadataMap: IconMetadata[] = [
id: 'calendar-2',
variant: 'dynamic',
},
{
id: 'check',
variant: 'dynamic',
},
{
id: 'chevron-left-1',
variant: 'dynamic',
Expand Down
1 change: 1 addition & 0 deletions src/components/pages/login/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { LoginForm } from './login-form';
export { LoginToastEffect } from './login-toast-effect';
28 changes: 28 additions & 0 deletions src/components/pages/login/login-toast-effect/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use client';

import { useEffect, useRef } from 'react';

import { Toast } from '@/components/ui';
import { useToast } from '@/components/ui/toast/core';

type Props = {
error?: string | string[];
};

export const LoginToastEffect = ({ error }: Props) => {
const { run } = useToast();
const lastErrorRef = useRef<string>('');

useEffect(() => {
if (!error) return;

const normalized = Array.isArray(error) ? error.join(',') : error;

if (lastErrorRef.current === normalized) return;
lastErrorRef.current = normalized;

run(<Toast type='info'>로그인이 필요한 서비스입니다.</Toast>);
}, [error, run]);

return null;
};
81 changes: 81 additions & 0 deletions src/components/pages/signup/signup-agreement-modal/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { ReactNode } from 'react';

import { ModalContent, ModalTitle } from '@/components/ui';

const SubTitle = ({ children }: { children: ReactNode }) => {
return <div className='text-text-sm-bold text-gray-600'>{children}</div>;
};

const Contents = ({ children }: { children: ReactNode }) => {
return <div className='text-text-sm-regular text-gray-600'>{children}</div>;
};

export const SignupAgreementModal = () => {
return (
<ModalContent className='w-9/10'>
<div className='flex flex-col gap-4'>
<ModalTitle>서비스 이용 약관</ModalTitle>

<div className='max-h-94 space-y-4 overflow-y-auto rounded-lg bg-gray-50 p-5'>
<div className='space-y-2'>
<SubTitle>1. 개인정보 수집 및 이용</SubTitle>
<Contents>WeGo는 서비스 제공을 위해 최소한의 개인정보를 수집합니다.</Contents>
</div>

<div className='space-y-2'>
<SubTitle>수집하는 정보</SubTitle>
<Contents>
<ul className='list-disc pl-5'>
<li>이메일 주소</li>
</ul>
</Contents>
</div>

<div className='space-y-2'>
<SubTitle>이용 목적</SubTitle>
<Contents>
<ul className='list-disc pl-5'>
<li>회원 가입 및 본인 확인</li>
<li>서비스 이용에 따른 알림 발송</li>
<li>모임 관련 정보 제공</li>
</ul>
</Contents>
</div>

<div className='space-y-2'>
<SubTitle>개인정보 보호</SubTitle>
<Contents>
<p>수집된 이메일 주소는 서비스 제공 목적 외에 절대 사용하지 않습니다.</p>
<ul className='mt-2 list-disc pl-5'>
<li>제3자에게 제공하거나 판매하지 않습니다</li>
<li>마케팅 목적으로 사용하지 않습니다</li>
</ul>
</Contents>
</div>

<div className='space-y-2'>
<SubTitle>2. 서비스 이용</SubTitle>
<Contents>
<ul className='list-disc pl-5'>
<li>본 서비스는 모임 관리를 위한 플랫폼입니다</li>
<li>타인에게 피해를 주는 행위는 금지됩니다</li>
<li>서비스의 정상적인 운영을 방해하는 행위는 제재 대상입니다</li>
</ul>
</Contents>
</div>

<div className='space-y-2'>
<SubTitle>3. 회원 탈퇴</SubTitle>
<Contents>
<ul className='list-disc pl-5'>
<li>언제든지 회원 탈퇴가 가능합니다</li>
<li>탈퇴 시 개인정보는 즉시 삭제됩니다</li>
<li>관련 법령에 따라 보관이 필요한 경우에만 일정 기간 보관 후 삭제됩니다</li>
</ul>
</Contents>
</div>
</div>
</div>
</ModalContent>
);
};
Loading