feat: Loading Common

This commit is contained in:
sonnguyenkieio
2021-09-13 15:45:50 +07:00
parent d6686b8e2d
commit 42207a0756
4 changed files with 7 additions and 12 deletions

View File

@@ -2,12 +2,14 @@
.loadingCommon:empty {
@apply bg-white;
height: 7rem;
width: 7rem;
border-radius: 50%;
border: .7rem solid var(--primary-lightest);
border-top: .7rem solid var(--primary);
animation: spin 2s linear infinite;
margin: auto;
background: url('./assets/carrot.png') top 50% left 50% no-repeat;
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
@@ -19,8 +21,7 @@
}
&.default {
height: 7rem;
width: 7rem;
}
&.large {

View File

@@ -1,23 +1,17 @@
import classNames from "classnames";
import React from "react";
import s from './LoadingCommon.module.scss'
interface LoadingCommonProps {
size?: "small" | "default" | "large",
children? : React.ReactNode;
}
const LoadingCommon = ({ size="default", children }: LoadingCommonProps) => {
const LoadingCommon = ({ children }: LoadingCommonProps) => {
return (
<>
{
<div className={classNames(s.loadingCommon, {
[s[size]]: size
})}>
<div className={s.loadingCommon}>
{children}
</div>
}
</>
)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB