new LoadingScreen to replace old loading divs

This commit is contained in:
jojopirker
2022-12-28 20:49:03 +01:00
parent f208f65faf
commit d4887e0054
7 changed files with 57 additions and 18 deletions
@@ -0,0 +1,16 @@
import { LoadingScreen } from "./LoadingScreen";
export default {
title: "Example/LoadingScreen",
component: LoadingScreen,
parameters: {
layout: "fullscreen",
},
};
const Template = (args) => <LoadingScreen {...args} />; //<><div>text</div><div className="max-w-500 mt-40 z-1000 h-full relative"></div></>;
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>
);