Skip to content

Commit

Permalink
Merge pull request #97 from Kernel360/common-component-skeletron
Browse files Browse the repository at this point in the history
공통 컴포넌트: Skeleton
  • Loading branch information
bottlewook authored Jan 20, 2024
2 parents ac32f2f + a1034fb commit c1000ae
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components/shared/skeleton/Skeleton.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.container {
animation: opacity 2s ease-in-out 0.5s infinite;
background-color: var(--gray);
}

@keyframes opacity {
0% {
opacity: 1;
}

50% {
opacity: 0.4;
}

100% {
opacity: 1;
}
}
24 changes: 24 additions & 0 deletions src/components/shared/skeleton/Skeleton.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { Meta, StoryObj } from '@storybook/react';

import Skeleton from './Skeleton';

const meta = {
title: 'Shared/Skeleton',
component: Skeleton,
parameters: {
},
tags: ['autodocs'],
argTypes: {

},
} satisfies Meta<typeof Skeleton>;

export default meta;
type Story = StoryObj<typeof meta>;

export const t1: Story = {
args: {
width: 300,
height: 200,
},
};
18 changes: 18 additions & 0 deletions src/components/shared/skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import classNames from 'classnames/bind';

import styles from './Skeleton.module.scss';

const cx = classNames.bind(styles);

interface SkeletonProps {
width: number
height: number
}

function Skeleton({ width, height }: SkeletonProps) {
return (
<div style={{ width, height }} className={cx('container')} />
);
}

export default Skeleton;

0 comments on commit c1000ae

Please sign in to comment.