Skip to content

Commit

Permalink
feat: add loading spinner (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamashita-kenngo authored Jun 7, 2024
1 parent d39de95 commit 77eca43
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSignal, createEffect } from "solid-js";
import { createSignal, createEffect, Show } from "solid-js";
import { getCurrentUser, signOutUser } from "../service/auth";
import { getDocumentsWithQuery, firestore } from "../service/firestore";
import AccountContent from "../contents/account/accountContent";
Expand Down Expand Up @@ -41,7 +41,14 @@ const Dashboard = () => {
</div>
</header>
<div class="max-w-7xl mx-auto my-2 py-6 sm:px-6 lg:px-8">
<Show when={accountInfo() === null}>
<div class="flex justify-center items-center">
<div class="animate-spin rounded-full h-32 w-32 border-b-2 border-gray-900" />
</div>
</Show>
<Show when={accountInfo() !== null}>
{AccountContent(accountInfo() !== null, accountInfo())}
</Show>
</div>
</div>
);
Expand Down

0 comments on commit 77eca43

Please sign in to comment.