mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 12:24:18 +00:00
✨ feat: Loading Common
This commit is contained in:
@@ -2,12 +2,14 @@
|
|||||||
|
|
||||||
.loadingCommon:empty {
|
.loadingCommon:empty {
|
||||||
@apply bg-white;
|
@apply bg-white;
|
||||||
|
height: 7rem;
|
||||||
|
width: 7rem;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: .7rem solid var(--primary-lightest);
|
|
||||||
border-top: .7rem solid var(--primary);
|
|
||||||
animation: spin 2s linear infinite;
|
animation: spin 2s linear infinite;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
||||||
|
background: url('./assets/carrot.png') top 50% left 50% no-repeat;
|
||||||
|
|
||||||
@keyframes spin {
|
@keyframes spin {
|
||||||
0% { transform: rotate(0deg); }
|
0% { transform: rotate(0deg); }
|
||||||
100% { transform: rotate(360deg); }
|
100% { transform: rotate(360deg); }
|
||||||
@@ -19,8 +21,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.default {
|
&.default {
|
||||||
height: 7rem;
|
|
||||||
width: 7rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.large {
|
&.large {
|
||||||
|
@@ -1,23 +1,17 @@
|
|||||||
import classNames from "classnames";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import s from './LoadingCommon.module.scss'
|
import s from './LoadingCommon.module.scss'
|
||||||
|
|
||||||
interface LoadingCommonProps {
|
interface LoadingCommonProps {
|
||||||
size?: "small" | "default" | "large",
|
|
||||||
children? : React.ReactNode;
|
children? : React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LoadingCommon = ({ size="default", children }: LoadingCommonProps) => {
|
const LoadingCommon = ({ children }: LoadingCommonProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{
|
<div className={s.loadingCommon}>
|
||||||
<div className={classNames(s.loadingCommon, {
|
|
||||||
[s[size]]: size
|
|
||||||
})}>
|
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
BIN
src/components/common/LoadingCommon/assets/broccoli.png
Normal file
BIN
src/components/common/LoadingCommon/assets/broccoli.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
BIN
src/components/common/LoadingCommon/assets/carrot.png
Normal file
BIN
src/components/common/LoadingCommon/assets/carrot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
Reference in New Issue
Block a user