From 3511e6134b7acd3f6409044bd4e94f099743658d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CSalar?= <“salar.sali97@gmail.com”> Date: Tue, 30 Aug 2022 14:24:35 +0300 Subject: [PATCH] Skeleton Component --- src/components/SkeletonCard.tsx | 94 +++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 src/components/SkeletonCard.tsx diff --git a/src/components/SkeletonCard.tsx b/src/components/SkeletonCard.tsx new file mode 100644 index 0000000..98bc621 --- /dev/null +++ b/src/components/SkeletonCard.tsx @@ -0,0 +1,94 @@ +import Skeleton from "react-loading-skeleton"; +import AspectRatio from "./AspectRatio"; +import classNames from "classnames"; + +/* -------------------------------------------------------------------------- */ +/* Props */ +/* -------------------------------------------------------------------------- */ +type Props = { + /** + * Card component accept children + */ + children?: React.ReactNode; + /** + * Styling the card component + */ + className?: string | undefined; +}; + +const SkeletonCard = ({ className, children }: Props) => { + return ( +
+ {children} +
+ ); +}; + +// Media +SkeletonCard.Media = function SkeletonCardCardMedia() { + return ( + + + + + + ); +}; + +// Content +SkeletonCard.Content = function SkeletonCardCardContent({ + children, + className, +}: Props) { + return ( +
+ {children} +
+ ); +}; + +// Header +SkeletonCard.Header = function SkeletonCardCardHeader({ + children, + className, +}: Props) { + return ( +
+ {children} +
+ ); +}; + +// Avatar +SkeletonCard.Avatar = function SkeletonCardCardAvatar() { + return ; +}; + +// Title +SkeletonCard.Title = function SkeletonCardCardTitle() { + return ; +}; + +// Body +SkeletonCard.Body = function SkeletonCardCardBody({ + children, + className, +}: Props) { + return ; +}; + +// Action +SkeletonCard.Action = function SkeletonCardCardAction({ className }: Props) { + return ( +
+ +
+ ); +}; + +export default SkeletonCard;