Add prop to show learn more
This commit is contained in:
@@ -3,7 +3,6 @@ import {View} from 'react-native'
|
|||||||
import {PURCHASES_ERROR_CODE} from 'react-native-purchases'
|
import {PURCHASES_ERROR_CODE} from 'react-native-purchases'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import {useNavigationState} from '@react-navigation/native'
|
|
||||||
|
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
import {usePurchaseOffering} from '#/state/purchases/hooks/usePurchaseOffering'
|
import {usePurchaseOffering} from '#/state/purchases/hooks/usePurchaseOffering'
|
||||||
@@ -15,7 +14,7 @@ import {
|
|||||||
import {parseOfferingId} from '#/state/purchases/types'
|
import {parseOfferingId} from '#/state/purchases/types'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import * as Toast from '#/view/com/util/Toast'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
import {atoms as a, tokens, useBreakpoints, useGutters,useTheme} from '#/alf'
|
import {atoms as a, tokens, useBreakpoints, useGutters, useTheme} from '#/alf'
|
||||||
import {Admonition} from '#/components/Admonition'
|
import {Admonition} from '#/components/Admonition'
|
||||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
@@ -34,27 +33,32 @@ import {Text} from '#/components/Typography'
|
|||||||
|
|
||||||
export function BlueskyPlusCore({
|
export function BlueskyPlusCore({
|
||||||
control,
|
control,
|
||||||
|
showLearnMore,
|
||||||
}: {
|
}: {
|
||||||
control: Dialog.DialogControlProps
|
control: Dialog.DialogControlProps
|
||||||
|
showLearnMore?: boolean
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer control={control}>
|
<Dialog.Outer control={control}>
|
||||||
<Dialog.Handle />
|
<Dialog.Handle />
|
||||||
<DialogInner control={control} />
|
<DialogInner control={control} showLearnMore={showLearnMore} />
|
||||||
</Dialog.Outer>
|
</Dialog.Outer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function DialogInner({control}: {control: Dialog.DialogControlProps}) {
|
function DialogInner({
|
||||||
|
control,
|
||||||
|
showLearnMore,
|
||||||
|
}: {
|
||||||
|
control: Dialog.DialogControlProps
|
||||||
|
showLearnMore?: boolean
|
||||||
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
const dialogGutters = useGutters(['wide'])
|
const dialogGutters = useGutters(['wide'])
|
||||||
const {gtMobile} = useBreakpoints()
|
const {gtMobile} = useBreakpoints()
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const copy = useCoreOfferingCopy()
|
const copy = useCoreOfferingCopy()
|
||||||
const routes = useNavigationState(state => state.routes)
|
|
||||||
const currentRoute = routes.at(routes.length - 1)
|
|
||||||
const isOnSubscriptionsPage = currentRoute?.name === 'Subscriptions'
|
|
||||||
// TODO if 3p PDS
|
// TODO if 3p PDS
|
||||||
const needsEmail = !currentAccount?.email
|
const needsEmail = !currentAccount?.email
|
||||||
const needsConfirmEmail = !currentAccount?.emailConfirmed
|
const needsConfirmEmail = !currentAccount?.emailConfirmed
|
||||||
@@ -359,7 +363,7 @@ function DialogInner({control}: {control: Dialog.DialogControlProps}) {
|
|||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<View style={[a.flex_row, a.pt_md, a.gap_sm]}>
|
<View style={[a.flex_row, a.pt_md, a.gap_sm]}>
|
||||||
{!isOnSubscriptionsPage && (
|
{showLearnMore && (
|
||||||
<Link
|
<Link
|
||||||
to="/subscriptions"
|
to="/subscriptions"
|
||||||
label={_(msg`Learn more about Bluesky+`)}
|
label={_(msg`Learn more about Bluesky+`)}
|
||||||
|
|||||||
Reference in New Issue
Block a user