-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08c919d
commit 5dd3e60
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters