From 7d80e5db546d82b4e9844de6a550f43825ccecd4 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 7 Mar 2024 13:00:03 -0600 Subject: [PATCH] Fix lint errors --- src/components/icons/DotGrid.tsx | 8 +++++--- src/screens/Profile/Header/ProfileHeaderLabeler.tsx | 5 ++--- src/screens/Profile/Sections/Labels.tsx | 4 ---- src/state/modals/index.tsx | 2 +- src/view/com/posts/FeedItem.tsx | 8 -------- src/view/screens/DebugMod.tsx | 5 +++-- 6 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/components/icons/DotGrid.tsx b/src/components/icons/DotGrid.tsx index 31d6a65b10..bdc7cf479a 100644 --- a/src/components/icons/DotGrid.tsx +++ b/src/components/icons/DotGrid.tsx @@ -1,5 +1,7 @@ import {createSinglePathSVG} from './TEMPLATE' -export const DotGrid1x3Horizontal_Stroke2_Corner0_Rounded = createSinglePathSVG({ - path: 'M2 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm16 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm-6-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z', -}) +export const DotGrid1x3Horizontal_Stroke2_Corner0_Rounded = createSinglePathSVG( + { + path: 'M2 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm16 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm-6-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z', + }, +) diff --git a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx index 64b6aebc33..7dd006c0b6 100644 --- a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx +++ b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx @@ -77,9 +77,8 @@ let ProfileHeaderLabeler = ({ variables?.subscribe ?? preferences?.moderationPrefs.mods.find(mod => mod.did === profile.did) const canSubscribe = - isSubscribed || (preferences - ? preferences?.moderationPrefs.mods.length < 10 - : false) + isSubscribed || + (preferences ? preferences?.moderationPrefs.mods.length < 10 : false) const {mutateAsync: likeMod, isPending: isLikePending} = useLikeMutation() const {mutateAsync: unlikeMod, isPending: isUnlikePending} = useUnlikeMutation() diff --git a/src/screens/Profile/Sections/Labels.tsx b/src/screens/Profile/Sections/Labels.tsx index 20460ee4e0..c7cdeeab17 100644 --- a/src/screens/Profile/Sections/Labels.tsx +++ b/src/screens/Profile/Sections/Labels.tsx @@ -11,7 +11,6 @@ import {useLingui} from '@lingui/react' import {useSafeAreaFrame} from 'react-native-safe-area-context' import {useScrollHandlers} from '#/lib/ScrollContext' -import {runOnJS} from 'react-native-reanimated' import {useAnimatedScrollHandler} from '#/lib/hooks/useAnimatedScrollHandler_FIXED' import {lookupLabelValueDefinition} from '#/lib/moderation' import {ListRef} from '#/view/com/util/List' @@ -21,8 +20,6 @@ import {isNative} from '#/platform/detection' import {useTheme, atoms as a} from '#/alf' import {Text} from '#/components/Typography' import {Loader} from '#/components/Loader' -import {Divider} from '#/components/Divider' -import {Button, ButtonText} from '#/components/Button' import {CenteredView, ScrollView} from '#/view/com/util/Views' import {ErrorState} from '../ErrorState' import {ModerationLabelPref} from '#/components/moderation/ModerationLabelPref' @@ -113,7 +110,6 @@ export function ProfileLabelsSectionInner({ scrollElRef: ListRef headerHeight: number }) { - const {_} = useLingui() const t = useTheme() const contextScrollHandlers = useScrollHandlers() diff --git a/src/state/modals/index.tsx b/src/state/modals/index.tsx index 36b2d6ddc9..df69ac6a8b 100644 --- a/src/state/modals/index.tsx +++ b/src/state/modals/index.tsx @@ -1,5 +1,5 @@ import React from 'react' -import {AppBskyActorDefs, AppBskyGraphDefs, ModerationUI} from '@atproto/api' +import {AppBskyActorDefs, AppBskyGraphDefs} from '@atproto/api' import {StyleProp, ViewStyle} from 'react-native' import {Image as RNImage} from 'react-native-image-crop-picker' diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx index 737f02f8fe..a90ced32c2 100644 --- a/src/view/com/posts/FeedItem.tsx +++ b/src/view/com/posts/FeedItem.tsx @@ -33,7 +33,6 @@ import {countLines} from 'lib/strings/helpers' import {useComposerControls} from '#/state/shell/composer' import {Shadow, usePostShadow, POST_TOMBSTONE} from '#/state/cache/post-shadow' import {FeedNameText} from '../util/FeedInfoText' -import {useSession} from '#/state/session' import {Trans, msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {atoms as a} from '#/alf' @@ -106,17 +105,10 @@ let FeedItemInner = ({ const {openComposer} = useComposerControls() const pal = usePalette('default') const {_} = useLingui() - const {currentAccount} = useSession() const href = useMemo(() => { const urip = new AtUri(post.uri) return makeProfileLink(post.author, 'post', urip.rkey) }, [post.uri, post.author]) - const isModeratedPost = !!moderation.causes.find( - cause => - cause?.type === 'label' && - cause.label.src !== currentAccount?.did && - cause.label.uri === post.uri, - ) const replyAuthorDid = useMemo(() => { if (!record?.reply) { diff --git a/src/view/screens/DebugMod.tsx b/src/view/screens/DebugMod.tsx index fbba7c73b6..5bff83a462 100644 --- a/src/view/screens/DebugMod.tsx +++ b/src/view/screens/DebugMod.tsx @@ -243,7 +243,9 @@ export const DebugModScreen = ({}: NativeStackScreenProps< ], }, labelDefs: { - 'did:plc:fake-labeler': [interpretLabelValueDefinition(customLabelDef, 'did:plc:fake-labeler')], + 'did:plc:fake-labeler': [ + interpretLabelValueDefinition(customLabelDef, 'did:plc:fake-labeler'), + ], }, } }, [label, visibility, noAdult, isLoggedOut, isTargetMe, did, customLabelDef]) @@ -703,7 +705,6 @@ function SmallToggler({ label, children, }: React.PropsWithChildren<{label: string}>) { - const t = useTheme() const [show, setShow] = React.useState(false) return (