Skip to content

Commit eeba63c

Browse files
rolznzreneaaron
andauthored
fix: add connected state for connect app card (#1149)
* fix: add connected state for connect app card * fix: badge layout --------- Co-authored-by: René Aaron <[email protected]>
1 parent cf01b48 commit eeba63c

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

frontend/src/screens/apps/AppCreated.tsx

+22-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CopyIcon, EyeIcon } from "lucide-react";
1+
import { Check, CopyIcon, EyeIcon } from "lucide-react";
22
import { useEffect, useState } from "react";
33
import { Link, Navigate, useLocation, useNavigate } from "react-router-dom";
44

@@ -8,6 +8,7 @@ import { IsolatedAppTopupDialog } from "src/components/IsolatedAppTopupDialog";
88
import Loading from "src/components/Loading";
99
import QRCode from "src/components/QRCode";
1010
import { SuggestedApp, suggestedApps } from "src/components/SuggestedAppData";
11+
import { Badge } from "src/components/ui/badge";
1112
import { Button } from "src/components/ui/button";
1213
import {
1314
Card,
@@ -170,17 +171,26 @@ export function ConnectAppCard({
170171
<CardTitle className="text-center">Connection Secret</CardTitle>
171172
</CardHeader>
172173
<CardContent className="flex flex-col items-center gap-5">
173-
<div className="flex flex-row items-center gap-2 text-sm">
174-
<Loading className="w-4 h-4" />
175-
<p>Waiting for app to connect</p>
176-
</div>
177-
{timeout && (
178-
<div className="text-sm flex flex-col gap-2 items-center text-center">
179-
Connecting is taking longer than usual.
180-
<Link to={`/apps/${app?.appPubkey}`}>
181-
<Button variant="secondary">Continue anyway</Button>
182-
</Link>
183-
</div>
174+
{!app.lastEventAt ? (
175+
<>
176+
<div className="flex flex-row items-center gap-2 text-sm">
177+
<Loading className="w-4 h-4" />
178+
<p>Waiting for app to connect</p>
179+
</div>
180+
{timeout && (
181+
<div className="text-sm flex flex-col gap-2 items-center text-center">
182+
Connecting is taking longer than usual.
183+
<Link to={`/apps/${app?.appPubkey}`}>
184+
<Button variant="secondary">Continue anyway</Button>
185+
</Link>
186+
</div>
187+
)}
188+
</>
189+
) : (
190+
<Badge variant="positive">
191+
<Check className="w-4 h-4 mr-2" />
192+
<p>App connected</p>
193+
</Badge>
184194
)}
185195
<a href={pairingUri} target="_blank" className="relative">
186196
<div className={!isQRCodeVisible ? "blur-md" : ""}>

0 commit comments

Comments
 (0)