diff --git a/src/pages/Premium/Premium.module.scss b/src/pages/Premium/Premium.module.scss index 80489b9c..fba91bb9 100644 --- a/src/pages/Premium/Premium.module.scss +++ b/src/pages/Premium/Premium.module.scss @@ -406,6 +406,10 @@ flex-direction: column; width: 466px; + @media only screen and (max-width: 720px) { + width: unset; + } + .footer { display:flex; justify-content: space-between; @@ -849,6 +853,81 @@ li { list-style: disc; list-style-position: inside; + + .chevronRight { + display: none; + } + } + } +} + +.managePremium { + padding-inline: 12px; + .premiumSidebar { + .premiumSidebarTitle { + color: var(--text-primary); + font-size: 18px; + font-weight: 700; + line-height: 20px; + margin-bottom: 16px; + } + + .premiumSidebarDescription { + color: var(--text-secondary); + font-size: 14px; + font-weight: 400; + line-height: 20px; + + p, ul { + color: var(--text-secondary); + font-size: 14px; + font-weight: 400; + line-height: 20px; + background-color: var(--background-header-input); + border-radius: 8px; + } + + ul { + padding-left: 0; + } + + li { + list-style: none; + list-style-position: inside; + padding: 14px 16px; + button { + color: var(--text-primary); + font-size: 16px; + font-style: normal; + font-weight: 400; + line-height: 20px; + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + + .chevronRight { + display: block; + width: 6px; + height: 16px; + background-color: var(--text-primary); + -webkit-mask: url(../../assets/icons/chevron_right.svg) no-repeat 0 / 100%; + mask: url(../../assets/icons/chevron_right.svg) no-repeat 0 / 100%; + } + } + + border-bottom: 1px solid var(--subtile-devider); + border-radius: 0; + + &:first-child { + border-radius: 8px 8px 0 0; + } + + &:last-child { + border-bottom: none; + border-radius: 0 0 8px 8px; + } + } } } } @@ -1117,6 +1196,10 @@ align-items: center; gap: 20px; + @media only screen and (max-width: 720px) { + width: unset; + } + .description, .warning { width: 100%; color: var(--text-secondary); @@ -1168,6 +1251,10 @@ .renameDialog { width: 440px; + @media only screen and (max-width: 720px) { + width: unset; + } + .nameAvailableMessage { margin-top: 20px; width: 100%; @@ -1776,6 +1863,7 @@ font-size: 15px; font-weight: 400; line-height: 20px; + min-width: unset; } .tdDetails { @@ -1813,6 +1901,10 @@ outline: none; background: none; } + + @media only screen and (max-width: 720px) { + width: unset; + } } } @@ -1831,6 +1923,10 @@ width: 672px; border-radius: 12px; background: var(--background-input); + + @media only screen and (max-width: 720px) { + padding-inline: 6px; + } } .orderHistory { @@ -1842,6 +1938,10 @@ width: 100%; margin-top: 24px; + @media only screen and (max-width: 720px) { + width: calc(100dvw - 24px); + } + th { color: var(--text-primary); font-size: 15px; diff --git a/src/pages/Premium/Premium.tsx b/src/pages/Premium/Premium.tsx index 5ff1dd13..7310bdfc 100644 --- a/src/pages/Premium/Premium.tsx +++ b/src/pages/Premium/Premium.tsx @@ -56,6 +56,7 @@ import { useToastContext } from '../../components/Toaster/Toaster'; import { triggerImportEvents } from '../../lib/notes'; import { useAppContext } from '../../contexts/AppContext'; import { isPhone } from '../../utils'; +import PremiumManageModal from './PremiumManageModal'; export const satsInBTC = 100_000_000; @@ -91,6 +92,7 @@ export type PremiumStore = { openPromoCode: boolean, openRename: boolean, openRenew: boolean, + openManage: boolean, openOrderHistory: boolean, openFeatures: 'features' | 'faq' | undefined, openLegend: boolean, @@ -157,6 +159,7 @@ const Premium: Component = () => { openPromoCode: false, openRename: false, openRenew: false, + openManage: false, openLegend: false, openOrderHistory: false, openFeatures: undefined, @@ -738,6 +741,9 @@ const Premium: Component = () => { await getSubscriptionInfo(); setPremiumData('openRenew', () => true); break; + case 'managePremium': + setPremiumData('openManage', () => true); + break; case 'orderHistory': setPremiumData('openOrderHistory', () => true); break; @@ -1038,7 +1044,9 @@ const Premium: Component = () => { data={premiumData} profile={account?.activeUser} updateUserMetadata={updateUserMetadata} - onExtendPremium={() => handlePremiumAction('extendSubscription')}/> + onExtendPremium={() => handlePremiumAction('extendSubscription')} + onManagePremium={() => handlePremiumAction('managePremium')} + /> { setData={setPremiumData} /> + setPremiumData('openManage', () => v)} + data={premiumData} + setData={setPremiumData} + onSelect={handlePremiumAction} + /> + setPremiumData('openOrderHistory', () => v)} diff --git a/src/pages/Premium/PremiumManageModal.tsx b/src/pages/Premium/PremiumManageModal.tsx new file mode 100644 index 00000000..8453a5ef --- /dev/null +++ b/src/pages/Premium/PremiumManageModal.tsx @@ -0,0 +1,59 @@ +import { Component, createEffect, Show } from 'solid-js'; +import { SetStoreFunction } from 'solid-js/store'; +import AdvancedSearchDialog from '../../components/AdvancedSearch/AdvancedSearchDialog'; +import ButtonPrimary from '../../components/Buttons/ButtonPrimary'; +import ButtonSecondary from '../../components/Buttons/ButtonSecondary'; +import { PremiumStore } from './Premium'; + +import styles from './Premium.module.scss'; +import PremiumSubscriptionOptions from './PremiumSubscriptionOptions'; +import PremiumSidebarActive from './PremiumSidebarActive'; + + +const PremiumManageModal: Component<{ + data: PremiumStore, + setData: SetStoreFunction, + onSelect: (action: string) => void, + open?: boolean, + setOpen: (v: boolean) => void, + onOpen?: () => void, + onClose?: () => void, +}> = (props) => { + + createEffect(() => { + if (props.open) { + props.onOpen && props.onOpen(); + } else { + props.onClose && props.onClose(); + } + }) + + return ( + + Manage Premium + + } + > +
+ { + props.setOpen(false); + props.onSelect(action); + }} + onOpenFAQ={() => { + props.setOpen(false); + props.setData('openFeatures', () => 'faq'); + }} + /> +
+
+ ); +} + +export default PremiumManageModal diff --git a/src/pages/Premium/PremiumSidebarActive.tsx b/src/pages/Premium/PremiumSidebarActive.tsx index 691daef1..edf01274 100644 --- a/src/pages/Premium/PremiumSidebarActive.tsx +++ b/src/pages/Premium/PremiumSidebarActive.tsx @@ -41,22 +41,22 @@ const PremiumSidebarActive: Component<{
  • props.onSidebarAction('premiumRelay')}> - Premium Relay +
    Premium Relay
  • props.onSidebarAction('mediaManagment')}> - Media Managment +
    Media Managment
  • props.onSidebarAction('contactBackup')}> - Contact List Backup +
    Contact List Backup
  • props.onSidebarAction('contentBackup')}> - Content Backup +
    Content Backup
@@ -70,7 +70,7 @@ const PremiumSidebarActive: Component<{
  • props.onSidebarAction('orderHistory')}> - Order history +
    Order history
  • @@ -78,29 +78,29 @@ const PremiumSidebarActive: Component<{ props.onSidebarAction('extendSubscription')}>
    Extend your subscripton
    } > - Renew your subscripton +
    Renew your subscripton
  • props.onSidebarAction('changeName')}> - Change your Primal name +
    Change your Primal name
  • props.onSidebarAction('customLegend')}> - Legendary Profile Customization +
    Legendary Profile Customization
  • props.onSidebarAction('becomeLegend')}> - Become a Legend +
    Become a Legend
  • diff --git a/src/pages/Premium/PremiumStatusOverview.tsx b/src/pages/Premium/PremiumStatusOverview.tsx index 0e9dde60..036844d6 100644 --- a/src/pages/Premium/PremiumStatusOverview.tsx +++ b/src/pages/Premium/PremiumStatusOverview.tsx @@ -1,6 +1,6 @@ import { useIntl } from '@cookbook/solid-intl'; import { A, useNavigate } from '@solidjs/router'; -import { Component, Show } from 'solid-js'; +import { Component, Match, Show, Switch } from 'solid-js'; import ButtonPremium from '../../components/Buttons/ButtonPremium'; import { premium as t } from '../../translations'; @@ -11,6 +11,8 @@ import styles from './Premium.module.scss'; import PremiumSummary from './PremiumSummary'; import PremiumUserInfo from './PremiumUserInfo'; import { useAppContext } from '../../contexts/AppContext'; +import { isIOS } from '../../utils'; +import { isAndroid } from '@kobalte/utils'; const PremiumStatusOverview: Component<{ @@ -18,6 +20,7 @@ const PremiumStatusOverview: Component<{ profile?: PrimalUser, updateUserMetadata: (option?: 'nip05' | 'lud16') => void, onExtendPremium?: () => void, + onManagePremium?: () => void, }> = (props) => { const intl = useIntl(); const navigate = useNavigate(); @@ -66,25 +69,27 @@ const PremiumStatusOverview: Component<{ - - - - {intl.formatMessage(t.actions.extendPlan)} - - - } - > -
    +
    + + + + {intl.formatMessage(t.actions.managePremium)} + + + + {intl.formatMessage(t.actions.renewPlan)} -
    - - + + + + {intl.formatMessage(t.actions.extendPlan)} + + + +
    ); } diff --git a/src/translations.ts b/src/translations.ts index 961a1850..6ff52920 100644 --- a/src/translations.ts +++ b/src/translations.ts @@ -2559,6 +2559,11 @@ export const premium = { defaultMessage: 'Renew Your Subscription', description: 'Extend your subscription action on the premium page', }, + managePremium: { + id: 'pages.premium.actions.managePremium', + defaultMessage: 'Manage Premium', + description: 'Manage your Premium Account', + }, }, title: { general: {