Update to use new sdk updates

This commit is contained in:
Paul Frazee
2024-03-07 16:16:53 -08:00
parent b951bacdff
commit 59d5c8ecc0
13 changed files with 35 additions and 32 deletions
@@ -1,9 +1,9 @@
import {InterprettedLabelValueDefinition, LabelPreference} from '@atproto/api'
import {InterpretedLabelValueDefinition, LabelPreference} from '@atproto/api'
import {useLingui} from '@lingui/react'
import {msg} from '@lingui/macro'
export function useLabelBehaviorDescription(
labelValueDef: InterprettedLabelValueDefinition,
labelValueDef: InterpretedLabelValueDefinition,
pref: LabelPreference,
) {
const {_} = useLingui()
@@ -39,7 +39,7 @@ export function useLabelBehaviorDescription(
}
export function useLabelLongBehaviorDescription(
labelValueDef: InterprettedLabelValueDefinition,
labelValueDef: InterpretedLabelValueDefinition,
pref: LabelPreference,
) {
const {_} = useLingui()
+6 -5
View File
@@ -3,7 +3,7 @@ import {
AppBskyLabelerDefs,
LABELS,
interpretLabelValueDefinition,
InterprettedLabelValueDefinition,
InterpretedLabelValueDefinition,
} from '@atproto/api'
import {useLingui} from '@lingui/react'
import * as bcp47Match from 'bcp-47-match'
@@ -16,7 +16,7 @@ import {useLabelDefinitions} from '#/state/queries/preferences'
export interface LabelInfo {
label: ComAtprotoLabelDefs.Label
def: InterprettedLabelValueDefinition
def: InterpretedLabelValueDefinition
strings: ComAtprotoLabelDefs.LabelValueDefinitionStrings
labeler: AppBskyLabelerDefs.LabelerViewDetailed | undefined
}
@@ -35,9 +35,9 @@ export function useLabelInfo(label: ComAtprotoLabelDefs.Label): LabelInfo {
}
export function getDefinition(
labelDefs: Record<string, InterprettedLabelValueDefinition[]>,
labelDefs: Record<string, InterpretedLabelValueDefinition[]>,
label: ComAtprotoLabelDefs.Label,
): InterprettedLabelValueDefinition {
): InterpretedLabelValueDefinition {
// check local definitions
const customDef =
!label.val.startsWith('!') &&
@@ -60,6 +60,7 @@ export function getDefinition(
identifier: label.val,
severity: 'none',
blurs: 'none',
defaultSetting: 'ignore',
locales: [],
},
label.src,
@@ -69,7 +70,7 @@ export function getDefinition(
export function getLabelStrings(
locale: string,
globalLabelStrings: GlobalLabelStrings,
def: InterprettedLabelValueDefinition,
def: InterpretedLabelValueDefinition,
): ComAtprotoLabelDefs.LabelValueDefinitionStrings {
if (!def.definedBy) {
// global definition, look up strings