run lingui codemod

This commit is contained in:
Samuel Newman
2026-06-05 12:22:09 +03:00
parent da41202bc5
commit 0353fd1dd7
@@ -8,9 +8,7 @@ import {
type ViewStyle,
} from 'react-native'
import {type AppBskyGraphDefs} from '@atproto/api'
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'
@@ -91,7 +89,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) {
@@ -102,9 +100,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}
/>
@@ -112,7 +108,7 @@ export function ProfileStarterPacks({
)
}
return <Empty />
}, [_, emptyStateMessage, emptyStateButton, emptyStateIcon])
}, [l, emptyStateMessage, emptyStateButton, emptyStateIcon])
useImperativeHandle(ref, () => ({
scrollToTop: () => {},
@@ -169,13 +165,13 @@ export function ProfileStarterPacks({
<ListFooter
isFetchingNextPage={isFetchingNextPage}
hasNextPage={hasNextPage}
error={isError ? _(msg`Could not load more starter packs`) : undefined}
error={isError ? l`Could not load more starter packs` : undefined}
onRetry={fetchNextPage}
style={{paddingBottom: bottomBarOffset}}
/>
)
}, [
_,
l,
data,
items?.length,
isMe,
@@ -214,7 +210,7 @@ export function ProfileStarterPacks({
}
function CreateAnother({style}: {style?: StyleProp<ViewStyle>}) {
const {_} = useLingui()
const {t: l} = useLingui()
const t = useTheme()
const navigation = useNavigation<NavigationProp>()
@@ -229,7 +225,7 @@ function CreateAnother({style}: {style?: StyleProp<ViewStyle>}) {
style,
]}>
<Button
label={_(msg`Create a starter pack`)}
label={l`Create a starter pack`}
variant="solid"
color="secondary"
size="small"
@@ -245,7 +241,7 @@ function CreateAnother({style}: {style?: StyleProp<ViewStyle>}) {
}
function Empty() {
const {_} = useLingui()
const {t: l} = useLingui()
const navigation = useNavigation<NavigationProp>()
const confirmDialogControl = useDialogControl()
const followersDialogControl = useDialogControl()
@@ -325,7 +321,7 @@ function Empty() {
</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"
@@ -338,7 +334,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"
@@ -355,7 +351,6 @@ function Empty() {
</ButtonText>
</Button>
</View>
<Prompt.Outer control={confirmDialogControl}>
<Prompt.Content>
<Prompt.TitleText>
@@ -371,12 +366,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', {})
}}
@@ -385,21 +380,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>
)