refactor: simplify button ux and only show dashboard when logged in and ready

This commit is contained in:
Derrick Hammer 2023-10-12 13:30:45 -04:00
parent 246d2d0131
commit 08db7623db
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 13 deletions

View File

@ -1,10 +1,8 @@
import { import {
LumeDashboard,
LumeIdentity, LumeIdentity,
LumeIdentityTrigger, LumeIdentityTrigger,
LumeDashboardTrigger,
LumeDashboard,
useLume, useLume,
LumeProvider,
} from "@lumeweb/sdk"; } from "@lumeweb/sdk";
export default function () { export default function () {
@ -13,24 +11,17 @@ export default function () {
<> <>
<LumeIdentity> <LumeIdentity>
<LumeIdentityTrigger asChild disabled={!ready}> <LumeIdentityTrigger asChild disabled={!ready}>
{isLoggedIn ? ( {
<LumeDashboard>
<LumeDashboardTrigger asChild>
<button className="ml-2 w-full rounded-full bg-[hsl(113,49%,55%)] text-black">
Check Status
</button>
</LumeDashboardTrigger>
</LumeDashboard>
) : (
<button <button
className="ml-2 w-full rounded-full bg-[hsl(113,49%,55%)] text-black" className="ml-2 w-full rounded-full bg-[hsl(113,49%,55%)] text-black"
disabled={!ready} disabled={!ready}
> >
Login Login
</button> </button>
)} }
</LumeIdentityTrigger> </LumeIdentityTrigger>
</LumeIdentity> </LumeIdentity>
{isLoggedIn && ready && <LumeDashboard />}
</> </>
); );
} }