diff options
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/com/composer/Composer.tsx | 5 | ||||
-rw-r--r-- | src/view/com/composer/text-input/TextInput.tsx | 9 | ||||
-rw-r--r-- | src/view/com/util/UserAvatar.tsx | 6 | ||||
-rw-r--r-- | src/view/screens/Feeds.tsx | 4 | ||||
-rw-r--r-- | src/view/screens/SavedFeeds.tsx | 2 |
5 files changed, 18 insertions, 8 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 492b9074f..71714fdde 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -699,6 +699,7 @@ export const ComposePost = ({ dispatch={composerDispatch} textInput={post.id === activePost.id ? textInput : null} isFirstPost={index === 0} + isLastPost={index === thread.posts.length - 1} isPartOfThread={thread.posts.length > 1} isReply={index > 0 || !!replyTo} isActive={post.id === activePost.id} @@ -738,6 +739,7 @@ let ComposerPost = React.memo(function ComposerPost({ isActive, isReply, isFirstPost, + isLastPost, isPartOfThread, canRemovePost, canRemoveQuote, @@ -752,6 +754,7 @@ let ComposerPost = React.memo(function ComposerPost({ isActive: boolean isReply: boolean isFirstPost: boolean + isLastPost: boolean isPartOfThread: boolean canRemovePost: boolean canRemoveQuote: boolean @@ -830,6 +833,8 @@ let ComposerPost = React.memo(function ComposerPost({ <View style={[ a.mx_lg, + a.mb_sm, + !isActive && isLastPost && a.mb_lg, !isActive && styles.inactivePost, isTextOnly && isNative && a.flex_grow, ]}> diff --git a/src/view/com/composer/text-input/TextInput.tsx b/src/view/com/composer/text-input/TextInput.tsx index e9c5d86b9..ea92d0b91 100644 --- a/src/view/com/composer/text-input/TextInput.tsx +++ b/src/view/com/composer/text-input/TextInput.tsx @@ -96,10 +96,11 @@ export const TextInput = forwardRef(function TextInputImpl( newRt.detectFacetsWithoutResolution() setRichText(newRt) - const prefix = getMentionAt( - newText, - textInputSelection.current?.start || 0, - ) + // NOTE: BinaryFiddler + // onChangeText happens before onSelectionChange, cursorPos is out of bound if the user deletes characters, + const cursorPos = textInputSelection.current?.start ?? 0 + const prefix = getMentionAt(newText, Math.min(cursorPos, newText.length)) + if (prefix) { setAutocompletePrefix(prefix.value) } else if (autocompletePrefix) { diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx index 97cd831b3..e83921b0b 100644 --- a/src/view/com/util/UserAvatar.tsx +++ b/src/view/com/util/UserAvatar.tsx @@ -70,6 +70,7 @@ interface UserAvatarProps extends BaseUserAvatarProps { type: UserAvatarType moderation?: ModerationUI usePlainRNImage?: boolean + noBorder?: boolean onLoad?: () => void style?: StyleProp<ViewStyle> } @@ -219,6 +220,7 @@ let UserAvatar = ({ style, live, hideLiveBadge, + noBorder, }: UserAvatarProps): React.ReactNode => { const t = useTheme() const finalShape = overrideShape ?? (type === 'user' ? 'circle' : 'square') @@ -309,7 +311,7 @@ let UserAvatar = ({ onLoad={onLoad} /> )} - <MediaInsetBorder style={borderStyle} /> + {!noBorder && <MediaInsetBorder style={borderStyle} />} {live && size > 16 && !hideLiveBadge && ( <LiveIndicator size={size > 32 ? 'small' : 'tiny'} /> )} @@ -318,7 +320,7 @@ let UserAvatar = ({ ) : ( <View style={containerStyle}> <DefaultAvatar type={type} shape={finalShape} size={size} /> - <MediaInsetBorder style={borderStyle} /> + {!noBorder && <MediaInsetBorder style={borderStyle} />} {live && size > 16 && !hideLiveBadge && ( <LiveIndicator size={size > 32 ? 'small' : 'tiny'} /> )} diff --git a/src/view/screens/Feeds.tsx b/src/view/screens/Feeds.tsx index ca0280116..1042ac7a1 100644 --- a/src/view/screens/Feeds.tsx +++ b/src/view/screens/Feeds.tsx @@ -599,7 +599,9 @@ function FollowingFeed() { fill={t.palette.white} /> </View> - <FeedCard.TitleAndByline title={_(msg`Following`)} /> + <FeedCard.TitleAndByline + title={_(msg({message: 'Following', context: 'feed-name'}))} + /> </FeedCard.Header> </View> ) diff --git a/src/view/screens/SavedFeeds.tsx b/src/view/screens/SavedFeeds.tsx index b244c7558..0e85bdf73 100644 --- a/src/view/screens/SavedFeeds.tsx +++ b/src/view/screens/SavedFeeds.tsx @@ -417,7 +417,7 @@ function FollowingFeedCard() { </View> <View style={[a.flex_1, a.flex_row, a.gap_sm, a.align_center]}> <NewText style={[a.text_sm, a.font_bold, a.leading_snug]}> - <Trans>Following</Trans> + <Trans context="feed-name">Following</Trans> </NewText> </View> </View> |