check if mutiny plus

This commit is contained in:
Paul Miller
2023-09-22 16:32:08 -05:00
committed by Tony Giorgio
parent 932c0a1f2b
commit f5ce8e2c33
7 changed files with 72 additions and 22 deletions

View File

@@ -0,0 +1,40 @@
import { ParentComponent } from "solid-js";
import { A } from "solid-start";
import forward from "~/assets/icons/forward.svg";
import { useI18n } from "~/i18n/context";
export const CtaCard: ParentComponent = (props) => {
return (
<div class="w-full">
<div class="relative">
<div class="to-bg-m-grey-900/50 absolute inset-0 h-full w-full scale-[0.60] transform rounded-full bg-m-red/50 bg-gradient-to-r from-m-red/50 blur-2xl" />
<div class="relative flex-col gap-2 rounded-xl border border-m-red bg-m-grey-800 py-4">
{props.children}{" "}
</div>
</div>
</div>
);
};
export function MutinyPlusCta() {
const i18n = useI18n();
return (
<CtaCard>
<A
href={"/settings/plus"}
class="flex w-full flex-col gap-1 px-4 py-2 no-underline hover:bg-m-grey-750 active:bg-m-grey-900"
>
<div class="flex justify-between">
<span>
Mutiny<span class="text-m-red">+</span>
</span>
<img src={forward} alt="go" />
</div>
<div class="text-sm text-m-grey-400">
{i18n.t("settings.plus.cta_description")}
</div>
</A>
</CtaCard>
);
}

View File

@@ -43,3 +43,4 @@ export * from "./Toaster";
export * from "./NostrActivity"; export * from "./NostrActivity";
export * from "./SyncContactsForm"; export * from "./SyncContactsForm";
export * from "./GiftLink"; export * from "./GiftLink";
export * from "./MutinyPlusCta";

View File

@@ -407,7 +407,9 @@ export default {
satisfaction: "Smug satisfaction", satisfaction: "Smug satisfaction",
gifting: "Gifting", gifting: "Gifting",
multi_device: "Multi-device access", multi_device: "Multi-device access",
more: "... and more to come" more: "... and more to come",
cta_description:
"Enjoy early access to new features and premium functionality."
}, },
restore: { restore: {
title: "Restore", title: "Restore",
@@ -486,7 +488,9 @@ export default {
send_cta: "Create a gift", send_cta: "Create a gift",
send_delete_button: "Delete Gift", send_delete_button: "Delete Gift",
send_delete_confirm: send_delete_confirm:
"Are you sure you want to delete this gift? Is this your rugpull moment?" "Are you sure you want to delete this gift? Is this your rugpull moment?",
need_plus:
"Upgrade to Mutiny+ to enable gifting. Gifting allows you to create a Mutiny gift URL that can be claimed by anyone with a web browser."
} }
}, },
swap: { swap: {

View File

@@ -302,7 +302,7 @@ function Nwc() {
<SettingsCard <SettingsCard
title={i18n.t("settings.connections.manage_connections")} title={i18n.t("settings.connections.manage_connections")}
> >
<For each={nwcProfiles()?.filter(p => p.tag !== "Gift")}> <For each={nwcProfiles()?.filter((p) => p.tag !== "Gift")}>
{(profile) => ( {(profile) => (
<Collapser <Collapser
title={profile.name} title={profile.name}

View File

@@ -29,6 +29,7 @@ import {
IntegratedQr, IntegratedQr,
LargeHeader, LargeHeader,
LoadingSpinner, LoadingSpinner,
MutinyPlusCta,
MutinyWalletGuard, MutinyWalletGuard,
NavBar, NavBar,
NiceP, NiceP,
@@ -47,7 +48,10 @@ type CreateGiftForm = {
amount: string; amount: string;
}; };
export function SingleGift(props: { profile: NwcProfile; onDelete?: () => void }) { export function SingleGift(props: {
profile: NwcProfile;
onDelete?: () => void;
}) {
const i18n = useI18n(); const i18n = useI18n();
const [state, _actions] = useMegaStore(); const [state, _actions] = useMegaStore();
@@ -199,6 +203,15 @@ export default function GiftPage() {
<SafeArea> <SafeArea>
<DefaultMain> <DefaultMain>
<BackPop /> <BackPop />
<Show when={!state.mutiny_plus}>
<VStack>
<LargeHeader>
{i18n.t("settings.gift.send_header")}
</LargeHeader>
<NiceP>{i18n.t("settings.gift.need_plus")}</NiceP>
<MutinyPlusCta />
</VStack>
</Show>
<Show when={giftResult()}> <Show when={giftResult()}>
<VStack> <VStack>
<Switch> <Switch>
@@ -234,7 +247,7 @@ export default function GiftPage() {
</Button> </Button>
</VStack> </VStack>
</Show> </Show>
<Show when={!giftResult()}> <Show when={!giftResult() && state.mutiny_plus}>
<LargeHeader> <LargeHeader>
{i18n.t("settings.gift.send_header")} {i18n.t("settings.gift.send_header")}
</LargeHeader> </LargeHeader>

View File

@@ -36,14 +36,11 @@ function Perks(props: { alreadySubbed?: boolean }) {
<Show when={props.alreadySubbed}> <Show when={props.alreadySubbed}>
<li>{i18n.t("settings.plus.satisfaction")}</li> <li>{i18n.t("settings.plus.satisfaction")}</li>
</Show> </Show>
<li>{i18n.t("settings.plus.gifting")} </li>
<li> <li>
{i18n.t("redshift.title")}{" "} {i18n.t("redshift.title")}{" "}
<em>{i18n.t("common.coming_soon")}</em> <em>{i18n.t("common.coming_soon")}</em>
</li> </li>
<li>
{i18n.t("settings.plus.gifting")}{" "}
<em>{i18n.t("common.coming_soon")}</em>
</li>
<li> <li>
{i18n.t("settings.plus.multi_device")}{" "} {i18n.t("settings.plus.multi_device")}{" "}
<em>{i18n.t("common.coming_soon")}</em> <em>{i18n.t("common.coming_soon")}</em>

View File

@@ -7,6 +7,7 @@ import {
DefaultMain, DefaultMain,
ExternalLink, ExternalLink,
LargeHeader, LargeHeader,
MutinyPlusCta,
NavBar, NavBar,
SafeArea, SafeArea,
SettingsCard, SettingsCard,
@@ -78,15 +79,7 @@ export default function Settings() {
<LargeHeader>{i18n.t("settings.header")}</LargeHeader> <LargeHeader>{i18n.t("settings.header")}</LargeHeader>
<VStack biggap> <VStack biggap>
<Show when={state.settings?.selfhosted !== "true"}> <Show when={state.settings?.selfhosted !== "true"}>
<SettingsLinkList <MutinyPlusCta />
header={i18n.t("settings.plus.title")}
links={[
{
href: "/settings/plus",
text: i18n.t("settings.support")
}
]}
/>
</Show> </Show>
<SettingsLinkList <SettingsLinkList
header={i18n.t("settings.general")} header={i18n.t("settings.general")}
@@ -137,7 +130,9 @@ export default function Settings() {
disabled: !state.mutiny_plus, disabled: !state.mutiny_plus,
text: i18n.t("settings.gift.title"), text: i18n.t("settings.gift.title"),
caption: !state.mutiny_plus ? "Upgrade to Mutiny+ to enabled gifting" : undefined caption: !state.mutiny_plus
? "Upgrade to Mutiny+ to enabled gifting"
: undefined
}, },
{ {
href: "/settings/lnurlauth", href: "/settings/lnurlauth",