Skip to content

Commit

Permalink
fix(demo): remove button when logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
emilielr committed Jul 8, 2024
1 parent 3ee4a3e commit 32dcf23
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions next-tavla/app/demo/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function Demo() {
lagret.
</LeadParagraph>
</div>
<CreateUserButton loggedIn={loggedIn} />
{!loggedIn && <CreateUserButton />}

<div className="flex flex-col gap-10">
<Heading1 margin="none">Lag en demo-tavle</Heading1>
Expand Down Expand Up @@ -56,30 +56,23 @@ async function Demo() {
</ListItem>
</UnorderedList>
</div>
<CreateUserButton loggedIn={loggedIn} />
{!loggedIn && <CreateUserButton />}
</main>
)
}

export default Demo

const CreateUserButton = ({ loggedIn }: { loggedIn: boolean }) => {
const CreateUserButton = () => {
return (
<div>
<Heading3 margin="bottom">Opprett bruker</Heading3>
<Paragraph margin="none">
Det er helt gratis å bruke Tavla!
</Paragraph>
{!loggedIn && (
<Button
variant="success"
as={Link}
href="?login"
className="mt-2"
>
Opprett bruker / Logg inn
</Button>
)}
<Button variant="success" as={Link} href="?login" className="mt-2">
Opprett bruker / Logg inn
</Button>
</div>
)
}

0 comments on commit 32dcf23

Please sign in to comment.