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

feat: 로그인 유도 BottomSheet 추가 #104

Merged
merged 5 commits into from
Jan 11, 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
23 changes: 23 additions & 0 deletions src/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.
18 changes: 18 additions & 0 deletions src/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.
18 changes: 18 additions & 0 deletions src/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.
3 changes: 3 additions & 0 deletions src/assets/icons/reverse-triangle.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/assets/images/bandiboodi-3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/atoms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export { Span } from './span';
export { Star } from './star';
export { Tag } from './tag';
export { Textarea } from './textarea';
export { ToolTip } from './toolTip';
export { Typography } from './typography';
18 changes: 18 additions & 0 deletions src/components/atoms/toolTip/ToolTip.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Meta, StoryObj } from '@storybook/react';

import { ToolTip } from './ToolTip';

const meta: Meta<typeof ToolTip> = {
title: 'components/atoms/toolTip',
component: ToolTip,
};

export default meta;

type Story = StoryObj<typeof ToolTip>;

export const Basic: Story = {
args: {
title: '3초만에 시작하기',
},
};
19 changes: 19 additions & 0 deletions src/components/atoms/toolTip/ToolTip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { colors } from '@/../styles/theme';
import ReverseTriangleIcon from '@/assets/icons/reverse-triangle.svg';

import { Typography } from '../typography';

interface ToolTipProps {
title: string;
}

export const ToolTip = ({ title }: ToolTipProps) => {
return (
<div className="w-fit px-3xs py-5xs flex items-center justify-center bg-blue-30 rounded-[12px] relative">
<Typography type="title5" className="text-white">
{title}
</Typography>
<ReverseTriangleIcon width={14} height={10} fill={colors.blue[30]} className="absolute bottom-[-9px]" />
</div>
);
};
1 change: 1 addition & 0 deletions src/components/atoms/toolTip/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ToolTip } from './ToolTip';
1 change: 1 addition & 0 deletions src/components/molecules/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { ContentWrapper } from './contentWrapper';
export { LimitedLengthInput } from './limitedLengthInput';
export { LoginIconSet } from './loginIconSet';
export { SelectableCardList } from './selectableCardList';
export { Tabs } from './tabs';
23 changes: 23 additions & 0 deletions src/components/molecules/loginIconSet/LoginIconSet.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { Meta, StoryObj } from '@storybook/react';

import { LoginIconSet } from './LoginIconSet';

const meta: Meta<typeof LoginIconSet> = {
title: 'components/molecules/loginIconSet',
component: LoginIconSet,
decorators: [
(Story) => (
<div className="w-[240px]">
<Story />
</div>
),
],
};

export default meta;

type Story = StoryObj<typeof LoginIconSet>;

export const Basic: Story = {
render: () => <LoginIconSet naver google kakao />,
};
39 changes: 39 additions & 0 deletions src/components/molecules/loginIconSet/LoginIconSet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import Link from 'next/link';

import GoogleIcon from '@/assets/icons/google.svg';
import KakaoIcon from '@/assets/icons/kakao.svg';
import NaverIcon from '@/assets/icons/naver.svg';

interface LoginIconSetProps {
google?: boolean;
naver?: boolean;
kakao?: boolean;
}

const loginPath = {
google: `${process.env.NEXT_PUBLIC_API_URL}/oauth2/authorization/google`,
naver: `${process.env.NEXT_PUBLIC_API_URL}/oauth2/authorization/naver`,
kakao: '', // TODO: 개발 후 추가
};

export const LoginIconSet = ({ google = false, naver = false, kakao = false }: LoginIconSetProps) => {
return (
<div className="w-fit flex justify-between items-center">
{kakao && (
<Link href={{ pathname: loginPath.kakao }}>
<KakaoIcon />
</Link>
)}
{google && (
<Link href={{ pathname: loginPath.google }}>
<GoogleIcon />
</Link>
)}
{naver && (
<Link href={{ pathname: loginPath.naver }}>
<NaverIcon />
</Link>
)}
</div>
);
};
1 change: 1 addition & 0 deletions src/components/molecules/loginIconSet/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { LoginIconSet } from './LoginIconSet';
Doeunnkimm marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { Meta, StoryObj } from '@storybook/react';

import { LoginBottomSheet } from './LoginBottomSheet';

import './LoginBottomSheet.styles.css';

const meta: Meta<typeof LoginBottomSheet> = {
title: 'features/home/loginBottomSheet',
component: LoginBottomSheet,
};

export default meta;

type Story = StoryObj<typeof LoginBottomSheet>;

export const Basic: Story = {
args: {
open: true,
onClose: () => {},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[data-rsbs-header] {
@apply bg-gradient6 h-full rounded-[15px];
}

[data-rsbs-content] {
@apply absolute w-full top-[15px] z-10;
}
Comment on lines +1 to +7
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

Choose a reason for hiding this comment

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

감탄하고 간다... 🫢 + 1

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Image from 'next/image';

import BandiBoodi3DImage from '@/assets/images/bandiboodi-3d.png';
import LogoImage from '@/assets/images/logo.png';
import { BottomSheet, LoginIconSet, ToolTip, Typography } from '@/components';

import { StarBg } from './StarBg';

interface LoginBottomSheetProps {
open: boolean;
onClose: VoidFunction;
}

export const LoginBottomSheet = ({ open, onClose }: LoginBottomSheetProps) => {
return (
<BottomSheet open={open} onDismiss={onClose} fixedMaxHeight={504}>
<div className="relative w-full h-[490px] flex flex-col items-center pt-sm">
<StarBg />
<div className="flex flex-col gap-4xs px-[49px] items-center">
<Image src={LogoImage} width={133} alt="logo" />
<Typography className="text-blue-50 font-insungit font-medium">내가 직접 그리는 나의 인생 지도</Typography>
Copy link
Collaborator

Choose a reason for hiding this comment

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

거의 동일한 게 Typography type에 있네~ 둘다 로그인 화면에 사용되는 부분이라 통일해도 좋을 것 같은데~ 일단 나중에 작업할 때 비슷한 거 있다고 참고만 해줘~~~~~

Suggested change
<Typography className="text-blue-50 font-insungit font-medium">내가 직접 그리는 나의 인생 지도</Typography>
<Typography type="header1">내가 직접 그리는 나의 인생 지도</Typography>

변경 전:
스크린샷 2024-01-11 203203

변경 후:
image

</div>
<div className="absolute bottom-0 w-full h-[237px] pt-[100px] bg-gradient7 flex flex-col gap-4xs items-center">
<ToolTip title="3초만에 시작하기" />
<LoginIconSet google />
</div>
<div className="absolute top-[127px]">
<Image src={BandiBoodi3DImage} width={220} alt="bandiboodi" />
</div>
</div>
</BottomSheet>
);
};
12 changes: 12 additions & 0 deletions src/features/home/components/loginBottomSheet/StarBg.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Star } from '@/components';

export const StarBg = () => {
return (
<>
<Star size={24} position={{ x: 'left-[69px]', y: 'top-[12px]' }} />
<Star size={24} position={{ x: 'right-[69px]', y: 'top-[86px]' }} />
<Star size={19} position={{ x: 'left-[41px]', y: 'top-[164px]' }} />
<Star size={19} position={{ x: 'right-[31px]', y: 'top-[202px]' }} />
</>
);
};
1 change: 1 addition & 0 deletions src/features/home/components/loginBottomSheet/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { LoginBottomSheet } from './LoginBottomSheet';
3 changes: 3 additions & 0 deletions styles/theme/backgroundImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ export const backgroundImage = {
gradient3: 'linear-gradient(90deg, rgba(140,104,255,1) 0%, rgba(113,203,255,1) 100%)',
gradient4: 'linear-gradient(90deg, rgba(64,94,206,1) 0%, rgba(95,121,214,1) 50%, rgba(127,108,244,1) 100%)',
gradient5: 'linear-gradient(295deg, rgba(252, 243, 255, 1) -2.54%, rgba(234, 241, 255, 1) 100.8%)',
gradient6: 'linear-gradient(233deg, rgba(200, 180, 255, 1) -50.9%, rgba(255, 255, 255, 0) 87.98%)',
gradient7:
'linear-gradient(180deg, rgba(169, 194, 220, 1) 0%, rgba(207, 223, 242, 1) 17.71%, rgba(203, 211, 221, 1) 54.17%, rgba(210, 216, 222, 1) 68.69%)',
};