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

[#407][독서 모임] 참여중인 모임 포스트 컴포넌트 #422

Merged
merged 4 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
34 changes: 34 additions & 0 deletions src/stories/bookgroup/SimpleGroup.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Meta, StoryObj } from '@storybook/react';
import SimpleGroup from '@/v1/bookgroup/SimpleGroup';

const meta: Meta<typeof SimpleGroup> = {
title: 'BookGroup/SimpleGroup',
component: SimpleGroup,
tags: ['autodocs'],
};

export default meta;

type Story = StoryObj<typeof SimpleGroup>;

const moveGroupDetail = () => {
alert('모임 상세 페이지로 이동');
};

export const Default: Story = {
args: {
title: '데일카네기 인간관계론',
imageSource: 'https://image.yes24.com/goods/79297023/XL',
isOwner: false,
handleClick: moveGroupDetail,
},
};

export const OwnerCase: Story = {
args: {
title: '데일카네기 인간관계론',
imageSource: 'https://image.yes24.com/goods/79297023/XL',
isOwner: true,
handleClick: moveGroupDetail,
},
};
39 changes: 39 additions & 0 deletions src/v1/bookgroup/SimpleGroup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import Image from 'next/image';

interface SimpleGroupProps {
title: string;
isOwner: boolean;
imageSource: string;
handleClick: () => void;
}

const SimpleGroup = ({
minjongbaek marked this conversation as resolved.
Show resolved Hide resolved
title,
isOwner,
handleClick,
imageSource,
}: SimpleGroupProps) => {
return (
<div
className="flex h-[15rem] w-[10rem] flex-col gap-[0.5rem]"
WooDaeHyun marked this conversation as resolved.
Show resolved Hide resolved
onClick={handleClick}
>
<div className="h-[11.6rem] w-[10rem] rounded-[0.534rem] bg-orange-100 px-[1.8rem] py-[1.6rem]">
<Image
src={imageSource}
alt="bookgroup"
width={64}
height={84}
className="h-[8.4rem] w-[6.4rem] rounded-[0.412rem]"
/>
</div>
<div>
<p className="break-keep text-center">
{isOwner ? `👑 ${title}` : title}
</p>
</div>
</div>
);
};

export default SimpleGroup;
4 changes: 4 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
'./src/app/**/*.{ts,tsx}',
'./src/stories/**/*.{ts,tsx}',
'./.storybook/**/*.{ts,tsx}',
'./src/v1/**/*.{ts,tsx}',
],
theme: {
extend: {
Expand Down Expand Up @@ -51,6 +52,9 @@ module.exports = {
800: '#191600',
900: '#000000',
},
orange: {
100: '#F5F4EE',
},
white: '#FFFFFF',
background: '#FCFCFC',
cancel: '#CFCFCF',
Expand Down