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:
parent
d6686b8e2d
commit
42207a0756
@ -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 {
|
||||
|
@ -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>
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
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 |
Loading…
x
Reference in New Issue
Block a user