Skip to content

Commit

Permalink
feat: Add Loading components
Browse files Browse the repository at this point in the history
  • Loading branch information
zukki30 committed May 25, 2022
1 parent e8ede48 commit f7dbb25
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/components/common/Loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from "react";

import styled from "styled-components";
import tw from "twin.macro";

const LoadingContainer = styled.header`
${tw`
w-full
h-screen
flex
justify-center
content-center
`}
`;

const LoadingIcon = styled.div`
${tw`
animate-spin
h-10
w-10
border-4
border-sky-500
rounded-full
border-t-transparent
`}
`;
const Loading = () => {
return (
<LoadingContainer>
<LoadingIcon />
</LoadingContainer>
);
};

export default Loading;
13 changes: 13 additions & 0 deletions src/stories/common/Loading.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";

import Loading from "@/components/common/Loading";

export default {
title: "components/common/Loading",
component: Loading,
} as ComponentMeta<typeof Loading>;

const Template: ComponentStory<typeof Loading> = () => <Loading />;

export const Default = Template.bind({});

0 comments on commit f7dbb25

Please sign in to comment.