Skip to content

Commit

Permalink
feat : 라벨뽑기 페이지 수정 (#248)
Browse files Browse the repository at this point in the history
* feat : 타이틀과 닫기버튼이 있는 앱바 컴포넌트 분리

* feat : 라벨뽑기 페이지 수정
  • Loading branch information
kangminguu authored Dec 5, 2024
1 parent 755b6ad commit 16a6824
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 32 deletions.
Binary file added public/라벨_샘플_01.png
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 public/라벨_샘플_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import type { Meta, StoryObj } from '@storybook/react';
import { MemoryRouter } from 'react-router-dom';
import { TitleClosedTopBar } from './TitleClosedTopBar';

const meta: Meta<typeof TitleClosedTopBar> = {
component: TitleClosedTopBar,
title: 'molecule/TitleClosedTopBar',
tags: ['autodocs'],
argTypes: {},
parameters: {
docs: {
description: {
component:
'이전 페이지로 이동하는 x버튼과 타이틀이 있는 앱 바 입니다.'
}
}
},
decorators: [
(Story) => (
<MemoryRouter>
<Story />
</MemoryRouter>
)
]
};
export default meta;

type Story = StoryObj<typeof TitleClosedTopBar>;

export const Default: Story = {
args: {
title: '제목'
}
};
22 changes: 22 additions & 0 deletions src/components/Common/TitleClosedTopBar/TitleClosedTopBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { IoCloseOutline } from 'react-icons/io5';
import { useNavigate } from 'react-router-dom';

type TitleClosedTopBarProps = {
title?: string;
};

export const TitleClosedTopBar = ({ title = '' }: TitleClosedTopBarProps) => {
const navicate = useNavigate();

return (
<div className="w-full flex items-center justify-between">
<h1 className="text-[20px] font-semibold text-[#5C5C5C]">
{title}
</h1>

<button onClick={() => navicate(-1)}>
<IoCloseOutline className="size-[34px] text-[#5C5C5C]" />
</button>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { Meta, StoryObj } from '@storybook/react';

import { LotteryAnimationContainer } from './LotteryAnimationContainer';

const meta: Meta<typeof LotteryAnimationContainer> = {
component: LotteryAnimationContainer,
title: 'LotteryAnimationContainer',
tags: ['autodocs'],
argTypes: {}
};
export default meta;

type Story = StoryObj<typeof LotteryAnimationContainer>;

export const Default: Story = {
args: {}
};
38 changes: 38 additions & 0 deletions src/components/LabelLotteryPage/LotteryAnimationContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export const LotteryAnimationContainer = () => {
return (
<div className="relative">
<div className="absolute top-0 left-1/2 -translate-x-[calc(50%+10px)] rotate-[67deg]">
<div className="animate-wiggle-more animate-infinite animate-duration-[3000ms] animate-ease-in-out">
<img
src="/라벨_샘플_01.png"
className="h-[120px] aspect-ratio"
/>
</div>
</div>

<div className="absolute top-[60px] left-1/2 -translate-x-[calc(50%-10px)] -rotate-[75deg]">
<div className="animate-wiggle-more animate-infinite animate-duration-[3000ms] animate-delay-[0000ms] animate-ease-in-out">
<img
src="/라벨_샘플_02.png"
className="h-[120px] aspect-ratio"
/>
</div>
</div>

<div className="absolute top-[130px] left-1/2 -translate-x-[calc(50%+10px)] rotate-[75deg]">
<div className="animate-wiggle-more animate-infinite animate-duration-[3000ms] animate-delay-[0000ms] animate-ease-in-out">
<img
src="/라벨_샘플_01.png"
className="h-[120px] aspect-ratio"
/>
</div>
</div>

<div className="absolute top-[10px] left-[40px] size-[50px] rounded-full bg-[#ea4444] animate-bounce animate-infinite animate-duration-[1200ms]"></div>

<div className="absolute top-[60px] right-[60px] size-[30px] rounded-full bg-[#5eb0eb] animate-bounce animate-infinite animate-duration-[1000ms]"></div>

<div className="absolute top-[180px] right-[100px] size-[40px] rounded-full bg-[#f5c33a] animate-bounce animate-infinite animate-duration-[1500ms]"></div>
</div>
);
};
14 changes: 0 additions & 14 deletions src/components/NotificationPage/NotificationAppBar.tsx

This file was deleted.

34 changes: 21 additions & 13 deletions src/pages/Label/Lottery/LabelLotteryPage.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
import { Margin } from '@/components/Common/Margin/Margin';
import { Container } from '@/components/Common/Container/Container';
import { Margin } from '@/components/Common/Margin/Margin';
import { TitleClosedTopBar } from '@/components/Common/TitleClosedTopBar/TitleClosedTopBar';
import { LotteryAnimationContainer } from '@/components/LabelLotteryPage/LotteryAnimationContainer';

export const LabelLotteryPage = () => {
return (
<Container>
<div className="h-[100vh] flex-center flex-col gap-[10px]">
<div className="bg-slate-500 h-[200px] w-full px-[50px]"></div>
<Margin top={20} />

<TitleClosedTopBar />

<Margin top={30} />
<Margin top={80}>
<div className="h-[250px] w-full">
<LotteryAnimationContainer />
</div>

<p>뽑기 이벤트</p>
<p>라벨 프로필사진 뽑아보세요</p>
<div className="flex-center flex-col">
<p className="mt-4 text-title2 text-sample-blue">
뽑기 이벤트
</p>
<p className="text-body1 text-sample-textgray">
라벨 프로필사진 뽑아보세요
</p>
</div>

<Margin top={50} />

<div>
<button className="btn-base w-[240px] h-[60px]">
<div className="flex-center px-20">
<button className="mt-4 w-full h-[49px] text-white flex-center rounded-full bg-sample-blue">
뽑기
</button>
<Margin top={10} />
<button className="btn-base w-[240px] h-[60px]">
친구공유
</button>
</div>
</div>
</Margin>
</Container>
);
};
11 changes: 7 additions & 4 deletions src/pages/Notification/NotificationPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Container } from '@/components/Common/Container/Container';
import { Margin } from '@/components/Common/Margin/Margin';
import { NotificationAppBar } from '@/components/NotificationPage/NotificationAppBar';
import { TitleClosedTopBar } from '@/components/Common/TitleClosedTopBar/TitleClosedTopBar';
import { NotificationContainer } from '@/components/NotificationPage/NotificationContainer';
import { NotificationType } from '@/types/notification';

Expand Down Expand Up @@ -76,8 +77,10 @@ export const NotificationPage = () => {
}));

return (
<div className="p-5">
<NotificationAppBar />
<Container>
<Margin top={20} />

<TitleClosedTopBar title="알림" />

<Margin top={20} />

Expand All @@ -94,6 +97,6 @@ export const NotificationPage = () => {
<Margin top={8} />
<NotificationContainer notifications={readNotifications} />
</div>
</div>
</Container>
);
};
1 change: 0 additions & 1 deletion src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
StoragePage
} from './pages';
import { Margin } from './components/Common/Margin/Margin';
import { TopButtonContainer } from '@/components/HomePage/TopButtonContainer/TopButtonContainer';

const CommonLayout = () => (
<>
Expand Down

0 comments on commit 16a6824

Please sign in to comment.