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 {
LumeDashboard,
LumeIdentity,
LumeIdentityTrigger,
LumeDashboardTrigger,
LumeDashboard,
useLume,
LumeProvider,
} from "@lumeweb/sdk";
export default function () {
@ -13,24 +11,17 @@ export default function () {
<>
<LumeIdentity>
<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
className="ml-2 w-full rounded-full bg-[hsl(113,49%,55%)] text-black"
disabled={!ready}
>
Login
</button>
)}
}
</LumeIdentityTrigger>
</LumeIdentity>
{isLoggedIn && ready && <LumeDashboard />}
</>
);
}