refactor: simplify button ux and only show dashboard when logged in and ready
This commit is contained in:
parent
246d2d0131
commit
08db7623db
|
@ -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 />}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue