diff options
Diffstat (limited to 'src/view/com')
-rw-r--r-- | src/view/com/post-thread/PostThreadItem.tsx | 5 | ||||
-rw-r--r-- | src/view/com/post/Post.tsx | 1 | ||||
-rw-r--r-- | src/view/com/posts/FeedItem.tsx | 1 | ||||
-rw-r--r-- | src/view/com/util/Link.tsx | 16 |
4 files changed, 18 insertions, 5 deletions
diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 088be6a90..8b556cea3 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -367,6 +367,7 @@ export const PostThreadItem = observer(function PostThreadItem({ pal.border, pal.view, item._showParentReplyLine && hasPrecedingItem && styles.noTopBorder, + styles.cursor, ]} moderation={item.moderation.content}> <PostSandboxWarning /> @@ -616,4 +617,8 @@ const styles = StyleSheet.create({ marginLeft: 'auto', marginRight: 'auto', }, + cursor: { + // @ts-ignore web only + cursor: 'pointer', + }, }) diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index 94dfe6e8b..661b3a899 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -304,6 +304,7 @@ const styles = StyleSheet.create({ paddingBottom: 5, paddingLeft: 10, borderTopWidth: 1, + cursor: 'pointer', }, layout: { flexDirection: 'row', diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx index e1212f32c..c46411f0f 100644 --- a/src/view/com/posts/FeedItem.tsx +++ b/src/view/com/posts/FeedItem.tsx @@ -343,6 +343,7 @@ const styles = StyleSheet.create({ borderTopWidth: 1, paddingLeft: 10, paddingRight: 15, + cursor: 'pointer', }, outerSmallTop: { borderTopWidth: 0, diff --git a/src/view/com/util/Link.tsx b/src/view/com/util/Link.tsx index ead85d0b5..321b6ab63 100644 --- a/src/view/com/util/Link.tsx +++ b/src/view/com/util/Link.tsx @@ -259,15 +259,21 @@ function onPressInner( e?: Event, ) { let shouldHandle = false + const isLeftClick = + // @ts-ignore Web only -prf + Platform.OS === 'web' && (e.button == null || e.button === 0) + // @ts-ignore Web only -prf + const isMiddleClick = Platform.OS === 'web' && e.button === 1 + const isMetaKey = + // @ts-ignore Web only -prf + Platform.OS === 'web' && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) + const newTab = isMetaKey || isMiddleClick if (Platform.OS !== 'web' || !e) { shouldHandle = e ? !e.defaultPrevented : true } else if ( !e.defaultPrevented && // onPress prevented default - // @ts-ignore Web only -prf - !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys - // @ts-ignore Web only -prf - (e.button == null || e.button === 0) && // ignore everything but left clicks + (isLeftClick || isMiddleClick) && // ignore everything but left and middle clicks // @ts-ignore Web only -prf [undefined, null, '', 'self'].includes(e.currentTarget?.target) // let browser handle "target=_blank" etc. ) { @@ -277,7 +283,7 @@ function onPressInner( if (shouldHandle) { href = convertBskyAppUrlIfNeeded(href) - if (href.startsWith('http') || href.startsWith('mailto')) { + if (newTab || href.startsWith('http') || href.startsWith('mailto')) { Linking.openURL(href) } else { store.shell.closeModal() // close any active modals |