-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description - Adds a new `CloseButton.tsx` to match hitSlop and ripple used in the Tab Navigator buttons. The ripple seen in the Android screenshots is the touchable area. - Adjusts the existing `headerWithCloseButton` to use the new `CloseButton.tsx`. | Android Before w/ ripple | Android After w/ripple | iOS Before | iOS After | | ---- | ---- | ---- | ---- | | ![](https://github.com/valora-inc/wallet/assets/26950305/b3938275-6c81-43e0-b82e-5e2f9d44e55a) | ![](https://github.com/valora-inc/wallet/assets/26950305/db0a0f9c-cfaa-4436-b3ee-979856af6fb8) | ![](https://github.com/valora-inc/wallet/assets/26950305/d933eb18-4bd1-4044-8cd8-5d77dc3951ef) | ![](https://github.com/valora-inc/wallet/assets/26950305/3ea6b906-04d7-4fde-9ec1-08c921a09602) | ### Test plan - Tested locally on iOS - Tested locally on Android ### Related issues N/A ### Backwards compatibility Yes ### Network scalability N/A
- Loading branch information
Showing
2 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react' | ||
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native' | ||
import Touchable from 'src/components/Touchable' | ||
import Times from 'src/icons/Times' | ||
import { navigateBack } from 'src/navigator/NavigationService' | ||
import { Spacing } from 'src/styles/styles' | ||
|
||
interface Props { | ||
style?: StyleProp<ViewStyle> | ||
size?: number | ||
testID?: string | ||
} | ||
|
||
export default function CloseButton({ style, size, testID }: Props) { | ||
const onPress = () => { | ||
navigateBack() | ||
} | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<Touchable | ||
testID={testID} | ||
onPress={onPress} | ||
style={[style, styles.button]} | ||
borderRadius={Spacing.Thick24} | ||
> | ||
<Times height={size} /> | ||
</Touchable> | ||
</View> | ||
) | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}, | ||
button: { | ||
padding: Spacing.Small12, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters