mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Tweak haptics, add to post controls (#5977)

* change timing to 10ms, make ios only

* add haptics to post controls

* rm from like button

authored by samuel.fm and committed by

GitHub d050a78a dcc5405e

+23 -11
+10 -5
src/view/com/post-thread/PostThreadComposePrompt.tsx
··· 5 5 6 6 import {PressableScale} from '#/lib/custom-animations/PressableScale' 7 7 import {useHaptics} from '#/lib/haptics' 8 + import {isIOS} from '#/platform/detection' 8 9 import {useProfileQuery} from '#/state/queries/profile' 9 10 import {useSession} from '#/state/session' 10 11 import {UserAvatar} from '#/view/com/util/UserAvatar' 11 - import {atoms as a, native, useBreakpoints, useTheme} from '#/alf' 12 + import {atoms as a, ios, useBreakpoints, useTheme} from '#/alf' 12 13 import {useInteractionState} from '#/components/hooks/useInteractionState' 13 14 import {Text} from '#/components/Typography' 14 15 ··· 41 42 t.atoms.border_contrast_low, 42 43 t.atoms.bg, 43 44 ]} 44 - onPressIn={() => playHaptic('Light')} 45 + onPressIn={ios(() => playHaptic('Light'))} 45 46 onPress={() => { 46 47 onPressCompose() 47 - setTimeout(() => playHaptic('Medium'), 200) 48 + if (isIOS) { 49 + setTimeout(() => playHaptic('Medium'), 10) 50 + } else { 51 + playHaptic('Light') 52 + } 48 53 }} 49 - onLongPress={native(() => { 54 + onLongPress={ios(() => { 50 55 onPressCompose() 51 - setTimeout(() => playHaptic('Heavy'), 200) 56 + playHaptic('Heavy') 52 57 })} 53 58 onHoverIn={onHoverIn} 54 59 onHoverOut={onHoverOut}>
+10 -6
src/view/com/util/fab/FABInner.tsx
··· 10 10 import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' 11 11 import {clamp} from '#/lib/numbers' 12 12 import {gradients} from '#/lib/styles' 13 - import {isWeb} from '#/platform/detection' 14 - import {native} from '#/alf' 13 + import {isIOS, isWeb} from '#/platform/detection' 14 + import {ios} from '#/alf' 15 15 16 16 export interface FABProps 17 17 extends ComponentProps<typeof TouchableWithoutFeedback> { ··· 41 41 ]}> 42 42 <PressableScale 43 43 testID={testID} 44 - onPressIn={() => playHaptic('Light')} 44 + onPressIn={ios(() => playHaptic('Light'))} 45 45 onPress={evt => { 46 46 onPress?.(evt) 47 - setTimeout(() => playHaptic('Medium'), 200) 47 + if (isIOS) { 48 + setTimeout(() => playHaptic('Medium'), 10) 49 + } else { 50 + playHaptic('Light') 51 + } 48 52 }} 49 - onLongPress={native((evt: any) => { 53 + onLongPress={ios((evt: any) => { 50 54 onPress?.(evt) 51 - setTimeout(() => playHaptic('Heavy'), 200) 55 + playHaptic('Heavy') 52 56 })} 53 57 targetScale={0.9} 54 58 {...props}>
+1
src/view/com/util/post-ctrls/PostCtrls.tsx
··· 250 250 style={btnStyle} 251 251 onPress={() => { 252 252 if (!post.viewer?.replyDisabled) { 253 + playHaptic('Light') 253 254 requireAuth(() => onPressReply()) 254 255 } 255 256 }}
+2
src/view/com/util/post-ctrls/RepostButton.tsx
··· 51 51 <Button 52 52 testID="repostBtn" 53 53 onPress={() => { 54 + playHaptic('Light') 54 55 requireAuth(() => dialogControl.open()) 55 56 }} 56 57 onLongPress={() => { 58 + playHaptic('Heavy') 57 59 requireAuth(() => onQuote()) 58 60 }} 59 61 style={[