diff --git a/src/components/atoms/File.module.css b/src/components/atoms/File.module.css index 79b926745..2036412a0 100644 --- a/src/components/atoms/File.module.css +++ b/src/components/atoms/File.module.css @@ -25,3 +25,7 @@ width: 4.5rem; padding: calc(var(--spacer) / 2) calc(var(--spacer) / 4); } + +.loaderWrap { + margin-right: calc(var(--spacer)/6); +} \ No newline at end of file diff --git a/src/components/atoms/File.tsx b/src/components/atoms/File.tsx index 6494c997e..6efa9c984 100644 --- a/src/components/atoms/File.tsx +++ b/src/components/atoms/File.tsx @@ -4,17 +4,28 @@ import filesize from 'filesize' import classNames from 'classnames/bind' import cleanupContentType from '../../utils/cleanupContentType' import styles from './File.module.css' +import Loader from '../atoms/Loader' const cx = classNames.bind(styles) +function LoaderArea() { + return ( +
+ +
+ ) +} + export default function File({ file, className, - small + small, + isLoading }: { file: FileMetadata className?: string small?: boolean + isLoading?: boolean }): ReactElement { if (!file) return null @@ -26,17 +37,23 @@ export default function File({ return ( ) diff --git a/src/components/organisms/AssetActions/Compute/index.tsx b/src/components/organisms/AssetActions/Compute/index.tsx index 4de6475e5..9f5fc8ee2 100644 --- a/src/components/organisms/AssetActions/Compute/index.tsx +++ b/src/components/organisms/AssetActions/Compute/index.tsx @@ -48,11 +48,13 @@ const SuccessAction = () => ( export default function Compute({ isBalanceSufficient, dtBalance, - file + file, + fileIsLoading }: { isBalanceSufficient: boolean dtBalance: string file: FileMetadata + fileIsLoading?: boolean }): ReactElement { const { appConfig } = useSiteMetadata() const { accountId } = useWeb3() @@ -370,7 +372,7 @@ export default function Compute({ return ( <>
- +
diff --git a/src/components/organisms/AssetActions/Consume.tsx b/src/components/organisms/AssetActions/Consume.tsx index fd5d3e78a..3d4649597 100644 --- a/src/components/organisms/AssetActions/Consume.tsx +++ b/src/components/organisms/AssetActions/Consume.tsx @@ -35,12 +35,14 @@ export default function Consume({ ddo, file, isBalanceSufficient, - dtBalance + dtBalance, + fileIsLoading }: { ddo: DDO file: FileMetadata isBalanceSufficient: boolean dtBalance: string + fileIsLoading?: boolean }): ReactElement { const { accountId } = useWeb3() const { ocean } = useOcean() @@ -159,7 +161,7 @@ export default function Consume({