Use title case for Starter Pack (#11653)
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user