From a71134f467449bc4c74967ca3958416feac6b91d Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Fri, 12 Jul 2024 11:42:27 +0900 Subject: [PATCH 1/3] `Reposted by you` and `Reply to you` (#4478) Co-authored-by: Hailey --- src/view/com/post/Post.tsx | 30 +++++++++------ src/view/com/posts/FeedItem.tsx | 67 +++++++++++++++++++++------------ 2 files changed, 62 insertions(+), 35 deletions(-) diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index 51a1381ec8..a05339d4dc 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -15,6 +15,7 @@ import {useQueryClient} from '@tanstack/react-query' import {moderatePost_wrapped as moderatePost} from '#/lib/moderatePost_wrapped' import {POST_TOMBSTONE, Shadow, usePostShadow} from '#/state/cache/post-shadow' import {useModerationOpts} from '#/state/preferences/moderation-opts' +import {useSession} from '#/state/session' import {useComposerControls} from '#/state/shell/composer' import {MAX_POST_LINES} from 'lib/constants' import {usePalette} from 'lib/hooks/usePalette' @@ -145,6 +146,9 @@ function PostInner({ precacheProfile(queryClient, post.author) }, [queryClient, post.author]) + const {currentAccount} = useSession() + const isMe = replyAuthorDid === currentAccount?.did + return ( - - Reply to{' '} - - - - + {isMe ? ( + Reply to you + ) : ( + + Reply to{' '} + + + + + )} )} diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx index cc767a4a3d..a59eeea52e 100644 --- a/src/view/com/posts/FeedItem.tsx +++ b/src/view/com/posts/FeedItem.tsx @@ -43,6 +43,7 @@ import {Text} from '../util/text/Text' import {PreviewableUserAvatar} from '../util/UserAvatar' import {AviFollowButton} from './AviFollowButton' import hairlineWidth = StyleSheet.hairlineWidth +import {useSession} from '#/state/session' import {Repost_Stroke2_Corner2_Rounded as Repost} from '#/components/icons/Repost' interface FeedItemProps { @@ -200,6 +201,11 @@ let FeedItemInner = ({ }, ] + const {currentAccount} = useSession() + const isOwner = + AppBskyFeedDefs.isReasonRepost(reason) && + reason.by.did === currentAccount?.did + return ( - - Reposted by{' '} - - - - + {isOwner ? ( + Reposted by you + ) : ( + + Reposted by{' '} + + + + + )} ) : null} @@ -421,6 +435,9 @@ function ReplyToLabel({ blocked?: boolean }) { const pal = usePalette('default') + const {currentAccount} = useSession() + const isMe = profile.did === currentAccount?.did + return ( - {blocked ? ( + {isMe ? ( + Reply to you + ) : blocked ? ( Reply to a blocked post ) : ( From cd9bba4b69d1b5eeebae15544bb2aaa55f42873f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82da?= Date: Fri, 12 Jul 2024 04:42:41 +0200 Subject: [PATCH 2/3] Fix: emoji picker closes when hitting spacebar (#4422) (#4441) Co-authored-by: Hailey --- .../text-input/web/EmojiPicker.web.tsx | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/view/com/composer/text-input/web/EmojiPicker.web.tsx b/src/view/com/composer/text-input/web/EmojiPicker.web.tsx index 1493621160..1f4178f7f8 100644 --- a/src/view/com/composer/text-input/web/EmojiPicker.web.tsx +++ b/src/view/com/composer/text-input/web/EmojiPicker.web.tsx @@ -1,11 +1,13 @@ import React from 'react' -import Picker from '@emoji-mart/react' import { - StyleSheet, + GestureResponderEvent, TouchableWithoutFeedback, useWindowDimensions, View, } from 'react-native' +import Picker from '@emoji-mart/react' + +import {atoms as a} from '#/alf' import {textInputWebEmitter} from '../TextInput.web' const HEIGHT_OFFSET = 40 @@ -96,12 +98,29 @@ export function EmojiPicker({state, close}: IProps) { if (!state.isOpen) return null + const onPressBackdrop = (e: GestureResponderEvent) => { + // @ts-ignore web only + if (e.nativeEvent?.pointerId === -1) return + close() + } + return ( - + {/* eslint-disable-next-line react-native-a11y/has-valid-accessibility-descriptors */} e.stopPropagation()}> @@ -118,20 +137,3 @@ export function EmojiPicker({state, close}: IProps) { ) } - -const styles = StyleSheet.create({ - mask: { - // @ts-ignore web ony - position: 'fixed', - top: 0, - left: 0, - right: 0, - width: '100%', - height: '100%', - alignItems: 'center', - }, - picker: { - marginHorizontal: 'auto', - paddingRight: 50, - }, -}) From f021c06468820773fafeb93d14deecff81e08a17 Mon Sep 17 00:00:00 2001 From: Hailey Date: Thu, 11 Jul 2024 19:51:54 -0700 Subject: [PATCH 3/3] Return a promise for `getReferrerInfoAsync` on web (#4777) --- modules/expo-bluesky-swiss-army/src/Referrer/index.web.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/expo-bluesky-swiss-army/src/Referrer/index.web.ts b/modules/expo-bluesky-swiss-army/src/Referrer/index.web.ts index 76f03e7c87..c092a67e73 100644 --- a/modules/expo-bluesky-swiss-army/src/Referrer/index.web.ts +++ b/modules/expo-bluesky-swiss-army/src/Referrer/index.web.ts @@ -7,7 +7,7 @@ export function getGooglePlayReferrerInfoAsync(): Promise { +export async function getReferrerInfoAsync(): Promise { if ( Platform.OS === 'web' && // for ssr @@ -29,6 +29,5 @@ export function getReferrerInfoAsync(): Promise { console.error('Failed to parse referrer URL') } } - return null }