Upgrade Lingui to v5 (#9905)
This commit is contained in:
@@ -3,7 +3,7 @@ import {
|
||||
type ChatBskyConvoDefs,
|
||||
type ComAtprotoModerationCreateReport,
|
||||
} from '@atproto/api'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {useMutation} from '@tanstack/react-query'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {useMemo} from 'react'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {type ParsedReportSubject} from './types'
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import React from 'react'
|
||||
import {Pressable, type ScrollView, View} from 'react-native'
|
||||
import {type AppBskyLabelerDefs, BSKY_LABELER_DID} from '@atproto/api'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
|
||||
import {wait} from '#/lib/async/wait'
|
||||
import {getLabelingServiceTitle} from '#/lib/moderation'
|
||||
@@ -168,8 +169,7 @@ function Inner(props: ReportDialogProps) {
|
||||
if (supportedReasonTypes === undefined) return true
|
||||
return (
|
||||
// supports new reason type
|
||||
supportedReasonTypes.includes(state.selectedOption.reason) ||
|
||||
// supports old reason type (backwards compat)
|
||||
supportedReasonTypes.includes(state.selectedOption.reason) || // supports old reason type (backwards compat)
|
||||
supportedReasonTypes.includes(
|
||||
NEW_TO_OLD_REASONS_MAP[state.selectedOption.reason],
|
||||
)
|
||||
@@ -575,7 +575,6 @@ function Inner(props: ReportDialogProps) {
|
||||
)}
|
||||
</StepOuter>
|
||||
</View>
|
||||
|
||||
<Dialog.Close />
|
||||
</Dialog.ScrollableInner>
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {useMemo} from 'react'
|
||||
import {ToolsOzoneReportDefs as OzoneReportDefs} from '@atproto/api'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
export type ReportCategory =
|
||||
@@ -247,7 +247,7 @@ export function useReportOptions() {
|
||||
}
|
||||
|
||||
return {
|
||||
categories: Object.values(categories) as ReportCategoryConfig[],
|
||||
categories: Object.values(categories),
|
||||
getCategory(reasonName: ReportCategory) {
|
||||
return categories[reasonName]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user