Skip to content

Commit bcb08f5

Browse files
committed
#37 feat: 블록 앞 아이콘 배치
1 parent be9aa30 commit bcb08f5

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

src/common/asset/svg/eclipse.svg

Lines changed: 11 additions & 0 deletions
Loading

src/page/archiving/component/TimeBlock/TimeBlock.style.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export const blockStyle = {
88
padding: '0.5rem',
99
justifyContent: 'center',
1010
alignItems: 'center',
11-
gap: '0.5rem',
1211

1312
borderRadius: '10rem',
1413

@@ -19,3 +18,11 @@ export const blockStyle = {
1918
textOverflow: 'ellipsis',
2019
whiteSpace: 'nowrap',
2120
};
21+
22+
export const spanStyle = {
23+
padding: '2rem 0.8rem',
24+
25+
overflow: 'hidden',
26+
textOverflow: 'ellipsis',
27+
whiteSpace: 'nowrap',
28+
};

src/page/archiving/component/TimeBlock/TimeBlock.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
import { blockStyle } from '@/page/archiving/component/TimeBlock/TimeBlock.style';
1+
import { blockStyle, spanStyle } from '@/page/archiving/component/TimeBlock/TimeBlock.style';
22

33
import { ReactNode } from 'react';
44

5+
import Eclipse from '@/common/asset/svg/eclipse.svg?react';
6+
57
interface TimeBlockProps {
68
children: ReactNode;
79
}
810

911
const TimeBlock = ({ children }: TimeBlockProps) => {
1012
return (
1113
<>
12-
<div css={blockStyle}>{children}</div>
14+
<div css={blockStyle}>
15+
<Eclipse width={47} height={47} css={{ flexShrink: 0 }} />
16+
<span css={spanStyle}>{children}</span>
17+
</div>
1318
</>
1419
);
1520
};

src/story/page/archiving/TimeBlock.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import TimeBlock from '@/page/archiving/component/TimeBlock/TimeBlock';
2-
import { Meta, StoryObj } from '@storybook/react/*';
2+
import { Meta, StoryObj } from '@storybook/react';
33

44
const meta = {
55
title: 'Page/Archiving/TimeBlock',
@@ -8,7 +8,7 @@ const meta = {
88
layout: 'centered',
99
},
1010
args: {
11-
children: 'TimeBlock',
11+
children: ['타임 블록fjlaeijfla'],
1212
},
1313
argTypes: {
1414
children: {

0 commit comments

Comments
 (0)