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 #7

Merged
merged 14 commits into from
Jul 10, 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ node_modules


localhost+1-key.pem
localhost+1.pem
localhost+1.pem
*.pem
3 changes: 3 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const nextConfig = {
reactStrictMode: true,
images: {
domains: ['localhost', 'via.placeholder.com'],
},

async rewrites() {
return [
Expand Down
3,431 changes: 1,585 additions & 1,846 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@tanstack/react-query": "^5.40.1",
"axios": "^1.7.2",
"next": "^14.2.3",
"react-cookie": "^7.1.4",
"typescript": "^5.4.5",
"zustand": "^4.5.2"
},
Expand Down
6 changes: 6 additions & 0 deletions src/api/onboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { GET } from '@/network';

export const getInterestList = async () => {
const data = await GET('/interests');
return data.data;
};
11 changes: 4 additions & 7 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import MSWComponent from '@/mocks/MSWWrapper';
import '@/styles/tailwind.css';

const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
title: 'Inspo Mail Club',
description: 'TODO: FIX DESCRIPTION',
};

export default function RootLayout({
Expand All @@ -16,8 +13,8 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang='en'>
<body className={inter.className}>
<html lang='ko'>
<body>
<MSWComponent>{children}</MSWComponent>
</body>
</html>
Expand Down
156 changes: 156 additions & 0 deletions src/app/onboard/emailList/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import ServiceIcon from '@/assets/icons/ServiceIcon';
import EmailListInteraction from '@/components/Onboard/EmailListInteraction';

interface EmailListProps {
userName: string;
}

const EmailList = async ({ userName = '채현' }: EmailListProps) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

userName optional 아니다보니 default값 안넣어줘도 될듯요!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이 부분이 원래는 api를 통해 userData를 받아와야하는 부분인데, api의 연결 이슈로 인해 일단 UI를 보여주기 위해 넣어놓았어요! API 연결하면서 해당 부분을 수정하도록 할게요!

const incomingSenders = await getIncomingSenders();
const incomingSenders2 = await getIncomingSenders2();
Copy link
Contributor

Choose a reason for hiding this comment

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

일단 목데이터라서 네이밍을 1 2로 지은건가요!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

맞습니다 :) 해당 부분은 api 연결하면서 모두 싹다 바뀔것같아서 일단 data holding용입니다

return (
<div className='flex flex-col items-center gap-10 mb-24'>
<span className='flex flex-col items-center gap-2'>
<span className='flex flex-row items-center'>
<ServiceIcon width={195} />
<span className='text-black text-h1'>에서 골라 볼 뉴스레터를 선택하세요</span>
</span>
<span className='text-body3'>골라 볼 뉴스레터 목록은 언제든 수정할 수 있어요.</span>
</span>

<EmailListInteraction
userName={userName}
interest={'IT/테크'}
incomingSenders={incomingSenders}
techSenders={incomingSenders2}
/>
</div>
);
};

export default EmailList;

const getIncomingSenders = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

목데이터라서 이후에 api 호출 코드 들어갈거라서 async로 미리 선언해둔건가요!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 요기도 실제 api연결하려고 했다가 백엔드 배포가 아직 안됐다는걸 깨닫고 함수 body만 갈아끼웠어서 async만 남아있는것 같네요!
이 부분도 실제 api로 갈아끼우는 과정에서 다 바뀔것 같습니다~!

const response = {
senders: [
{
senderId: 'randomString1',
fullAddress: '[email protected]',
localPart: 'inspomailclub1',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString2',
fullAddress: '[email protected]',
localPart: 'inspomailclub2',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString3',
fullAddress: '[email protected]',
localPart: 'inspomailclub3',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString4',
fullAddress: '[email protected]',
localPart: 'inspomailclub4',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString5',
fullAddress: '[email protected]',
localPart: 'inspomailclub5',
domain: 'hedwig.com',
category: 'IT / 테크',
},
],
count: 5,
};

return response;
};

const getIncomingSenders2 = async () => {
const response = {
senders: [
{
senderId: 'randomString1',
fullAddress: '[email protected]',
localPart: 'inspomailclub11',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString2',
fullAddress: '[email protected]',
localPart: 'inspomailclub12',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString3',
fullAddress: '[email protected]',
localPart: 'inspomailclub13',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString4',
fullAddress: '[email protected]',
localPart: 'inspomailclub14',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString5',
fullAddress: '[email protected]',
localPart: 'inspomailclub15',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString6',
fullAddress: '[email protected]',
localPart: 'inspomailclub16',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString7',
fullAddress: '[email protected]',
localPart: 'inspomailclub17',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString8',
fullAddress: '[email protected]',
localPart: 'inspomailclub18',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString9',
fullAddress: '[email protected]',
localPart: 'inspomailclub19',
domain: 'hedwig.com',
category: 'IT / 테크',
},
{
senderId: 'randomString10',
fullAddress: '[email protected]',
localPart: 'inspomailclub20',
domain: 'hedwig.com',
category: 'IT / 테크',
},
],
count: 10,
};

return response;
};
59 changes: 59 additions & 0 deletions src/app/onboard/interest/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { OnboardButton } from '@/components/OnboardButton';
import { getInterestList } from '@/api/onboard';
import InterestInteraction from '@/components/Onboard/InterestInteraction';

interface InterestProps {
userName: string;
}

const Interest = async ({ userName = '채현' }: InterestProps) => {
const interestList = await getInterest();
return (
<div className='flex flex-col items-center justify-start w-full h-full gap-10'>
<span className='flex flex-col items-center gap-2'>
<h1 className='text-black text-h1'>{userName}님, 관심 있는 분야를 선택해주세요</h1>
<div className='text-body3'>맞춤형 인사이트 제공을 위해 ‘1개 이상’ 선택해주세요.</div>
</span>

<InterestInteraction interestList={interestList} />
</div>
);
};

export default Interest;

const getInterest = async () => {
const interestList = [
{
id: 'randomstring1',
interest: '시사',
desc: '세상 돌아가는',
},
{
id: 'randomstring2',
interest: 'IT/테크',
desc: '최신 테크',
},
{
id: 'randomstring3',
interest: '디자인',
desc: '디자인 영감',
},
{
id: 'randomstring4',
interest: '경제',
desc: '핵심 기업',
},
{
id: 'randomstring5',
interest: '트렌드',
desc: '글로벌 트렌드',
},
{
id: 'randomstring6',
interest: '채용',
desc: '신규 채용',
},
];
return interestList;
};
22 changes: 22 additions & 0 deletions src/app/onboard/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Metadata } from 'next';
import MSWComponent from '@/mocks/MSWWrapper';
import '@/styles/tailwind.css';
import { Header } from '@/components/Header';

export const metadata: Metadata = {
title: 'Inspo Mail Club',
description: 'TODO: FIX DESCRIPTION',
};

export default function OnBoardLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<MSWComponent>
<Header isMain={false} />
<div className='flex justify-center w-full h-full mt-12'>{children}</div>
</MSWComponent>
);
}
55 changes: 55 additions & 0 deletions src/app/onboard/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import ServiceIcon from '@/assets/icons/ServiceIcon';
import Carousel from '@/components/Carousel/Carousel';
import Image from 'next/image';
import GoogleIcon from '@/assets/icons/GoogleIcon.png';
import Link from 'next/link';

const OnBoard = () => {
const BLUR_DATA_URL = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mOcUg8AAa0BFSX8uBwAAAAASUVORK5CYII=';
return (
<div className='flex flex-col items-center gap-10'>
<span className='flex flex-col items-center'>
<span className='flex flex-row items-center'>
<ServiceIcon width={195} />
<span className='text-black text-h1'>은 관리되지 않는 메일함 속에서</span>
</span>
<span className='text-black text-h1'>방치되는 유익한 메일을 큐레이팅해요</span>
</span>
{/* <Carousel width={690} height={400} length={3}>
<Carousel.Wrapper>
<Carousel.Item index={0}>
<img src='https://via.placeholder.com/690x400' alt='carousel1' />
</Carousel.Item>
<Carousel.Item index={1}>
<img src='https://via.placeholder.com/690x400' alt='carousel2' />
</Carousel.Item>
<Carousel.Item index={2}>
<img src='https://via.placeholder.com/690x400' alt='carousel3' />
</Carousel.Item>
</Carousel.Wrapper>
<Carousel.Dots imageLength={3} />
<Carousel.Move direction='prev' />
<Carousel.Move direction='next' />
</Carousel> */}
<Image
placeholder='blur'
blurDataURL='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFklEQVR42mN8//HLfwYiAOOoQvoqBABbWyZJf74GZgAAAABJRU5ErkJggg=='
src='http://via.placeholder.com/690x400'
alt='carousel'
width={690}
height={400}
/>
<Link href='/onboard/interest'>
<Image
className='cursor-pointer'
placeholder='blur'
src={GoogleIcon}
alt='google login'
width={350}
height={64}
/>
</Link>
</div>
);
};
export default OnBoard;
Loading
Loading