diff options
Diffstat (limited to 'src/view/com')
-rw-r--r-- | src/view/com/composer/Composer.tsx | 32 | ||||
-rw-r--r-- | src/view/com/composer/photos/Gallery.tsx | 20 | ||||
-rw-r--r-- | src/view/com/composer/state/composer.ts | 37 | ||||
-rw-r--r-- | src/view/com/composer/text-input/web/Autocomplete.tsx | 4 | ||||
-rw-r--r-- | src/view/com/lightbox/Lightbox.web.tsx | 12 | ||||
-rw-r--r-- | src/view/com/post-thread/PostThreadItem.tsx | 4 | ||||
-rw-r--r-- | src/view/com/posts/PostFeed.tsx | 11 | ||||
-rw-r--r-- | src/view/com/posts/PostFeedErrorMessage.tsx | 12 | ||||
-rw-r--r-- | src/view/com/profile/ProfileMenu.tsx | 12 | ||||
-rw-r--r-- | src/view/com/util/List.web.tsx | 11 |
10 files changed, 84 insertions, 71 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index de060c6c2..cc2859be9 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -518,8 +518,8 @@ export const ComposePost = ({ thread.posts.length > 1 ? _(msg`Your posts have been published`) : replyTo - ? _(msg`Your reply has been published`) - : _(msg`Your post has been published`), + ? _(msg`Your reply has been published`) + : _(msg`Your post has been published`), ) }, [ _, @@ -1000,20 +1000,20 @@ function ComposerTopBar({ }), ) : isThread - ? _( - msg({ - message: 'Publish posts', - comment: - 'Accessibility label for button to publish multiple posts in a thread', - }), - ) - : _( - msg({ - message: 'Publish post', - comment: - 'Accessibility label for button to publish a single post', - }), - ) + ? _( + msg({ + message: 'Publish posts', + comment: + 'Accessibility label for button to publish multiple posts in a thread', + }), + ) + : _( + msg({ + message: 'Publish post', + comment: + 'Accessibility label for button to publish a single post', + }), + ) } variant="solid" color="primary" diff --git a/src/view/com/composer/photos/Gallery.tsx b/src/view/com/composer/photos/Gallery.tsx index bc18c81f1..c44461b60 100644 --- a/src/view/com/composer/photos/Gallery.tsx +++ b/src/view/com/composer/photos/Gallery.tsx @@ -1,12 +1,12 @@ import React from 'react' import { - ImageStyle, + type ImageStyle, Keyboard, - LayoutChangeEvent, + type LayoutChangeEvent, StyleSheet, TouchableOpacity, View, - ViewStyle, + type ViewStyle, } from 'react-native' import {Image} from 'expo-image' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' @@ -14,14 +14,14 @@ import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' -import {Dimensions} from '#/lib/media/types' +import {type Dimensions} from '#/lib/media/types' import {colors, s} from '#/lib/styles' import {isNative} from '#/platform/detection' -import {ComposerImage, cropImage} from '#/state/gallery' +import {type ComposerImage, cropImage} from '#/state/gallery' import {Text} from '#/view/com/util/text/Text' import {useTheme} from '#/alf' import * as Dialog from '#/components/Dialog' -import {PostAction} from '../state/composer' +import {type PostAction} from '../state/composer' import {EditImageDialog} from './EditImageDialog' import {ImageAltTextDialog} from './ImageAltTextDialog' @@ -74,8 +74,8 @@ const GalleryInner = ({images, containerInfo, dispatch}: GalleryInnerProps) => { altTextControlStyle: isOverflow ? {left: 4, bottom: 4} : !isMobile && images.length < 3 - ? {left: 8, top: 8} - : {left: 4, top: 4}, + ? {left: 8, top: 8} + : {left: 4, top: 4}, imageControlsStyle: { display: 'flex' as const, flexDirection: 'row' as const, @@ -83,8 +83,8 @@ const GalleryInner = ({images, containerInfo, dispatch}: GalleryInnerProps) => { ...(isOverflow ? {top: 4, right: 4, gap: 4} : !isMobile && images.length < 3 - ? {top: 8, right: 8, gap: 8} - : {top: 4, right: 4, gap: 4}), + ? {top: 8, right: 8, gap: 8} + : {top: 4, right: 4, gap: 4}), zIndex: 1, }, imageStyle: { diff --git a/src/view/com/composer/state/composer.ts b/src/view/com/composer/state/composer.ts index f5a55f175..c673f2134 100644 --- a/src/view/com/composer/state/composer.ts +++ b/src/view/com/composer/state/composer.ts @@ -1,13 +1,13 @@ -import {ImagePickerAsset} from 'expo-image-picker' +import {type ImagePickerAsset} from 'expo-image-picker' import { - AppBskyFeedPostgate, + type AppBskyFeedPostgate, AppBskyRichtextFacet, - BskyPreferences, + type BskyPreferences, RichText, } from '@atproto/api' import {nanoid} from 'nanoid/non-secure' -import {SelfLabel} from '#/lib/moderation' +import {type SelfLabel} from '#/lib/moderation' import {insertMentionAt} from '#/lib/strings/mention-manip' import {shortenLinks} from '#/lib/strings/rich-text-manip' import { @@ -15,17 +15,22 @@ import { postUriToRelativePath, toBskyAppUrl, } from '#/lib/strings/url-helpers' -import {ComposerImage, createInitialImages} from '#/state/gallery' +import {type ComposerImage, createInitialImages} from '#/state/gallery' import {createPostgateRecord} from '#/state/queries/postgate/util' -import {Gif} from '#/state/queries/tenor' +import {type Gif} from '#/state/queries/tenor' import {threadgateRecordToAllowUISetting} from '#/state/queries/threadgate' -import {ThreadgateAllowUISetting} from '#/state/queries/threadgate' -import {ComposerOpts} from '#/state/shell/composer' +import {type ThreadgateAllowUISetting} from '#/state/queries/threadgate' +import {type ComposerOpts} from '#/state/shell/composer' import { - LinkFacetMatch, + type LinkFacetMatch, suggestLinkCardUri, } from '#/view/com/composer/text-input/text-input-util' -import {createVideoState, VideoAction, videoReducer, VideoState} from './video' +import { + createVideoState, + type VideoAction, + videoReducer, + type VideoState, +} from './video' type ImagesMedia = { type: 'images' @@ -514,12 +519,12 @@ export function createComposerState({ text: initText ? initText : initMention - ? insertMentionAt( - `@${initMention}`, - initMention.length + 1, - `${initMention}`, - ) - : '', + ? insertMentionAt( + `@${initMention}`, + initMention.length + 1, + `${initMention}`, + ) + : '', }) let link: Link | undefined diff --git a/src/view/com/composer/text-input/web/Autocomplete.tsx b/src/view/com/composer/text-input/web/Autocomplete.tsx index 62f19c63d..94ecb53cc 100644 --- a/src/view/com/composer/text-input/web/Autocomplete.tsx +++ b/src/view/com/composer/text-input/web/Autocomplete.tsx @@ -209,8 +209,8 @@ function AutocompleteProfileCard({ itemIndex === 0 ? styles.firstMention : itemIndex === totalItems - 1 - ? styles.lastMention - : undefined, + ? styles.lastMention + : undefined, ]} onPress={onPress} accessibilityRole="button"> diff --git a/src/view/com/lightbox/Lightbox.web.tsx b/src/view/com/lightbox/Lightbox.web.tsx index f6b6223ce..97811da7f 100644 --- a/src/view/com/lightbox/Lightbox.web.tsx +++ b/src/view/com/lightbox/Lightbox.web.tsx @@ -1,17 +1,17 @@ import React, {useCallback, useEffect, useState} from 'react' import { Image, - ImageStyle, + type ImageStyle, Pressable, StyleSheet, TouchableOpacity, TouchableWithoutFeedback, View, - ViewStyle, + type ViewStyle, } from 'react-native' import { FontAwesomeIcon, - FontAwesomeIconStyle, + type FontAwesomeIconStyle, } from '@fortawesome/react-native-fontawesome' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -21,7 +21,7 @@ import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {colors, s} from '#/lib/styles' import {useLightbox, useLightboxControls} from '#/state/lightbox' import {Text} from '../util/text/Text' -import {ImageSource} from './ImageViewing/@types' +import {type ImageSource} from './ImageViewing/@types' import ImageDefaultHeader from './ImageViewing/components/ImageDefaultHeader' export function Lightbox() { @@ -121,8 +121,8 @@ function LightboxInner({ img.type === 'circle-avi' ? '50%' : img.type === 'rect-avi' - ? '10%' - : 0, + ? '10%' + : 0, } as ImageStyle } alt={img.alt} diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 592224ff5..54eea0493 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -630,8 +630,8 @@ let PostThreadItemLoaded = ({ showChildReplyLine && !isThreadedChild ? 0 : isThreadedChildAdjacentBot - ? 4 - : 8, + ? 4 + : 8, }, ]}> {/* If we are in threaded mode, the avatar is rendered in PostMeta */} diff --git a/src/view/com/posts/PostFeed.tsx b/src/view/com/posts/PostFeed.tsx index cbbe4a00f..1d0649b2e 100644 --- a/src/view/com/posts/PostFeed.tsx +++ b/src/view/com/posts/PostFeed.tsx @@ -132,12 +132,11 @@ type FeedRow = key: string } -export function getItemsForFeedback(feedRow: FeedRow): - | { - item: FeedPostSliceItem - feedContext: string | undefined - reqId: string | undefined - }[] { +export function getItemsForFeedback(feedRow: FeedRow): { + item: FeedPostSliceItem + feedContext: string | undefined + reqId: string | undefined +}[] { if (feedRow.type === 'sliceItem') { return feedRow.slice.items.map(item => ({ item, diff --git a/src/view/com/posts/PostFeedErrorMessage.tsx b/src/view/com/posts/PostFeedErrorMessage.tsx index 39347b89c..808ef9fff 100644 --- a/src/view/com/posts/PostFeedErrorMessage.tsx +++ b/src/view/com/posts/PostFeedErrorMessage.tsx @@ -1,15 +1,19 @@ import React from 'react' import {View} from 'react-native' -import {AppBskyActorDefs, AppBskyFeedGetAuthorFeed, AtUri} from '@atproto/api' +import { + type AppBskyActorDefs, + AppBskyFeedGetAuthorFeed, + AtUri, +} from '@atproto/api' import {msg as msgLingui, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useNavigation} from '@react-navigation/native' import {usePalette} from '#/lib/hooks/usePalette' -import {NavigationProp} from '#/lib/routes/types' +import {type NavigationProp} from '#/lib/routes/types' import {cleanError} from '#/lib/strings/errors' import {logger} from '#/logger' -import {FeedDescriptor} from '#/state/queries/post-feed' +import {type FeedDescriptor} from '#/state/queries/post-feed' import {useRemoveFeedMutation} from '#/state/queries/preferences' import * as Prompt from '#/components/Prompt' import {EmptyState} from '../util/EmptyState' @@ -119,7 +123,7 @@ function FeedgenErrorMessage({ [KnownError.FeedTooManyRequests]: _l( msgLingui`This feed is currently receiving high traffic and is temporarily unavailable. Please try again later.`, ), - }[knownError]), + })[knownError], [_l, knownError], ) const [_, uri] = feedDesc.split('|') diff --git a/src/view/com/profile/ProfileMenu.tsx b/src/view/com/profile/ProfileMenu.tsx index d18ba12c1..879bf22f9 100644 --- a/src/view/com/profile/ProfileMenu.tsx +++ b/src/view/com/profile/ProfileMenu.tsx @@ -461,12 +461,12 @@ let ProfileMenu = ({ msg`The account will be able to interact with you after unblocking.`, ) : profile.associated?.labeler - ? _( - msg`Blocking will not prevent labels from being applied on your account, but it will stop this account from replying in your threads or interacting with you.`, - ) - : _( - msg`Blocked accounts cannot reply in your threads, mention you, or otherwise interact with you.`, - ) + ? _( + msg`Blocking will not prevent labels from being applied on your account, but it will stop this account from replying in your threads or interacting with you.`, + ) + : _( + msg`Blocked accounts cannot reply in your threads, mention you, or otherwise interact with you.`, + ) } onConfirm={blockAccount} confirmButtonCta={ diff --git a/src/view/com/util/List.web.tsx b/src/view/com/util/List.web.tsx index 18f7d6fa7..55dafb3dd 100644 --- a/src/view/com/util/List.web.tsx +++ b/src/view/com/util/List.web.tsx @@ -1,6 +1,11 @@ import React, {isValidElement, memo, startTransition, useRef} from 'react' -import {FlatListProps, StyleSheet, View, ViewProps} from 'react-native' -import {ReanimatedScrollEvent} from 'react-native-reanimated/lib/typescript/hook/commonTypes' +import { + type FlatListProps, + StyleSheet, + View, + type ViewProps, +} from 'react-native' +import {type ReanimatedScrollEvent} from 'react-native-reanimated/lib/typescript/hook/commonTypes' import {batchedUpdates} from '#/lib/batchedUpdates' import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback' @@ -205,7 +210,7 @@ function ListImpl<ItemT>( behavior: animated ? 'smooth' : 'instant', }) }, - } as any), // TODO: Better types. + }) as any, // TODO: Better types. [getScrollableNode], ) |