Skip to content

Commit

Permalink
fix: android header pressability
Browse files Browse the repository at this point in the history
  • Loading branch information
msalcala11 committed Jan 14, 2025
1 parent eff68f7 commit 8bb0d1d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
20 changes: 20 additions & 0 deletions patches/@react-navigation+elements+1.3.21.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/node_modules/@react-navigation/elements/src/Header/HeaderBackButton.tsx b/node_modules/@react-navigation/elements/src/Header/HeaderBackButton.tsx
index 7c2a541..9f7478b 100644
--- a/node_modules/@react-navigation/elements/src/Header/HeaderBackButton.tsx
+++ b/node_modules/@react-navigation/elements/src/Header/HeaderBackButton.tsx
@@ -150,7 +150,14 @@ export default function HeaderBackButton({
accessibilityRole="button"
accessibilityLabel={accessibilityLabel}
testID={testID}
- onPress={disabled ? undefined : handlePress}
+ onPress={Platform.select({
+ android: undefined,
+ default: disabled ? undefined : handlePress,
+ })}
+ onPressOut={Platform.select({
+ android: disabled ? undefined : handlePress,
+ default: undefined,
+ })}
pressColor={pressColor}
pressOpacity={pressOpacity}
android_ripple={androidRipple}
2 changes: 1 addition & 1 deletion src/components/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Settings = ({onPress}: {onPress: () => void}) => {

return (
<HeaderRightContainer>
<SettingsSvgContainer activeOpacity={ActiveOpacity} onPress={onPress}>
<SettingsSvgContainer activeOpacity={ActiveOpacity} onPressOut={onPress}>
<SettingsSvg color={color} background={background} />
</SettingsSvgContainer>
</HeaderRightContainer>
Expand Down
3 changes: 1 addition & 2 deletions src/navigation/tabs/settings/components/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ const General = () => {
headerLeft: () => (
<HeaderRightContainer>
<CloseModalButtonContainer>
<CloseModalButton
onPress={() => navigation.goBack()}>
<CloseModalButton onPressOut={() => navigation.goBack()}>
<CloseIcon />
</CloseModalButton>
</CloseModalButtonContainer>
Expand Down
4 changes: 2 additions & 2 deletions src/navigation/wallet/screens/KeyOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
useTheme,
} from '@react-navigation/native';
import {FlashList} from '@shopify/flash-list';
import {LogBox, RefreshControl, TouchableOpacity} from 'react-native';
import {LogBox, Platform, RefreshControl, TouchableOpacity} from 'react-native';
import styled from 'styled-components/native';
import haptic from '../../../components/haptic-feedback/haptic';
import {
Expand Down Expand Up @@ -215,7 +215,7 @@ const KeyOverview = () => {
<KeyToggle
activeOpacity={ActiveOpacity}
disabled={!hasMultipleKeys && !linkedCoinbase}
onPress={() => setShowKeyDropdown(true)}>
onPressOut={() => setShowKeyDropdown(true)}>
{key.methods?.isPrivKeyEncrypted() ? (
theme.dark ? (
<EncryptPasswordDarkModeImg />
Expand Down

0 comments on commit 8bb0d1d

Please sign in to comment.