Update to use new labeler semantics
This commit is contained in:
@@ -2,16 +2,16 @@ import React from 'react'
|
||||
import {View} from 'react-native'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {AppBskyModerationDefs} from '@atproto/api'
|
||||
import {AppBskyLabelerDefs} from '@atproto/api'
|
||||
|
||||
import {Link as InternalLink, LinkProps} from '#/components/Link'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {useModServiceInfoQuery} from '#/state/queries/modservice'
|
||||
import {useLabelerInfoQuery} from '#/state/queries/labeler'
|
||||
|
||||
export * as Card from '#/components/ModerationServiceCard/Card'
|
||||
|
||||
type ModerationServiceProps = {
|
||||
modservice: AppBskyModerationDefs.ModServiceViewDetailed
|
||||
modservice: AppBskyLabelerDefs.LabelerViewDetailed
|
||||
}
|
||||
|
||||
export function Link({
|
||||
@@ -54,10 +54,10 @@ export function Loader({
|
||||
loading?: React.ComponentType<{}>
|
||||
error?: React.ComponentType<{error: string}>
|
||||
component: React.ComponentType<{
|
||||
modservice: AppBskyModerationDefs.ModServiceViewDetailed
|
||||
modservice: AppBskyLabelerDefs.LabelerViewDetailed
|
||||
}>
|
||||
}) {
|
||||
const {isLoading, data, error} = useModServiceInfoQuery({did})
|
||||
const {isLoading, data, error} = useLabelerInfoQuery({did})
|
||||
|
||||
return isLoading ? (
|
||||
LoadingComponent ? (
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react'
|
||||
import {View, Linking, Pressable} from 'react-native'
|
||||
import {msg} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {AppBskyModerationDefs, LabelGroupDefinition} from '@atproto/api'
|
||||
import {AppBskyLabelerDefs, LabelGroupDefinition} from '@atproto/api'
|
||||
|
||||
import {atoms as a, useTheme, tokens, native} from '#/alf'
|
||||
import {Text} from '#/components/Typography'
|
||||
@@ -27,7 +27,7 @@ import {CharProgress} from '#/view/com/composer/char-progress/CharProgress'
|
||||
import {Loader} from '#/components/Loader'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
import {useModServicesDetailedInfoQuery} from '#/state/queries/modservice'
|
||||
import {useLabelersDetailedInfoQuery} from '#/state/queries/labeler'
|
||||
import {
|
||||
getModerationServiceTitle,
|
||||
useConfigurableContentLabelGroups,
|
||||
@@ -338,7 +338,7 @@ export function ReportDialogLoaded({
|
||||
labelGroupToLabelerMap,
|
||||
...props
|
||||
}: ReportDialogProps & {
|
||||
labelers: AppBskyModerationDefs.ModServiceViewDetailed[]
|
||||
labelers: AppBskyLabelerDefs.LabelerViewDetailed[]
|
||||
labelGroupToLabelerMap: ReturnType<typeof getLabelGroupToLabelerMap>
|
||||
}) {
|
||||
const t = useTheme()
|
||||
@@ -480,7 +480,7 @@ function ReportDialogInner(props: ReportDialogProps) {
|
||||
isLoading: isModServicesLoading,
|
||||
data: modservices,
|
||||
error: modservicesError,
|
||||
} = useModServicesDetailedInfoQuery({
|
||||
} = useLabelersDetailedInfoQuery({
|
||||
dids: preferences ? preferences.moderationOpts.mods.map(m => m.did) : [],
|
||||
})
|
||||
const isLoading = isPreferencesLoading || isModServicesLoading
|
||||
|
||||
Reference in New Issue
Block a user