Skip to content

Commit 103520c

Browse files
author
Jeongbowoon
committed
#47 refactor: image url 수정
1 parent 00de606 commit 103520c

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed
File renamed without changes.

src/page/showcase/component/ClubProfileCard/ClubProfileCard.style.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ import { css } from '@emotion/react';
22

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

5+
export const containerStyle = css({ width: '24.35rem' });
6+
57
export const imageStyle = css({
68
width: '100%',
79
height: '14rem',
810

911
borderRadius: '16px 16px 0px 0px',
12+
13+
objectFit: 'none',
14+
aspectRatio: 16 / 9,
1015
});
1116

1217
export const descriptionStyle = css({

src/page/showcase/component/ClubProfileCard/ClubProfileCard.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
import {
2+
containerStyle,
23
descriptionStyle,
34
detailStyle,
45
imageStyle,
56
titleStyle,
67
} from '@/page/showcase/component/ClubProfileCard/ClubProfileCard.style';
78

9+
import defaultImage from '@/common/asset/svg/default_profile.svg';
10+
811
interface ClubProfileCardProps {
912
title: string;
1013
detail: string;
11-
Image: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
14+
imageUrl?: string;
1215
}
1316

14-
const ClubProfileCard = ({ title, detail, Image }: ClubProfileCardProps) => {
17+
const ClubProfileCard = ({ title, detail, imageUrl }: ClubProfileCardProps) => {
1518
return (
16-
<>
17-
<Image css={imageStyle} />
19+
<section css={containerStyle}>
20+
<img src={imageUrl ? imageUrl : defaultImage} alt={`${title}-image`} css={imageStyle} />
1821
<div css={descriptionStyle}>
1922
<p css={titleStyle}>{title}</p>
2023
<p css={detailStyle}>{detail}</p>
2124
</div>
22-
</>
25+
</section>
2326
);
2427
};
2528

src/story/page/showcase/ClubProfileCard.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import ClubProfileCard from '@/page/showcase/component/ClubProfileCard/ClubProfileCard';
2-
import Image from '@/page/showcase/constant/empty.svg?react';
32
import type { Meta, StoryObj } from '@storybook/react';
43

54
const meta = {
@@ -11,7 +10,7 @@ const meta = {
1110
args: {
1211
title: 'Tiki 티키',
1312
detail: '안녕하세요 티키입니다. 저희는 멋진 웹사이트를 제작합니다.',
14-
Image: Image,
13+
imageUrl: '',
1514
},
1615
argTypes: {
1716
title: {

0 commit comments

Comments
 (0)