Skip to content

Commit

Permalink
feat: 내가 가입한 모임 simple ui 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
WooDaeHyun authored and gxxrxn committed Jun 17, 2024
1 parent 08c919d commit 5dd3e60
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
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: 'Base/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,
eventHandler: moveGroupDetail,
},
};

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

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

const SimpleGroup = ({
title,
isOwner,
eventHandler,
imageSource,
}: SimpleGroupProps) => {
return (
<div
className="flex h-[15rem] w-[10rem] flex-col gap-[0.5rem]"
onClick={eventHandler}
>
<div className="flex h-[11.6rem] w-[10rem] items-center justify-center rounded-[0.534rem] bg-orange-100">
<div className="h-[8.4rem] w-[6.4rem]">
<Image
src={imageSource}
alt="bookgroup"
width={64}
height={84}
style={{ width: '6.4rem', height: '8.4rem' }}
/>
</div>
</div>
<div>
<p className="break-keep text-center">
{isOwner ? `👑 ${title}` : title}
</p>
</div>
</div>
);
};

export default SimpleGroup;
3 changes: 3 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ module.exports = {
800: '#191600',
900: '#000000',
},
orange: {
100: '#F5F4EE',
},
white: '#FFFFFF',
background: '#FCFCFC',
cancel: '#CFCFCF',
Expand Down

0 comments on commit 5dd3e60

Please sign in to comment.