tweak subscriptions page
This commit is contained in:
parent
fe788853c9
commit
0f7964bfa6
@ -1,19 +1,17 @@
|
||||
import "./Zap.css";
|
||||
import { useMemo } from "react";
|
||||
import { FormattedMessage, useIntl } from "react-intl";
|
||||
import { useSelector } from "react-redux";
|
||||
import { HexKey, TaggedRawEvent } from "@snort/nostr";
|
||||
|
||||
import { decodeInvoice, InvoiceDetails, sha256, unwrap } from "Util";
|
||||
import { formatShort } from "Number";
|
||||
import Text from "Element/Text";
|
||||
import ProfileImage from "Element/ProfileImage";
|
||||
import { RootState } from "State/Store";
|
||||
import { findTag } from "Util";
|
||||
import { UserCache } from "Cache/UserCache";
|
||||
import useLogin from "Hooks/useLogin";
|
||||
|
||||
import messages from "./messages";
|
||||
import useLogin from "Hooks/useLogin";
|
||||
|
||||
function getInvoice(zap: TaggedRawEvent): InvoiceDetails | undefined {
|
||||
const bolt11 = findTag(zap, "bolt11");
|
||||
|
@ -20,7 +20,7 @@ import { SubscriptionEvent } from "Subscription";
|
||||
*/
|
||||
export default function useLoginFeed() {
|
||||
const login = useLogin();
|
||||
const { publicKey: pubKey, privateKey: privKey, readNotifications, muted: stateMuted } = login;
|
||||
const { publicKey: pubKey, privateKey: privKey, readNotifications } = login;
|
||||
const { isMuted } = useModeration();
|
||||
const publisher = useEventPublisher();
|
||||
|
||||
|
@ -137,7 +137,7 @@ export function setBookmarked(state: LoginSession, bookmarked: Array<string>, ts
|
||||
}
|
||||
|
||||
export function addSubscription(state: LoginSession, ...subs: SubscriptionEvent[]) {
|
||||
state.subscriptions = dedupeById([...state.subscriptions, ...subs]);
|
||||
state.subscriptions = dedupeById([...(state.subscriptions || []), ...subs]);
|
||||
state.currentSubscription = getCurrentSubscription(state.subscriptions);
|
||||
LoginStore.updateSession(state);
|
||||
}
|
@ -1,18 +1,16 @@
|
||||
import "./Root.css";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
import { Link, Outlet, RouteObject, useLocation, useNavigate, useParams } from "react-router-dom";
|
||||
import { useIntl, FormattedMessage } from "react-intl";
|
||||
|
||||
import Tabs, { Tab } from "Element/Tabs";
|
||||
import { RootState } from "State/Store";
|
||||
import Timeline from "Element/Timeline";
|
||||
import { System } from "System";
|
||||
import { TimelineSubject } from "Feed/TimelineFeed";
|
||||
import { debounce, getRelayName, sha256, unixNow, unwrap } from "Util";
|
||||
import useLogin from "Hooks/useLogin";
|
||||
|
||||
import messages from "./messages";
|
||||
import useLogin from "Hooks/useLogin";
|
||||
|
||||
interface RelayOption {
|
||||
url: string;
|
||||
|
@ -58,9 +58,10 @@ export function SubscribePage() {
|
||||
<h2>{mapPlanName(a.id)}</h2>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
defaultMessage="Support Snort every month for {price} sats and receive the following rewards"
|
||||
defaultMessage="Subscribe to Snort {plan} for {price} and receive the following rewards"
|
||||
values={{
|
||||
price: <b>{formatShort(a.price)}</b>,
|
||||
plan: mapPlanName(a.id),
|
||||
price: <b>{formatShort(a.price)} sats/mo</b>,
|
||||
}}
|
||||
/>
|
||||
:
|
||||
@ -86,10 +87,7 @@ export function SubscribePage() {
|
||||
{a.disabled ? (
|
||||
<FormattedMessage defaultMessage="Coming soon" />
|
||||
) : (
|
||||
<FormattedMessage
|
||||
defaultMessage="Subscribe for {amount}/mo"
|
||||
values={{ amount: formatShort(a.price) }}
|
||||
/>
|
||||
<FormattedMessage defaultMessage="Subscribe" />
|
||||
)}
|
||||
</AsyncButton>
|
||||
</div>
|
||||
|
@ -18,7 +18,7 @@ export const Plans = [
|
||||
{
|
||||
id: SubscriptionType.Supporter,
|
||||
price: 5_000,
|
||||
disabled: true,
|
||||
disabled: false,
|
||||
unlocks: [LockedFeatures.MultiAccount, LockedFeatures.NostrAddress, LockedFeatures.Badge],
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user