feat: better loading states

This commit is contained in:
dan13ram
2022-01-08 11:54:47 +05:30
committed by Scott Stevenson
parent b108ddaa6a
commit 83bc96cc72
2 changed files with 11 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ import {
Flex,
Heading,
HStack,
LoadingState,
Modal,
ModalCloseButton,
ModalContent,
@@ -92,6 +93,7 @@ export const PlayerGallery: React.FC<Props> = ({
canEdit={canEdit}
boxType={BoxType.PLAYER_NFT_GALLERY}
>
{loading && <LoadingState />}
{!loading &&
favorites?.map((nft) => <GalleryItem nft={nft} key={nft.tokenId} />)}
{!loading && data?.length > 3 && (

View File

@@ -1,4 +1,11 @@
import { Box, Flex, LinkBox, LinkOverlay, Text } from '@metafam/ds';
import {
Box,
Flex,
LinkBox,
LinkOverlay,
LoadingState,
Text,
} from '@metafam/ds';
import { ProfileSection } from 'components/Profile/ProfileSection';
import React, { useEffect, useRef, useState } from 'react';
import { BoxType } from 'utils/boxTypes';
@@ -27,6 +34,7 @@ export const EmbeddedUrl: React.FC<EmbeddedUrlProps> = ({
height="100%"
width="100%"
backgroundColor="whiteAlpha.200"
customLoader={<LoadingState />}
showLoader
canEdit={canEdit}
/>
@@ -40,7 +48,6 @@ interface LinkPreviewProps {
height?: string | number;
descriptionLength?: number;
borderRadius?: string | number;
imageHeight?: string | number;
textAlign?: 'left' | 'right' | 'center';
margin?: string | number;
fallback?: JSX.Element[] | JSX.Element | null;
@@ -67,7 +74,6 @@ const LinkPreview: React.FC<LinkPreviewProps> = ({
width,
height,
borderRadius = 'lg',
imageHeight = '13rem',
textAlign,
margin,
fallback = null,