Skip to content

Commit

Permalink
refactor: [1주차 리뷰] gap을 optional 타입으로 지정
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyoeunkh committed Jun 30, 2024
1 parent 7f91189 commit b75eff0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/Layout/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from '@emotion/styled';
import { css } from '@emotion/react';

export interface IGrid {
gap: number;
gap?: number;
children: React.ReactNode;
columns: number | 'ResponseGridStyle';
}
Expand Down Expand Up @@ -38,6 +38,6 @@ const GridContainer = styled.div<IGrid>`
display: grid;
grid-template-columns: ${(props) =>
props.columns === 'ResponseGridStyle' ? columnStyles : `repeat(${props.columns}, 1fr)`};
gap: ${(props) => props.gap};
gap: ${(props) => `${props.gap}px`};
align-items: center;
`;
1 change: 0 additions & 1 deletion src/stories/Grid.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const Template: StoryFn<IGrid> = (args) => <Grid {...args} />;

export const Default = Template.bind({});
Default.args = {
gap: 1,
children: Array.from({ length: 16 }, (_, index) => <div key={index}>{index + 1}</div>),
columns: 3,
};

0 comments on commit b75eff0

Please sign in to comment.