Skip to content

Commit

Permalink
#47 refactor: image url 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongbowoon committed Jul 9, 2024
1 parent 00de606 commit 103520c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import { css } from '@emotion/react';

import { theme } from '@/common/style/theme/theme';

export const containerStyle = css({ width: '24.35rem' });

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

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

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

export const descriptionStyle = css({
Expand Down
13 changes: 8 additions & 5 deletions src/page/showcase/component/ClubProfileCard/ClubProfileCard.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
import {
containerStyle,
descriptionStyle,
detailStyle,
imageStyle,
titleStyle,
} from '@/page/showcase/component/ClubProfileCard/ClubProfileCard.style';

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

interface ClubProfileCardProps {
title: string;
detail: string;
Image: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
imageUrl?: string;
}

const ClubProfileCard = ({ title, detail, Image }: ClubProfileCardProps) => {
const ClubProfileCard = ({ title, detail, imageUrl }: ClubProfileCardProps) => {
return (
<>
<Image css={imageStyle} />
<section css={containerStyle}>
<img src={imageUrl ? imageUrl : defaultImage} alt={`${title}-image`} css={imageStyle} />
<div css={descriptionStyle}>
<p css={titleStyle}>{title}</p>
<p css={detailStyle}>{detail}</p>
</div>
</>
</section>
);
};

Expand Down
3 changes: 1 addition & 2 deletions src/story/page/showcase/ClubProfileCard.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import ClubProfileCard from '@/page/showcase/component/ClubProfileCard/ClubProfileCard';
import Image from '@/page/showcase/constant/empty.svg?react';
import type { Meta, StoryObj } from '@storybook/react';

const meta = {
Expand All @@ -11,7 +10,7 @@ const meta = {
args: {
title: 'Tiki 티키',
detail: '안녕하세요 티키입니다. 저희는 멋진 웹사이트를 제작합니다.',
Image: Image,
imageUrl: '',
},
argTypes: {
title: {
Expand Down

0 comments on commit 103520c

Please sign in to comment.