diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-09-15 14:01:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-15 14:01:44 -0700 |
commit | 763a50692f39074a2cc264df347bccd43bcd79a7 (patch) | |
tree | e1c9766e4be2a133dd5470d501d7a5783a165b7d /src | |
parent | e3de91788e7f19c232e1fb1154069ef7d060ec96 (diff) | |
download | voidsky-763a50692f39074a2cc264df347bccd43bcd79a7.tar.zst |
Readd hitslop to post controls (#1461)
* Readd hitslop to post controls * Bigger hitslop on bigger controls
Diffstat (limited to 'src')
-rw-r--r-- | src/view/com/util/post-ctrls/PostCtrls.tsx | 7 | ||||
-rw-r--r-- | src/view/com/util/post-ctrls/RepostButton.tsx | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/view/com/util/post-ctrls/PostCtrls.tsx b/src/view/com/util/post-ctrls/PostCtrls.tsx index c71100df0..5769a478b 100644 --- a/src/view/com/util/post-ctrls/PostCtrls.tsx +++ b/src/view/com/util/post-ctrls/PostCtrls.tsx @@ -15,6 +15,7 @@ import {useTheme} from 'lib/ThemeContext' import {useStores} from 'state/index' import {RepostButton} from './RepostButton' import {Haptics} from 'lib/haptics' +import {HITSLOP_10, HITSLOP_20} from 'lib/constants' interface PostCtrlsOpts { itemUri: string @@ -106,7 +107,8 @@ export function PostCtrls(opts: PostCtrlsOpts) { accessibilityLabel={`Reply (${opts.replyCount} ${ opts.replyCount === 1 ? 'reply' : 'replies' })`} - accessibilityHint="reply composer"> + accessibilityHint="" + hitSlop={opts.big ? HITSLOP_20 : HITSLOP_10}> <CommentBottomArrow style={[defaultCtrlColor, opts.big ? s.mt2 : styles.mt1]} strokeWidth={3} @@ -127,7 +129,8 @@ export function PostCtrls(opts: PostCtrlsOpts) { accessibilityLabel={`${opts.isLiked ? 'Unlike' : 'Like'} (${ opts.likeCount } ${pluralize(opts.likeCount || 0, 'like')})`} - accessibilityHint=""> + accessibilityHint="" + hitSlop={opts.big ? HITSLOP_20 : HITSLOP_10}> {opts.isLiked ? ( <HeartIconSolid style={styles.ctrlIconLiked} diff --git a/src/view/com/util/post-ctrls/RepostButton.tsx b/src/view/com/util/post-ctrls/RepostButton.tsx index 374d06515..9c4ed8e5d 100644 --- a/src/view/com/util/post-ctrls/RepostButton.tsx +++ b/src/view/com/util/post-ctrls/RepostButton.tsx @@ -6,6 +6,7 @@ import {useTheme} from 'lib/ThemeContext' import {Text} from '../text/Text' import {pluralize} from 'lib/strings/helpers' import {useStores} from 'state/index' +import {HITSLOP_10, HITSLOP_20} from 'lib/constants' interface Props { isReposted: boolean @@ -50,7 +51,8 @@ export const RepostButton = ({ accessibilityLabel={`${ isReposted ? 'Undo repost' : 'Repost' } (${repostCount} ${pluralize(repostCount || 0, 'repost')})`} - accessibilityHint=""> + accessibilityHint="" + hitSlop={big ? HITSLOP_20 : HITSLOP_10}> <RepostIcon style={ isReposted |