-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): add loaders on layers page (#234)
* feat(ui): add card loader * feat(ui): add table loader
- Loading branch information
1 parent
101a629
commit 17f8c95
Showing
4 changed files
with
224 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from "react"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
export interface CardLoaderProps { | ||
className?: string; | ||
variant: "light" | "dark"; | ||
} | ||
|
||
const CardLoader: React.FC<CardLoaderProps> = ({ className, variant }) => { | ||
const style = { | ||
light: `bg-[linear-gradient(270deg,_#D8EBFF_0%,_#ECF5FF_100%)] | ||
shadow-light`, | ||
dark: `bg-[linear-gradient(270deg,_#252525_0%,_rgba(68,_67,_67,_0.24)_100%)] | ||
shadow-dark`, | ||
}; | ||
|
||
return ( | ||
<div | ||
className={twMerge( | ||
`h-[275px] | ||
rounded-2xl | ||
animate-pulse | ||
${style[variant]}`, | ||
className | ||
)} | ||
></div> | ||
); | ||
}; | ||
|
||
export default CardLoader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from "react"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
export interface TableLoaderProps { | ||
className?: string; | ||
variant: "light" | "dark"; | ||
} | ||
|
||
const TableLoader: React.FC<TableLoaderProps> = ({ className, variant }) => { | ||
const style = { | ||
light: `bg-[linear-gradient(270deg,_#D8EBFF_0%,_#ECF5FF_100%)]`, | ||
dark: `bg-[linear-gradient(270deg,_#252525_0%,_rgba(68,_67,_67,_0.24)_100%)]`, | ||
}; | ||
|
||
return ( | ||
<div | ||
className={twMerge( | ||
`h-4 | ||
rounded-full | ||
animate-pulse | ||
${style[variant]}`, | ||
className | ||
)} | ||
></div> | ||
); | ||
}; | ||
|
||
export default TableLoader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters