Skip to content

Commit

Permalink
Add description to download modal
Browse files Browse the repository at this point in the history
  • Loading branch information
mhzrerfani committed Oct 15, 2024
1 parent 7aee108 commit c568c27
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/web/src/app/games/[id]/components/DownloadModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@ import { selectIsGameLoading$, selectProgressPercentage$ } from "../state/select
export default function DownloadModal() {
const { isLoading: isWalletLoading } = useWallet();
const percentage = useSelector(selectProgressPercentage$());

const isLoading = useSelector(selectIsGameLoading$()) || isWalletLoading;

if (isLoading)
return (
<Modal closeButton={false} className="w-96 h-52 animate-grow-in">
<div className="flex flex-col items-center gap-1 text-white text-center">
<div className="flex text-nowrap text-sm flex-col items-center gap-1 text-white text-center">
{percentage ? (
<>
Downloading assets
<progress
className="nes-progress is-success duration-300 transition-all"
className="nes-progress is-success duration-300 transition-all h-6"
value={percentage}
max={100}
/>
{`%${percentage}`}
</>
) : (
"Starting download assets..."
"Starting downloading assets..."
)}
</div>
</Modal>
Expand Down

0 comments on commit c568c27

Please sign in to comment.