From f3f3bfb335550598deee1ecb0a3c85619728406c Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Mon, 5 Dec 2022 10:18:38 -0600 Subject: [PATCH] Enlarge click targets for post controls and view header --- src/view/com/util/DropdownBtn.tsx | 8 +++++++- src/view/com/util/PostCtrls.tsx | 9 +++++++-- src/view/com/util/ViewHeader.tsx | 16 +++++++++++++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/view/com/util/DropdownBtn.tsx b/src/view/com/util/DropdownBtn.tsx index ea4e195038..98e2f3f2ba 100644 --- a/src/view/com/util/DropdownBtn.tsx +++ b/src/view/com/util/DropdownBtn.tsx @@ -18,6 +18,8 @@ import {useStores} from '../../../state' import {ConfirmModel} from '../../../state/models/shell-ui' import {TABS_ENABLED} from '../../../build-flags' +const HITSLOP = {left: 10, top: 10, right: 10, bottom: 10} + export interface DropdownItem { icon?: IconProp label: string @@ -61,7 +63,11 @@ export function DropdownBtn({ } return ( - + {children} ) diff --git a/src/view/com/util/PostCtrls.tsx b/src/view/com/util/PostCtrls.tsx index 10b54be3f0..f2a66d100c 100644 --- a/src/view/com/util/PostCtrls.tsx +++ b/src/view/com/util/PostCtrls.tsx @@ -25,6 +25,7 @@ interface PostCtrlsOpts { const redgray = '#7A6161' const sRedgray = {color: redgray} +const HITSLOP = {top: 10, left: 10, bottom: 10, right: 10} export function PostCtrls(opts: PostCtrlsOpts) { const interp1 = useSharedValue(0) @@ -59,7 +60,10 @@ export function PostCtrls(opts: PostCtrlsOpts) { return ( - + @@ -98,6 +103,7 @@ export function PostCtrls(opts: PostCtrlsOpts) { {opts.isUpvoted ? ( @@ -137,7 +143,6 @@ const styles = StyleSheet.create({ ctrl: { flexDirection: 'row', alignItems: 'center', - paddingRight: 4, }, ctrlIcon: { color: redgray, diff --git a/src/view/com/util/ViewHeader.tsx b/src/view/com/util/ViewHeader.tsx index 50b7e65326..5d0ec2995e 100644 --- a/src/view/com/util/ViewHeader.tsx +++ b/src/view/com/util/ViewHeader.tsx @@ -5,6 +5,9 @@ import {colors} from '../../lib/styles' import {MagnifyingGlassIcon} from '../../lib/icons' import {useStores} from '../../../state' +const HITSLOP = {left: 10, top: 10, right: 10, bottom: 10} +const BACK_HITSLOP = {left: 10, top: 10, right: 30, bottom: 10} + export function ViewHeader({ title, subtitle, @@ -27,11 +30,14 @@ export function ViewHeader({ return ( {store.nav.tab.canGoBack ? ( - + ) : undefined} - + {title} {subtitle ? ( @@ -39,11 +45,15 @@ export function ViewHeader({ ) : undefined} - +