Merge pull request #138 from jojopirker/newLoading

New loading screen component
This commit is contained in:
Keith Stevens
2022-12-29 20:22:06 +09:00
committed by GitHub
7 changed files with 60 additions and 21 deletions
@@ -0,0 +1,16 @@
import { LoadingScreen } from "./LoadingScreen";
export default {
title: "Example/LoadingScreen",
component: LoadingScreen,
parameters: {
layout: "fullscreen",
},
};
const Template = (args) => <LoadingScreen {...args} />;
export const Default = Template.bind({});
export const WithText = Template.bind({});
WithText.args = { text: "Loading Text ..." };
@@ -0,0 +1,12 @@
import { Progress } from "@chakra-ui/react";
export const LoadingScreen = ({ text }) => (
<div className="bg-slate-100">
<Progress size="xs" isIndeterminate />
{text && (
<div className="flex h-full">
<div className="text-xl font-bold text-gray-800 mx-auto my-auto">{text}</div>
</div>
)}
</div>
);