feat: add buy subscription link to manage page

This commit is contained in:
Kieran 2023-05-12 18:49:21 +01:00
parent 06da58ac52
commit 7a717a5c56
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 12 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { FormattedMessage } from "react-intl";
import { Link } from "react-router-dom";
import { Link, useNavigate } from "react-router-dom";
import PageSpinner from "Element/PageSpinner";
import useEventPublisher from "Feed/EventPublisher";
@ -11,6 +11,7 @@ import SubscriptionCard from "./SubscriptionCard";
export default function ManageSubscriptionPage() {
const publisher = useEventPublisher();
const api = new SnortApi(undefined, publisher);
const navigate = useNavigate();
const [subs, setSubs] = useState<Array<Subscription>>();
const [error, setError] = useState<SubscriptionError>();
@ -39,6 +40,11 @@ export default function ManageSubscriptionPage() {
{subs.map(a => (
<SubscriptionCard sub={a} key={a.id} />
))}
{subs.length !== 0 && (
<button onClick={() => navigate("/subscribe")}>
<FormattedMessage defaultMessage="Buy Subscription" />
</button>
)}
{subs.length === 0 && (
<p>
<FormattedMessage

View File

@ -612,6 +612,9 @@
"SOqbe9": {
"defaultMessage": "Update Lightning Address"
},
"SP0+yi": {
"defaultMessage": "Buy Subscription"
},
"SX58hM": {
"defaultMessage": "Copy",
"description": "Button: Copy Cashu token"

View File

@ -200,6 +200,7 @@
"Rs4kCE": "Bookmark",
"RwFaYs": "Sort",
"SOqbe9": "Update Lightning Address",
"SP0+yi": "Buy Subscription",
"SX58hM": "Copy",
"SYQtZ7": "LN Address Proxy",
"Sjo1P4": "Custom",
@ -402,4 +403,4 @@
"zjJZBd": "You're ready!",
"zonsdq": "Failed to load LNURL service",
"zvCDao": "Automatically show latest notes"
}
}