Use title case for Starter Pack (#11653)
This commit is contained in:
@@ -102,7 +102,7 @@ function DialogInner({
|
||||
if (isMe) {
|
||||
if (profile.joinedViaStarterPack) {
|
||||
return _(
|
||||
msg`You joined Bluesky using a starter pack ${timeAgoString} ago`,
|
||||
msg`You joined Bluesky using a Starter Pack ${timeAgoString} ago`,
|
||||
)
|
||||
} else {
|
||||
return _(msg`You joined Bluesky ${timeAgoString} ago`)
|
||||
@@ -110,7 +110,7 @@ function DialogInner({
|
||||
} else {
|
||||
if (profile.joinedViaStarterPack) {
|
||||
return _(
|
||||
msg`${profileName} joined Bluesky using a starter pack ${timeAgoString} ago`,
|
||||
msg`${profileName} joined Bluesky using a Starter Pack ${timeAgoString} ago`,
|
||||
)
|
||||
} else {
|
||||
return _(msg`${profileName} joined Bluesky ${timeAgoString} ago`)
|
||||
|
||||
@@ -2,8 +2,7 @@ import {forwardRef, useCallback, useImperativeHandle, useState} from 'react'
|
||||
import {type ListRenderItemInfo, View} from 'react-native'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {type ModerationOpts} from '@bsky/sdk/moderation'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {useLingui} from '@lingui/react/macro'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
|
||||
import {useBottomBarOffset} from '#/lib/hooks/useBottomBarOffset'
|
||||
@@ -107,6 +106,12 @@ export const ProfilesList = forwardRef<SectionRef, ProfilesListProps>(
|
||||
)
|
||||
}
|
||||
|
||||
const onRefresh = async () => {
|
||||
setIsPTRing(true)
|
||||
await refetch()
|
||||
setIsPTRing(false)
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return (
|
||||
<View
|
||||
@@ -140,11 +145,7 @@ export const ProfilesList = forwardRef<SectionRef, ProfilesListProps>(
|
||||
desktopFixedHeight
|
||||
initialNumToRender={initialNumToRender}
|
||||
refreshing={isPTRing}
|
||||
onRefresh={async () => {
|
||||
setIsPTRing(true)
|
||||
await refetch()
|
||||
setIsPTRing(false)
|
||||
}}
|
||||
onRefresh={() => void onRefresh()}
|
||||
/>
|
||||
)
|
||||
},
|
||||
@@ -159,14 +160,14 @@ function OptedOutControls({
|
||||
listUri: string
|
||||
canRemove: boolean
|
||||
}) {
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const ax = useAnalytics()
|
||||
const [isRemoved, setIsRemoved] = useState(false)
|
||||
const {mutate: removeMembership, isPending} = useListMembershipRemoveMutation(
|
||||
{
|
||||
onSuccess: () => {
|
||||
setIsRemoved(true)
|
||||
Toast.show(_(msg`Removed from starter pack`))
|
||||
Toast.show(l`Removed from Starter Pack`)
|
||||
},
|
||||
onError: error =>
|
||||
Toast.show(cleanError(error), {
|
||||
@@ -183,12 +184,12 @@ function OptedOutControls({
|
||||
<Admonition.Icon />
|
||||
<Admonition.Content>
|
||||
<Admonition.Text>
|
||||
<Trans>Opted out of this starter pack</Trans>
|
||||
<Trans>Opted out of this Starter Pack</Trans>
|
||||
</Admonition.Text>
|
||||
</Admonition.Content>
|
||||
{canRemove ? (
|
||||
<Admonition.Button
|
||||
label={_(msg`Remove user from starter pack`)}
|
||||
label={l`Remove user from Starter Pack`}
|
||||
color="secondary"
|
||||
disabled={isPending}
|
||||
onPress={() => {
|
||||
|
||||
@@ -6,9 +6,7 @@ import {
|
||||
View,
|
||||
type ViewStyle,
|
||||
} from 'react-native'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
import {Trans, useLingui} from '@lingui/react/macro'
|
||||
import {useNavigation} from '@react-navigation/native'
|
||||
|
||||
import {useGenerateStarterPackMutation} from '#/lib/generate-starterpack'
|
||||
@@ -54,7 +52,7 @@ interface ProfileFeedgensProps {
|
||||
isMe: boolean
|
||||
emptyStateMessage?: string
|
||||
emptyStateButton?: EmptyStateButtonProps
|
||||
emptyStateIcon?: React.ComponentType<any> | React.ReactElement
|
||||
emptyStateIcon?: React.ComponentType | React.ReactElement
|
||||
}
|
||||
|
||||
function keyExtractor(item: app.bsky.graph.defs.StarterPackViewBasic) {
|
||||
@@ -90,7 +88,7 @@ export function ProfileStarterPacks({
|
||||
const {isTabletOrDesktop} = useWebMediaQueries()
|
||||
|
||||
const items = data?.pages.flatMap(page => page.starterPacks)
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
|
||||
const EmptyComponent = useCallback(() => {
|
||||
if (emptyStateMessage || emptyStateButton || emptyStateIcon) {
|
||||
@@ -101,9 +99,7 @@ export function ProfileStarterPacks({
|
||||
iconSize="3xl"
|
||||
message={
|
||||
emptyStateMessage ??
|
||||
_(
|
||||
msg`Starter packs let you share your favorite feeds and people with your friends.`,
|
||||
)
|
||||
l`Starter Packs let you share your favorite feeds and people with your friends.`
|
||||
}
|
||||
button={emptyStateButton}
|
||||
/>
|
||||
@@ -111,7 +107,7 @@ export function ProfileStarterPacks({
|
||||
)
|
||||
}
|
||||
return <Empty />
|
||||
}, [_, emptyStateMessage, emptyStateButton, emptyStateIcon])
|
||||
}, [l, emptyStateMessage, emptyStateButton, emptyStateIcon])
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
scrollToTop: () => {},
|
||||
@@ -122,7 +118,7 @@ export function ProfileStarterPacks({
|
||||
try {
|
||||
await refetch()
|
||||
} catch (err) {
|
||||
logger.error('Failed to refresh starter packs', {message: err})
|
||||
logger.error('Failed to refresh Starter Packs', {message: err})
|
||||
}
|
||||
setIsPTRing(false)
|
||||
}, [refetch, setIsPTRing])
|
||||
@@ -132,7 +128,7 @@ export function ProfileStarterPacks({
|
||||
try {
|
||||
await fetchNextPage()
|
||||
} catch (err) {
|
||||
logger.error('Failed to load more starter packs', {message: err})
|
||||
logger.error('Failed to load more Starter Packs', {message: err})
|
||||
}
|
||||
}, [isFetchingNextPage, hasNextPage, isError, fetchNextPage])
|
||||
|
||||
@@ -179,8 +175,8 @@ export function ProfileStarterPacks({
|
||||
}}
|
||||
removeClippedSubviews={true}
|
||||
desktopFixedHeight
|
||||
onEndReached={onEndReached}
|
||||
onRefresh={onRefresh}
|
||||
onEndReached={() => void onEndReached()}
|
||||
onRefresh={() => void onRefresh()}
|
||||
ListEmptyComponent={
|
||||
data ? (isMe ? EmptyComponent : undefined) : FeedLoadingPlaceholder
|
||||
}
|
||||
@@ -193,7 +189,7 @@ export function ProfileStarterPacks({
|
||||
}
|
||||
|
||||
function CreateAnother() {
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const t = useTheme()
|
||||
const navigation = useNavigation<NavigationProp>()
|
||||
|
||||
@@ -207,7 +203,7 @@ function CreateAnother() {
|
||||
t.atoms.border_contrast_low,
|
||||
]}>
|
||||
<Button
|
||||
label={_(msg`Create a starter pack`)}
|
||||
label={l`Create a Starter Pack`}
|
||||
variant="solid"
|
||||
color="secondary"
|
||||
size="small"
|
||||
@@ -223,7 +219,7 @@ function CreateAnother() {
|
||||
}
|
||||
|
||||
function Empty() {
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const navigation = useNavigation<NavigationProp>()
|
||||
const confirmDialogControl = useDialogControl()
|
||||
const followersDialogControl = useDialogControl()
|
||||
@@ -244,7 +240,7 @@ function Empty() {
|
||||
setIsGenerating(false)
|
||||
},
|
||||
onError: e => {
|
||||
logger.error('Failed to generate starter pack', {safeMessage: e})
|
||||
logger.error('Failed to generate Starter Pack', {safeMessage: e})
|
||||
setIsGenerating(false)
|
||||
if (e.message.includes('NOT_ENOUGH_FOLLOWERS')) {
|
||||
followersDialogControl.open()
|
||||
@@ -265,7 +261,7 @@ function Empty() {
|
||||
const wrappedOpenConfirmDialog = requireEmailVerification(openConfirmDialog, {
|
||||
instructions: [
|
||||
<Trans key="confirm">
|
||||
Before creating a starter pack, you must first verify your email.
|
||||
Before creating a Starter Pack, you must first verify your email.
|
||||
</Trans>,
|
||||
],
|
||||
})
|
||||
@@ -275,7 +271,7 @@ function Empty() {
|
||||
const wrappedNavToWizard = requireEmailVerification(navToWizard, {
|
||||
instructions: [
|
||||
<Trans key="nav">
|
||||
Before creating a starter pack, you must first verify your email.
|
||||
Before creating a Starter Pack, you must first verify your email.
|
||||
</Trans>,
|
||||
],
|
||||
})
|
||||
@@ -292,18 +288,18 @@ function Empty() {
|
||||
]}>
|
||||
<View style={[a.gap_xs]}>
|
||||
<Text style={[a.font_semi_bold, a.text_lg, {color: 'white'}]}>
|
||||
<Trans>You haven't created a starter pack yet!</Trans>
|
||||
<Trans>You haven't created a Starter Pack yet!</Trans>
|
||||
</Text>
|
||||
<Text style={[a.text_md, {color: 'white'}]}>
|
||||
<Trans>
|
||||
Starter packs let you easily share your favorite feeds and people
|
||||
Starter Packs let you easily share your favorite feeds and people
|
||||
with your friends.
|
||||
</Trans>
|
||||
</Text>
|
||||
</View>
|
||||
<View style={[a.flex_row, a.gap_md, {marginLeft: 'auto'}]}>
|
||||
<Button
|
||||
label={_(msg`Create a starter pack for me`)}
|
||||
label={l`Create a Starter Pack for me`}
|
||||
variant="ghost"
|
||||
color="primary"
|
||||
size="small"
|
||||
@@ -316,7 +312,7 @@ function Empty() {
|
||||
{isGenerating && <Loader size="md" />}
|
||||
</Button>
|
||||
<Button
|
||||
label={_(msg`Create a starter pack`)}
|
||||
label={l`Create a Starter Pack`}
|
||||
variant="ghost"
|
||||
color="primary"
|
||||
size="small"
|
||||
@@ -333,11 +329,10 @@ function Empty() {
|
||||
</ButtonText>
|
||||
</Button>
|
||||
</View>
|
||||
|
||||
<Prompt.Outer control={confirmDialogControl}>
|
||||
<Prompt.Content>
|
||||
<Prompt.TitleText>
|
||||
<Trans>Generate a starter pack</Trans>
|
||||
<Trans>Generate a Starter Pack</Trans>
|
||||
</Prompt.TitleText>
|
||||
<Prompt.DescriptionText>
|
||||
<Trans>
|
||||
@@ -349,12 +344,12 @@ function Empty() {
|
||||
<Prompt.Actions>
|
||||
<Prompt.Action
|
||||
color="primary"
|
||||
cta={_(msg`Choose for me`)}
|
||||
cta={l`Choose for me`}
|
||||
onPress={generate}
|
||||
/>
|
||||
<Prompt.Action
|
||||
color="secondary"
|
||||
cta={_(msg`Let me choose`)}
|
||||
cta={l`Let me choose`}
|
||||
onPress={() => {
|
||||
navigation.navigate('StarterPackWizard', {})
|
||||
}}
|
||||
@@ -363,21 +358,17 @@ function Empty() {
|
||||
</Prompt.Outer>
|
||||
<Prompt.Basic
|
||||
control={followersDialogControl}
|
||||
title={_(msg`Oops!`)}
|
||||
description={_(
|
||||
msg`You must be following at least seven other people to generate a starter pack.`,
|
||||
)}
|
||||
title={l`Oops!`}
|
||||
description={l`You must be following at least seven other people to generate a Starter Pack.`}
|
||||
onConfirm={() => {}}
|
||||
showCancel={false}
|
||||
/>
|
||||
<Prompt.Basic
|
||||
control={errorDialogControl}
|
||||
title={_(msg`Oops!`)}
|
||||
description={_(
|
||||
msg`An error occurred while generating your starter pack. Want to try again?`,
|
||||
)}
|
||||
title={l`Oops!`}
|
||||
description={l`An error occurred while generating your Starter Pack. Want to try again?`}
|
||||
onConfirm={generate}
|
||||
confirmButtonCta={_(msg`Retry`)}
|
||||
confirmButtonCta={l`Retry`}
|
||||
/>
|
||||
</LinearGradientBackground>
|
||||
)
|
||||
|
||||
@@ -164,7 +164,7 @@ export function QrCodeDialog({
|
||||
<Dialog.Outer control={control} nativeOptions={{preventExpansion: true}}>
|
||||
<Dialog.Handle />
|
||||
<Dialog.ScrollableInner
|
||||
label={_(msg`Create a QR code for a starter pack`)}>
|
||||
label={_(msg`Create a QR code for a Starter Pack`)}>
|
||||
<View style={[a.flex_1, a.align_center, a.gap_5xl]}>
|
||||
<Suspense fallback={<Loading />}>
|
||||
{!link ? (
|
||||
|
||||
@@ -81,11 +81,11 @@ function ShareDialogInner({
|
||||
<View style={[!gtMobile && a.gap_lg]}>
|
||||
<View style={[a.gap_sm, gtMobile && a.pb_lg]}>
|
||||
<Text style={[a.font_semi_bold, a.text_2xl]}>
|
||||
<Trans>Invite people to this starter pack!</Trans>
|
||||
<Trans>Invite people to this Starter Pack!</Trans>
|
||||
</Text>
|
||||
<Text style={[a.text_md, t.atoms.text_contrast_medium]}>
|
||||
<Trans>
|
||||
Share this starter pack and help people join your community on
|
||||
Share this Starter Pack and help people join your community on
|
||||
Bluesky.
|
||||
</Trans>
|
||||
</Text>
|
||||
|
||||
@@ -2,9 +2,7 @@ import {useMemo} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {Image} from 'expo-image'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {Plural, Trans} from '@lingui/react/macro'
|
||||
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
@@ -59,7 +57,7 @@ export function Card({
|
||||
}) {
|
||||
const {record, creator, joinedAllTimeCount} = starterPack
|
||||
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const t = useTheme()
|
||||
const {currentAccount} = useSession()
|
||||
const isOwnStarterPack = creator?.did === currentAccount?.did
|
||||
@@ -84,8 +82,8 @@ export function Card({
|
||||
style={[a.leading_snug, t.atoms.text_contrast_medium]}
|
||||
numberOfLines={1}>
|
||||
{isOwnStarterPack
|
||||
? _(msg`Starter pack by you`)
|
||||
: _(msg`Starter pack by ${sanitizeHandle(creator.handle, '@')}`)}
|
||||
? l`Starter Pack by you`
|
||||
: l`Starter Pack by ${sanitizeHandle(creator.handle, '@')}`}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
@@ -96,7 +94,7 @@ export function Card({
|
||||
) : null}
|
||||
{!!joinedAllTimeCount && joinedAllTimeCount >= 50 && (
|
||||
<Text style={[a.font_semi_bold, t.atoms.text_contrast_medium]}>
|
||||
<Trans comment="Number of users (always at least 50) who have joined Bluesky using a specific starter pack">
|
||||
<Trans comment="Number of users (always at least 50) who have joined Bluesky using a specific Starter Pack">
|
||||
<Plural value={joinedAllTimeCount} other="# users have" /> joined!
|
||||
</Trans>
|
||||
</Text>
|
||||
@@ -110,7 +108,7 @@ export function useStarterPackLink({
|
||||
}: {
|
||||
view: bsky.starterPack.AnyStarterPackView
|
||||
}) {
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const qc = useQueryClient()
|
||||
const {rkey, handleOrDid} = useMemo(() => {
|
||||
const rkey = new AtUri(view.uri).rkey
|
||||
@@ -125,8 +123,8 @@ export function useStarterPackLink({
|
||||
return {
|
||||
to: `/starter-pack/${handleOrDid}/${rkey}`,
|
||||
label: bsky.isType(app.bsky.graph.starterpack, view.record)
|
||||
? _(msg`Navigate to ${view.record.name}`)
|
||||
: _(msg`Navigate to starter pack`),
|
||||
? l`Navigate to ${view.record.name}`
|
||||
: l`Navigate to Starter Pack`,
|
||||
precache,
|
||||
}
|
||||
}
|
||||
@@ -139,7 +137,7 @@ export function Link({
|
||||
onPress?: () => void
|
||||
children: BaseLinkProps['children']
|
||||
}) {
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const queryClient = useQueryClient()
|
||||
const {record} = starterPack
|
||||
const {rkey, handleOrDid} = useMemo(() => {
|
||||
@@ -155,7 +153,7 @@ export function Link({
|
||||
return (
|
||||
<BaseLink
|
||||
to={`/starter-pack/${handleOrDid}/${rkey}`}
|
||||
label={_(msg`Navigate to ${record.name}`)}
|
||||
label={l`Navigate to ${record.name}`}
|
||||
onPress={() => {
|
||||
precacheResolvedUri(
|
||||
queryClient,
|
||||
|
||||
@@ -5,9 +5,7 @@ import {
|
||||
type ModerationOpts,
|
||||
type ModerationUI,
|
||||
} from '@bsky/sdk/moderation'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
import {Trans, useLingui} from '@lingui/react/macro'
|
||||
|
||||
import {DISCOVER_FEED_URI, STARTER_PACK_MAX_SIZE} from '#/lib/constants'
|
||||
import {sanitizeDisplayName} from '#/lib/strings/display-names'
|
||||
@@ -53,15 +51,15 @@ function WizardListCard({
|
||||
moderationUi: ModerationUI
|
||||
}) {
|
||||
const t = useTheme()
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
|
||||
return (
|
||||
<Toggle.Item
|
||||
name={type === 'user' ? _(msg`Person toggle`) : _(msg`Feed toggle`)}
|
||||
name={type === 'user' ? l`Person toggle` : l`Feed toggle`}
|
||||
label={
|
||||
included
|
||||
? _(msg`Remove ${displayName} from starter pack`)
|
||||
: _(msg`Add ${displayName} to starter pack`)
|
||||
? l`Remove ${displayName} from Starter Pack`
|
||||
: l`Add ${displayName} to Starter Pack`
|
||||
}
|
||||
value={included}
|
||||
disabled={btnType === 'remove' || disabled}
|
||||
@@ -109,7 +107,7 @@ function WizardListCard({
|
||||
<Checkbox />
|
||||
) : !disabled ? (
|
||||
<Button
|
||||
label={_(msg`Remove`)}
|
||||
label={l`Remove`}
|
||||
variant="solid"
|
||||
color="secondary"
|
||||
size="small"
|
||||
@@ -142,7 +140,7 @@ export function WizardProfileCard({
|
||||
const ax = useAnalytics()
|
||||
const {currentAccount} = useSession()
|
||||
|
||||
// Determine the "main" profile for this starter pack - either targetDid or current account
|
||||
// Determine the "main" profile for this Starter Pack - either targetDid or current account
|
||||
const targetProfileDid = state.targetDid || currentAccount?.did
|
||||
const isTarget = profile.did === targetProfileDid
|
||||
const included = isTarget || state.profiles.some(p => p.did === profile.did)
|
||||
|
||||
@@ -149,7 +149,7 @@ export function useTopic(
|
||||
} else if (link.startsWith('/starter-pack')) {
|
||||
return {
|
||||
type: 'starter-pack',
|
||||
label: l`Browse starter pack ${displayName}`,
|
||||
label: l`Browse Starter Pack ${displayName}`,
|
||||
displayName,
|
||||
uri: undefined,
|
||||
url: link,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {useCallback} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {Plural, Trans} from '@lingui/react/macro'
|
||||
import {Plural, Trans, useLingui} from '@lingui/react/macro'
|
||||
import {useNavigation} from '@react-navigation/native'
|
||||
|
||||
import {useRequireEmailVerification} from '#/lib/hooks/useRequireEmailVerification'
|
||||
@@ -67,7 +65,7 @@ export function StarterPackDialog({
|
||||
const wrappedNavToWizard = requireEmailVerification(navToWizard, {
|
||||
instructions: [
|
||||
<Trans key="nav">
|
||||
Before creating a starter pack, you must first verify your email.
|
||||
Before creating a Starter Pack, you must first verify your email.
|
||||
</Trans>,
|
||||
],
|
||||
})
|
||||
@@ -85,7 +83,7 @@ export function StarterPackDialog({
|
||||
}
|
||||
|
||||
function Empty({onStartWizard}: {onStartWizard: () => void}) {
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const t = useTheme()
|
||||
|
||||
return (
|
||||
@@ -96,18 +94,17 @@ function Empty({onStartWizard}: {onStartWizard: () => void}) {
|
||||
fill={t.atoms.border_contrast_medium.borderColor}
|
||||
/>
|
||||
<Text style={[a.text_center]}>
|
||||
<Trans>You have no starter packs.</Trans>
|
||||
<Trans>You have no Starter Packs.</Trans>
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={[a.align_center]}>
|
||||
<Button
|
||||
label={_(msg`Create starter pack`)}
|
||||
label={l`Create Starter Pack`}
|
||||
color="secondary_inverted"
|
||||
size="small"
|
||||
onPress={onStartWizard}>
|
||||
<ButtonText>
|
||||
<Trans comment="Text on button to create a new starter pack">
|
||||
<Trans comment="Text on button to create a new Starter Pack">
|
||||
Create
|
||||
</Trans>
|
||||
</ButtonText>
|
||||
@@ -128,7 +125,7 @@ function StarterPackList({
|
||||
enabled?: boolean
|
||||
}) {
|
||||
const control = Dialog.useDialogContext()
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const {data: subject} = useProfileQuery({did: targetDid})
|
||||
|
||||
const {
|
||||
@@ -178,10 +175,10 @@ function StarterPackList({
|
||||
native(a.pt_lg),
|
||||
]}>
|
||||
<Text style={[a.text_lg, a.font_semi_bold]}>
|
||||
<Trans>Add to starter packs</Trans>
|
||||
<Trans>Add to Starter Packs</Trans>
|
||||
</Text>
|
||||
<Button
|
||||
label={_(msg`Close`)}
|
||||
label={l`Close`}
|
||||
onPress={onClose}
|
||||
variant="ghost"
|
||||
color="secondary"
|
||||
@@ -196,15 +193,15 @@ function StarterPackList({
|
||||
<View
|
||||
style={[a.flex_row, a.justify_between, a.align_center, a.py_md]}>
|
||||
<Text style={[a.text_md, a.font_semi_bold]}>
|
||||
<Trans>New starter pack</Trans>
|
||||
<Trans>New Starter Pack</Trans>
|
||||
</Text>
|
||||
<Button
|
||||
label={_(msg`Create starter pack`)}
|
||||
label={l`Create Starter Pack`}
|
||||
color="secondary_inverted"
|
||||
size="small"
|
||||
onPress={onStartWizard}>
|
||||
<ButtonText>
|
||||
<Trans comment="Text on button to create a new starter pack">
|
||||
<Trans comment="Text on button to create a new Starter Pack">
|
||||
Create
|
||||
</Trans>
|
||||
</ButtonText>
|
||||
@@ -234,7 +231,7 @@ function StarterPackList({
|
||||
? () => 'starter_pack_dialog_loader'
|
||||
: (item: StarterPackWithMembership) => item.starterPack.uri
|
||||
}
|
||||
onEndReached={onEndReached}
|
||||
onEndReached={() => void onEndReached()}
|
||||
onEndReachedThreshold={0.1}
|
||||
ListHeaderComponent={listHeader}
|
||||
ListEmptyComponent={<Empty onStartWizard={onStartWizard} />}
|
||||
@@ -257,7 +254,7 @@ function StarterPackItem({
|
||||
}) {
|
||||
const t = useTheme()
|
||||
const ax = useAnalytics()
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const {currentAccount} = useSession()
|
||||
const isSelf = subject?.did === currentAccount?.did
|
||||
|
||||
@@ -268,26 +265,26 @@ function StarterPackItem({
|
||||
useListMembershipAddMutation({
|
||||
subject,
|
||||
onSuccess: () => {
|
||||
Toast.show(_(msg`Added to starter pack`))
|
||||
Toast.show(l`Added to Starter Pack`)
|
||||
},
|
||||
onError: err => {
|
||||
if (!isNetworkError(err)) {
|
||||
logger.error('Failed to add to starter pack', {safeMessage: err})
|
||||
logger.error('Failed to add to Starter Pack', {safeMessage: err})
|
||||
}
|
||||
Toast.show(_(msg`Failed to add to starter pack`), {type: 'error'})
|
||||
Toast.show(l`Failed to add to Starter Pack`, {type: 'error'})
|
||||
},
|
||||
})
|
||||
|
||||
const {mutate: removeMembership, isPending: isPendingRemove} =
|
||||
useListMembershipRemoveMutation({
|
||||
onSuccess: () => {
|
||||
Toast.show(_(msg`Removed from starter pack`))
|
||||
Toast.show(l`Removed from Starter Pack`)
|
||||
},
|
||||
onError: err => {
|
||||
if (!isNetworkError(err)) {
|
||||
logger.error('Failed to remove from starter pack', {safeMessage: err})
|
||||
logger.error('Failed to remove from Starter Pack', {safeMessage: err})
|
||||
}
|
||||
Toast.show(_(msg`Failed to remove from starter pack`), {type: 'error'})
|
||||
Toast.show(l`Failed to remove from Starter Pack`, {type: 'error'})
|
||||
},
|
||||
})
|
||||
|
||||
@@ -363,9 +360,8 @@ function StarterPackItem({
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<Button
|
||||
label={isInPack ? _(msg`Remove`) : _(msg`Add`)}
|
||||
label={isInPack ? l`Remove` : l`Add`}
|
||||
color={isInPack ? 'secondary' : 'primary_subtle'}
|
||||
size="tiny"
|
||||
disabled={isPending || isSelf}
|
||||
|
||||
@@ -2,8 +2,7 @@ import {View} from 'react-native'
|
||||
import {TID} from '@atproto/common-web'
|
||||
import {type $Typed} from '@atproto/lex'
|
||||
import {AtUri, type AtUriString, toDatetimeString} from '@atproto/syntax'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {useLingui} from '@lingui/react/macro'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
import {useNavigation} from '@react-navigation/native'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
@@ -33,7 +32,7 @@ export function CreateListFromStarterPackDialog({
|
||||
control: Dialog.DialogControlProps
|
||||
starterPack: app.bsky.graph.defs.StarterPackView
|
||||
}) {
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
const t = useTheme()
|
||||
const appviewClient = useAppviewClient()
|
||||
const pdsClient = usePdsClient()
|
||||
@@ -115,7 +114,7 @@ export function CreateListFromStarterPackDialog({
|
||||
})(),
|
||||
)
|
||||
|
||||
queryClient.invalidateQueries({queryKey: ['list-members', listUri]})
|
||||
void queryClient.invalidateQueries({queryKey: ['list-members', listUri]})
|
||||
|
||||
ax.metric('starterPack:convertToList', {
|
||||
starterPack: starterPack.uri,
|
||||
@@ -123,7 +122,7 @@ export function CreateListFromStarterPackDialog({
|
||||
})
|
||||
} catch (e) {
|
||||
logger.error('Failed to add members to list', {safeMessage: e})
|
||||
Toast.show(_(msg`List created, but failed to add some members`), {
|
||||
Toast.show(l`List created, but failed to add some members`, {
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
@@ -133,7 +132,7 @@ export function CreateListFromStarterPackDialog({
|
||||
|
||||
const onListCreated = (listUri: string) => {
|
||||
loadingDialogControl.open()
|
||||
addMembersAndNavigate(listUri)
|
||||
void addMembersAndNavigate(listUri)
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -144,24 +143,24 @@ export function CreateListFromStarterPackDialog({
|
||||
nativeOptions={{preventExpansion: true}}>
|
||||
<Dialog.Handle />
|
||||
<Dialog.ScrollableInner
|
||||
label={_(msg`Create list from starter pack`)}
|
||||
label={l`Create list from Starter Pack`}
|
||||
style={web({maxWidth: 400})}>
|
||||
<View style={[a.gap_lg]}>
|
||||
<Text style={[a.text_xl, a.font_bold]}>
|
||||
<Trans>Create list from starter pack</Trans>
|
||||
<Trans>Create list from Starter Pack</Trans>
|
||||
</Text>
|
||||
|
||||
<Text
|
||||
style={[a.text_md, a.leading_snug, t.atoms.text_contrast_high]}>
|
||||
<Trans>
|
||||
This will create a new list with the same name, description, and
|
||||
members as this starter pack.
|
||||
members as this Starter Pack.
|
||||
</Trans>
|
||||
</Text>
|
||||
|
||||
<Admonition type="tip">
|
||||
<Trans>
|
||||
Changes to the starter pack will not be reflected in the list
|
||||
Changes to the Starter Pack will not be reflected in the list
|
||||
after creation. The list will be an independent copy.
|
||||
</Trans>
|
||||
</Admonition>
|
||||
@@ -176,7 +175,7 @@ export function CreateListFromStarterPackDialog({
|
||||
a.pt_sm,
|
||||
]}>
|
||||
<Button
|
||||
label={_(msg`Create list`)}
|
||||
label={l`Create list`}
|
||||
onPress={onPressCreate}
|
||||
size={platform({
|
||||
web: 'small',
|
||||
@@ -188,7 +187,7 @@ export function CreateListFromStarterPackDialog({
|
||||
</ButtonText>
|
||||
</Button>
|
||||
<Button
|
||||
label={_(msg`Cancel`)}
|
||||
label={l`Cancel`}
|
||||
onPress={() => control.close()}
|
||||
size={platform({
|
||||
web: 'small',
|
||||
@@ -204,7 +203,6 @@ export function CreateListFromStarterPackDialog({
|
||||
<Dialog.Close />
|
||||
</Dialog.ScrollableInner>
|
||||
</Dialog.Outer>
|
||||
|
||||
<CreateOrEditListDialog
|
||||
control={createDialogControl}
|
||||
purpose="app.bsky.graph.defs#curatelist"
|
||||
@@ -215,13 +213,12 @@ export function CreateListFromStarterPackDialog({
|
||||
avatar: starterPack.list?.avatar,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Dialog.Outer
|
||||
control={loadingDialogControl}
|
||||
nativeOptions={{preventDismiss: true}}>
|
||||
<Dialog.Handle />
|
||||
<Dialog.ScrollableInner
|
||||
label={_(msg`Adding members to list...`)}
|
||||
label={l`Adding members to list...`}
|
||||
style={web({maxWidth: 400})}>
|
||||
<View style={[a.align_center, a.gap_lg, a.py_5xl]}>
|
||||
<Loader size="xl" />
|
||||
|
||||
@@ -187,7 +187,7 @@ function DialogInner({
|
||||
ImageMeta | undefined | null
|
||||
>()
|
||||
|
||||
// When creating with pre-filled values (from starter pack), consider dirty
|
||||
// When creating with pre-filled values (from Starter Pack), consider dirty
|
||||
// immediately so the Save button is enabled
|
||||
const hasInitialValuesForCreate = !list && initialValues != null
|
||||
const dirty =
|
||||
|
||||
@@ -53,7 +53,7 @@ export function useLandingEntry() {
|
||||
}, 500)
|
||||
|
||||
void (async () => {
|
||||
// Check for starter pack
|
||||
// Check for Starter Pack
|
||||
let uri: string | null | undefined
|
||||
|
||||
if (IS_ANDROID) {
|
||||
|
||||
@@ -11,7 +11,7 @@ export function useLandingEntry() {
|
||||
const href = window.location.href
|
||||
const url = new URL(href)
|
||||
|
||||
// Check for starter pack
|
||||
// Check for Starter Pack
|
||||
const atUri = httpStarterPackUriToAtUri(href)
|
||||
if (atUri) {
|
||||
// Determines if an App Clip is loading this landing page
|
||||
|
||||
@@ -1,71 +1,70 @@
|
||||
import {useMemo} from 'react'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {useLingui} from '@lingui/react/macro'
|
||||
|
||||
import {type ParsedReportSubject} from './types'
|
||||
|
||||
export function useCopyForSubject(subject: ParsedReportSubject) {
|
||||
const {_} = useLingui()
|
||||
const {t: l} = useLingui()
|
||||
return useMemo(() => {
|
||||
switch (subject.type) {
|
||||
case 'account': {
|
||||
return {
|
||||
title: _(msg`Report this user`),
|
||||
subtitle: _(msg`Why should this user be reviewed?`),
|
||||
title: l`Report this user`,
|
||||
subtitle: l`Why should this user be reviewed?`,
|
||||
}
|
||||
}
|
||||
case 'status': {
|
||||
return {
|
||||
title: _(msg`Report this livestream`),
|
||||
subtitle: _(msg`Why should this livestream be reviewed?`),
|
||||
title: l`Report this livestream`,
|
||||
subtitle: l`Why should this livestream be reviewed?`,
|
||||
}
|
||||
}
|
||||
case 'post': {
|
||||
return {
|
||||
title: _(msg`Report this post`),
|
||||
subtitle: _(msg`Why should this post be reviewed?`),
|
||||
title: l`Report this post`,
|
||||
subtitle: l`Why should this post be reviewed?`,
|
||||
}
|
||||
}
|
||||
case 'list': {
|
||||
return {
|
||||
title: _(msg`Report this list`),
|
||||
subtitle: _(msg`Why should this list be reviewed?`),
|
||||
title: l`Report this list`,
|
||||
subtitle: l`Why should this list be reviewed?`,
|
||||
}
|
||||
}
|
||||
case 'feed': {
|
||||
return {
|
||||
title: _(msg`Report this feed`),
|
||||
subtitle: _(msg`Why should this feed be reviewed?`),
|
||||
title: l`Report this feed`,
|
||||
subtitle: l`Why should this feed be reviewed?`,
|
||||
}
|
||||
}
|
||||
case 'starterPack': {
|
||||
return {
|
||||
title: _(msg`Report this starter pack`),
|
||||
subtitle: _(msg`Why should this starter pack be reviewed?`),
|
||||
title: l`Report this Starter Pack`,
|
||||
subtitle: l`Why should this Starter Pack be reviewed?`,
|
||||
}
|
||||
}
|
||||
case 'convoMessage': {
|
||||
switch (subject.view) {
|
||||
case 'convo': {
|
||||
return {
|
||||
title: _(msg`Report this conversation`),
|
||||
subtitle: _(msg`Why should this conversation be reviewed?`),
|
||||
title: l`Report this conversation`,
|
||||
subtitle: l`Why should this conversation be reviewed?`,
|
||||
}
|
||||
}
|
||||
case 'message': {
|
||||
return {
|
||||
title: _(msg`Report this message`),
|
||||
subtitle: _(msg`Why should this message be reviewed?`),
|
||||
title: l`Report this message`,
|
||||
subtitle: l`Why should this message be reviewed?`,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
case 'convo': {
|
||||
return {
|
||||
title: _(msg`Report this conversation`),
|
||||
subtitle: _(msg`Why should this conversation be reviewed?`),
|
||||
title: l`Report this conversation`,
|
||||
subtitle: l`Why should this conversation be reviewed?`,
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [_, subject])
|
||||
}, [l, subject])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user