Skip to content

Commit

Permalink
feat : VerticalScroll컴포넌트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyesung99 committed Oct 25, 2023
1 parent 8cd165b commit 571f028
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/common/VerticalScroll/VerticalScroll.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import styled from '@emotion/styled';

interface VerticalScrollStyledProps {
height: string;
}

const VerticalScrollStyled = styled.div<VerticalScrollStyledProps>`
height: ${({ height }) => height + 'rem'};
overflow: auto;
`;

export { VerticalScrollStyled };
16 changes: 16 additions & 0 deletions src/components/common/VerticalScroll/VerticalScroll.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { VerticalScrollStyled } from './VerticalScroll.style';

interface VerticalScrollProps extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode;
height: string;
}

const VerticalScroll = ({ children, height, ...props }: VerticalScrollProps) => {
return (
<VerticalScrollStyled height={height} {...props}>
{children}
</VerticalScrollStyled>
);
};

export default VerticalScroll;

0 comments on commit 571f028

Please sign in to comment.