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] 쇼케이스 페이지 club profile card 구현 #52

Merged
merged 17 commits into from
Jul 9, 2024
Merged
16 changes: 16 additions & 0 deletions src/common/asset/svg/default_profile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/common/type/design.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export type Size = 'xxSmall' | 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge';
export type TextSize = 'body1' | 'body2' | 'body3' | 'body4' | 'body5' | 'body6';
export type TextSize = 'body1' | 'body2' | 'body3' | 'body4' | 'body5' | 'body6' | 'body7' | 'body8';
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { css } from '@emotion/react';

export const containerStyle = css({ width: '100%' });

export const imageStyle = css({
width: '100%',

borderRadius: '16px 16px 0px 0px',

objectFit: 'cover',
aspectRatio: 16 / 9,
});

export const descriptionStyle = css({
display: 'flex',
flexDirection: 'column',
gap: '0.6rem',

padding: '1.6rem',
});

export const detailStyle = css({
height: '3.4rem',

overflow: 'hidden',
});
32 changes: 32 additions & 0 deletions src/page/showcase/component/ClubProfileCard/ClubProfileCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import {
containerStyle,
descriptionStyle,
detailStyle,
imageStyle,
} from '@/page/showcase/component/ClubProfileCard/ClubProfileCard.style';

import defaultImage from '@/common/asset/svg/default_profile.svg';
import Heading from '@/common/component/Heading/Heading';
import Text from '@/common/component/Text/Text';

interface ClubProfileCardProps {
title: string;
detail: string;
imageUrl?: string;
}

const ClubProfileCard = ({ title, detail, imageUrl }: ClubProfileCardProps) => {
return (
<article css={containerStyle}>
<img src={imageUrl ? imageUrl : defaultImage} alt={`${title}-image`} css={imageStyle} />
<div css={descriptionStyle}>
<Heading tag="H6">{title}</Heading>
<Text tag="body7" css={detailStyle}>
{detail}
</Text>
</div>
</article>
);
};

export default ClubProfileCard;
8 changes: 2 additions & 6 deletions src/story/page/archiving/DaySection.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const meta = {
},
args: {
day: 1,
onDayClick: () => {},
isClicked: false,
},
argTypes: {
day: {
Expand All @@ -23,8 +23,4 @@ const meta = {
export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
onDayClick: () => {},
},
};
export const Default: Story = {};
32 changes: 32 additions & 0 deletions src/story/page/showcase/ClubProfileCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import ClubProfileCard from '@/page/showcase/component/ClubProfileCard/ClubProfileCard';
import type { Meta, StoryObj } from '@storybook/react';

const meta = {
title: 'Page/ClubProfileCard',
component: ClubProfileCard,
parameters: {
layout: 'centered',
},
args: {
title: 'Tiki 티키',
detail: '안녕하세요 티키입니다. 저희는 멋진 웹사이트를 제작합니다.',
imageUrl: '',
},
argTypes: {
title: {
control: {
type: 'text',
},
},
detail: {
control: {
type: 'text',
},
},
},
} satisfies Meta<typeof ClubProfileCard>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Default: Story = {};