Skip to content

Commit a9b2580

Browse files
committed
#37 feat: 블록 width 넘겨주기
1 parent bcb08f5 commit a9b2580

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export const blockStyle = {
44
display: 'flex',
55

66
height: '5.6rem',
7-
marginRight: 'auto',
87
padding: '0.5rem',
98
justifyContent: 'center',
109
alignItems: 'center',
@@ -21,6 +20,7 @@ export const blockStyle = {
2120

2221
export const spanStyle = {
2322
padding: '2rem 0.8rem',
23+
marginRight: 'auto',
2424

2525
overflow: 'hidden',
2626
textOverflow: 'ellipsis',

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import Eclipse from '@/common/asset/svg/eclipse.svg?react';
66

77
interface TimeBlockProps {
88
children: ReactNode;
9+
width: number;
910
}
1011

11-
const TimeBlock = ({ children }: TimeBlockProps) => {
12+
const TimeBlock = ({ children, width }: TimeBlockProps) => {
1213
return (
1314
<>
14-
<div css={blockStyle}>
15+
<div css={[blockStyle, { width: `${width}rem` }]}>
1516
<Eclipse width={47} height={47} css={{ flexShrink: 0 }} />
1617
<span css={spanStyle}>{children}</span>
1718
</div>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@ const meta = {
88
layout: 'centered',
99
},
1010
args: {
11-
children: ['타임 블록fjlaeijfla'],
11+
children: ['타임 블록'],
12+
width: 10,
1213
},
1314
argTypes: {
1415
children: {
1516
control: {
1617
type: 'text',
1718
},
1819
},
20+
width: {
21+
control: {
22+
type: 'number',
23+
},
24+
},
1925
},
2026
} satisfies Meta<typeof TimeBlock>;
2127

0 commit comments

Comments
 (0)