From 31303893a343cfebf06b70eafc470a1823b8c331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Tue, 9 Jul 2024 10:37:32 +0200 Subject: [PATCH 1/6] feat: app card improvements --- .../connections/AlbyConnectionCard.tsx | 4 +- .../connections/AppCardConnectionInfo.tsx | 58 +++++++++++-------- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/frontend/src/components/connections/AlbyConnectionCard.tsx b/frontend/src/components/connections/AlbyConnectionCard.tsx index 2c3639a8..676127f3 100644 --- a/frontend/src/components/connections/AlbyConnectionCard.tsx +++ b/frontend/src/components/connections/AlbyConnectionCard.tsx @@ -35,7 +35,7 @@ function AlbyConnectionCard({ connection }: { connection?: App }) { - Alby Account + Linked Alby Account {connection && } @@ -47,7 +47,7 @@ function AlbyConnectionCard({ connection }: { connection?: App }) {
-
+
diff --git a/frontend/src/components/connections/AppCardConnectionInfo.tsx b/frontend/src/components/connections/AppCardConnectionInfo.tsx index 775f8d56..ba2d50df 100644 --- a/frontend/src/components/connections/AppCardConnectionInfo.tsx +++ b/frontend/src/components/connections/AppCardConnectionInfo.tsx @@ -1,5 +1,5 @@ import dayjs from "dayjs"; -import { PlusCircle } from "lucide-react"; +import { CircleCheck, PlusCircle } from "lucide-react"; import { Link } from "react-router-dom"; import { Button } from "src/components/ui/button"; import { Progress } from "src/components/ui/progress"; @@ -36,25 +36,21 @@ export function AppCardConnectionInfo({ />
- {connection.maxAmount && ( - <>{formatAmount(connection.maxAmount * 1000)} sats + {connection.lastEventAt && ( + <>Last used: {dayjs(connection.lastEventAt).fromNow()} )}
- {connection.maxAmount > 0 && - connection.budgetRenewal !== "never" && ( - <>Renews {connection.budgetRenewal} - )} + {connection.maxAmount && ( + <> + {formatAmount(connection.maxAmount * 1000)} sats + {connection.budgetRenewal !== "never" && ( + <> / {connection.budgetRenewal.slice(0, -2)} + )} + + )}
- {connection.lastEventAt && ( -
-
-
Last used: 
-
{dayjs(connection.lastEventAt).fromNow()}
-
-
- )} ) : connection.scopes.indexOf("pay_invoice") > -1 ? ( <> @@ -79,18 +75,30 @@ export function AppCardConnectionInfo({ ) : ( <> -
-
-

- Read only -

+
+
+ + Share wallet information
+ {connection.scopes.indexOf("make_invoice") > -1 && ( +
+ + Create Invoices +
+ )}
-
- +
+
+ {connection.lastEventAt && ( + <>Last used: {dayjs(connection.lastEventAt).fromNow()} + )} +
+ + +
)} From 4c401783c94b123b8b4a6e40b1cd8fea2bbf7b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Tue, 9 Jul 2024 13:30:20 +0200 Subject: [PATCH 2/6] fix: copy sidebar --- frontend/src/components/SidebarHint.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/SidebarHint.tsx b/frontend/src/components/SidebarHint.tsx index 8d4d9d1e..0ec49db5 100644 --- a/frontend/src/components/SidebarHint.tsx +++ b/frontend/src/components/SidebarHint.tsx @@ -88,7 +88,7 @@ function SidebarHint() { From 1da2858c00a477e7b562aee91a373372adb43713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Tue, 9 Jul 2024 13:31:47 +0200 Subject: [PATCH 3/6] feat: frontend implementation (wip) --- .../images/illustrations/login-with-alby.png | Bin 0 -> 23726 bytes .../connections/AlbyConnectionCard.tsx | 101 +++++++++++++++++- 2 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 frontend/public/images/illustrations/login-with-alby.png diff --git a/frontend/public/images/illustrations/login-with-alby.png b/frontend/public/images/illustrations/login-with-alby.png new file mode 100644 index 0000000000000000000000000000000000000000..5da33e30ebb60fe20a2a884cb4c1d2554ba3a9b7 GIT binary patch literal 23726 zcmeEtV{<0X({*fPV`F36_Qtkt+qP}n$;R2(wrxAPg6sbMpU?5Un3TekY5!48=%t4KjK8J`F*iARfzSg z32_~5)G3gh_z-qI$^;gfvc<#!1aEeIHU%8XXMXhyOaK!wZ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_Dz?z3I0pDUTq^e0dvR)Av1X~ z&fdF0hqFAu#`T0+C*@9~+$NNR>RJ8-dZn}?)T&b(Lt}jZKe&COe7V{xgKp6PewHr$ i@&8NR&c2Hy%R7O^);;$5dK)iJps#JL_3fc!^#1_xwY>WP literal 0 HcmV?d00001 diff --git a/frontend/src/components/connections/AlbyConnectionCard.tsx b/frontend/src/components/connections/AlbyConnectionCard.tsx index 676127f3..c8882402 100644 --- a/frontend/src/components/connections/AlbyConnectionCard.tsx +++ b/frontend/src/components/connections/AlbyConnectionCard.tsx @@ -6,6 +6,8 @@ import { Link2Icon, ZapIcon, } from "lucide-react"; +import albyButton from "public/images/illustrations/login-with-alby.png"; +import { useState } from "react"; import { Link } from "react-router-dom"; import ExternalLink from "src/components/ExternalLink"; import Loading from "src/components/Loading"; @@ -20,16 +22,33 @@ import { CardHeader, CardTitle, } from "src/components/ui/card"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTrigger, +} from "src/components/ui/dialog"; +import { Label } from "src/components/ui/label"; import { LoadingButton } from "src/components/ui/loading-button"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "src/components/ui/select"; import { Separator } from "src/components/ui/separator"; import { useAlbyMe } from "src/hooks/useAlbyMe"; import { LinkStatus, useLinkAccount } from "src/hooks/useLinkAccount"; -import { App } from "src/types"; +import { App, budgetOptions, validBudgetRenewals } from "src/types"; function AlbyConnectionCard({ connection }: { connection?: App }) { const { data: albyMe } = useAlbyMe(); const { loading, linkStatus, loadingLinkStatus, linkAccount } = useLinkAccount(); + const [maxAmount, setMaxAmount] = useState(); return ( @@ -62,10 +81,82 @@ function AlbyConnectionCard({ connection }: { connection?: App }) {
{loadingLinkStatus && } {!connection || linkStatus === LinkStatus.SharedNode ? ( - - {!loading && } - Link your Alby Account - + + + + {!loading && } + Link your Alby Account + + + + Link to Alby Account + +

+ After you link your account, every app you access + through your Alby Account will handle payments via the + Hub. +

+ +

+ You can add a budget that will restrict how much can be + spent from the Hub with your Alby Account. +

+
+ + +
+
+ {Object.keys(budgetOptions).map((budget) => { + return ( + // replace with something else and then remove dark prefixes +
+ setMaxAmount(budgetOptions[budget]) + } + className={`col-span-2 md:col-span-1 cursor-pointer rounded border-2 ${ + maxAmount == budgetOptions[budget] + ? "border-primary" + : "border-muted" + } text-center py-4`} + > + {budget} +
+ {budgetOptions[budget] ? "sats" : "#reckless"} +
+ ); + })} +
+
+ + +
Link to Alby Account
+
+
+
+
) : linkStatus === LinkStatus.ThisNode ? (
-
- {Object.keys(budgetOptions).map((budget) => { - return ( - // replace with something else and then remove dark prefixes -
- handleMaxAmountChange(budgetOptions[budget]) - } - className={`col-span-2 md:col-span-1 cursor-pointer rounded border-2 ${ - permissions.maxAmount == budgetOptions[budget] - ? "border-primary" - : "border-muted" - } text-center py-4 dark:text-white`} - > - {budget} -
- {budgetOptions[budget] ? "sats" : "#reckless"} -
- ); - })} -
+ ) : isNewConnection ? ( <> diff --git a/frontend/src/components/SidebarHint.tsx b/frontend/src/components/SidebarHint.tsx index 0ec49db5..67bf68f7 100644 --- a/frontend/src/components/SidebarHint.tsx +++ b/frontend/src/components/SidebarHint.tsx @@ -87,9 +87,9 @@ function SidebarHint() { return ( ); diff --git a/frontend/src/components/connections/AlbyConnectionCard.tsx b/frontend/src/components/connections/AlbyConnectionCard.tsx index c8882402..ab3e39a8 100644 --- a/frontend/src/components/connections/AlbyConnectionCard.tsx +++ b/frontend/src/components/connections/AlbyConnectionCard.tsx @@ -6,9 +6,11 @@ import { Link2Icon, ZapIcon, } from "lucide-react"; -import albyButton from "public/images/illustrations/login-with-alby.png"; import { useState } from "react"; import { Link } from "react-router-dom"; + +import BudgetAmountSelect from "src/components/BudgetAmountSelect"; +import BudgetRenewalSelect from "src/components/BudgetRenewalSelect"; import ExternalLink from "src/components/ExternalLink"; import Loading from "src/components/Loading"; import UserAvatar from "src/components/UserAvatar"; @@ -32,23 +34,20 @@ import { } from "src/components/ui/dialog"; import { Label } from "src/components/ui/label"; import { LoadingButton } from "src/components/ui/loading-button"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "src/components/ui/select"; import { Separator } from "src/components/ui/separator"; import { useAlbyMe } from "src/hooks/useAlbyMe"; import { LinkStatus, useLinkAccount } from "src/hooks/useLinkAccount"; -import { App, budgetOptions, validBudgetRenewals } from "src/types"; +import { App, BudgetRenewalType } from "src/types"; +import albyButton from "/images/illustrations/login-with-alby.png"; function AlbyConnectionCard({ connection }: { connection?: App }) { const { data: albyMe } = useAlbyMe(); const { loading, linkStatus, loadingLinkStatus, linkAccount } = useLinkAccount(); - const [maxAmount, setMaxAmount] = useState(); + + const [maxAmount, setMaxAmount] = useState(1_000_000); + const [budgetRenewal, setBudgetRenewal] = + useState("monthly"); return ( @@ -91,68 +90,29 @@ function AlbyConnectionCard({ connection }: { connection?: App }) { Link to Alby Account -

- After you link your account, every app you access - through your Alby Account will handle payments via the - Hub. -

+ After you link your account, every app you access through + your Alby Account will handle payments via the Hub. -

- You can add a budget that will restrict how much can be - spent from the Hub with your Alby Account. -

-
- - -
-
- {Object.keys(budgetOptions).map((budget) => { - return ( - // replace with something else and then remove dark prefixes -
- setMaxAmount(budgetOptions[budget]) - } - className={`col-span-2 md:col-span-1 cursor-pointer rounded border-2 ${ - maxAmount == budgetOptions[budget] - ? "border-primary" - : "border-muted" - } text-center py-4`} - > - {budget} -
- {budgetOptions[budget] ? "sats" : "#reckless"} -
- ); - })} -
+ You can add a budget that will restrict how much can be + spent from the Hub with your Alby Account.
+
+ + +
+ - -
Link to Alby Account
+ linkAccount(maxAmount, budgetRenewal)} + loading={loading} + > + Link to Alby Account
diff --git a/frontend/src/components/connections/AppCard.tsx b/frontend/src/components/connections/AppCard.tsx index 3d817c23..edb3864c 100644 --- a/frontend/src/components/connections/AppCard.tsx +++ b/frontend/src/components/connections/AppCard.tsx @@ -1,6 +1,6 @@ import dayjs from "dayjs"; import relativeTime from "dayjs/plugin/relativeTime"; -import { Link } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; import AppAvatar from "src/components/AppAvatar"; import { AppCardConnectionInfo } from "src/components/connections/AppCardConnectionInfo"; import { AppCardNotice } from "src/components/connections/AppCardNotice"; @@ -20,26 +20,27 @@ type Props = { }; export default function AppCard({ app }: Props) { + const navigate = useNavigate(); + return ( - <> - - - - - -
- -
- {app.name} -
-
-
-
- - - -
- - + navigate(`/apps/${app.nostrPubkey}`)} + > + + + +
+ +
+ {app.name} +
+
+
+
+ + + +
); } diff --git a/frontend/src/components/connections/AppCardConnectionInfo.tsx b/frontend/src/components/connections/AppCardConnectionInfo.tsx index ba2d50df..8e3d6ee7 100644 --- a/frontend/src/components/connections/AppCardConnectionInfo.tsx +++ b/frontend/src/components/connections/AppCardConnectionInfo.tsx @@ -93,7 +93,10 @@ export function AppCardConnectionInfo({ <>Last used: {dayjs(connection.lastEventAt).fromNow()} )}
- + e.stopPropagation()} + >