Skip to content

Commit

Permalink
feat(card): implement a wip loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
flowergardn committed Dec 9, 2023
1 parent d76977f commit 8be80e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/c/[id]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { GetStaticProps, NextPage } from "next";

import Navbar from "~/components/Navbar";
import { generateSSGHelper } from "~/server/api/helpers/ssgHelper";
import { api } from "~/utils/api";
Expand Down Expand Up @@ -36,15 +37,15 @@ const CardPage: NextPage<{ id: string }> = ({ id }) => {
cardId: id,
});

if (wishesLoading) return <></>;
if (wishError || !data) return <></>;
if (wishError) return <></>;
const canShow = !wishesLoading && !wishError && data;

return (
<>
<article className="prose">
<h2>Wishes</h2>
</article>
<Signatures signatures={data} />
{canShow ? <Signatures signatures={data} /> : <p>Loading...</p>}
<Link href={`/c/${id}/sign`}>
<button className="btn btn-primary">Create</button>
</Link>
Expand Down

0 comments on commit 8be80e8

Please sign in to comment.