mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-20 06:24:06 +01:00
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import Lottie from "react-lottie";
|
|
import * as loadingData from "./loading.json";
|
|
import * as successData from "./success.json";
|
|
|
|
const loadingOption = {
|
|
loop: true,
|
|
autoplay: true,
|
|
animationData: loadingData,
|
|
rendererSettings: {
|
|
preserveAspectRatio: "xMidYMid slice",
|
|
},
|
|
};
|
|
// const successOption = {
|
|
// loop: false,
|
|
// autoplay: true,
|
|
// animationData: successData,
|
|
// rendererSettings: {
|
|
// preserveAspectRatio: "xMidYMid slice",
|
|
// },
|
|
// };
|
|
|
|
interface LoaderProps {
|
|
isSuccess: boolean;
|
|
}
|
|
|
|
export function Loader(props: LoaderProps) {
|
|
return (
|
|
<>
|
|
{!props.isSuccess && (
|
|
<div className="fixed inset-0 flex items-center justify-center bg-white bg-opacity-10 backdrop-blur-sm z-50">
|
|
<Lottie options={loadingOption} height={200} width={200} />
|
|
</div>
|
|
)}
|
|
{/* {!props.isSuccess ? (
|
|
<Lottie options={loadingOption} height={200} width={200} />
|
|
) : (
|
|
<Lottie options={successOption} height={200} width={200} />
|
|
)} */}
|
|
</>
|
|
);
|
|
}
|