Skip to content

Commit

Permalink
Merge pull request #5272 from EdgeApp/jon/smol-4.15
Browse files Browse the repository at this point in the history
Fix press handling on AddressTile2
  • Loading branch information
Jon-edge authored Sep 23, 2024
2 parents 468194f + d5a4111 commit 23a53eb
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 121 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- added: Buy conversion tracking for Moonpay
- added: Error tracking for failure to report conversions to referral server
- fixed: Clear previous swap errors when new amounts are entered or swap assets are changed in `SwapCreateScene`
- fixed: AddressTile2 touchable area states

## 4.14.0

Expand Down
162 changes: 45 additions & 117 deletions src/__tests__/scenes/__snapshots__/SendScene2.ui.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9855,46 +9855,22 @@ exports[`SendScene2 2 spendTargets lock tiles 1`] = `
}
/>
<View
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={false}
collapsable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
{
"alignItems": "center",
"alignSelf": "stretch",
"backgroundColor": "rgba(255, 255, 255, 0)",
"flexDirection": "row",
"flexShrink": 1,
"marginBottom": 11,
"marginLeft": 11,
"marginRight": 11,
"marginTop": 11,
"opacity": 1,
}
[
{
"alignItems": "center",
"alignSelf": "stretch",
"backgroundColor": "rgba(255, 255, 255, 0)",
"flexDirection": "row",
"flexShrink": 1,
},
{
"marginBottom": 11,
"marginLeft": 11,
"marginRight": 11,
"marginTop": 11,
},
]
}
>
<View
Expand Down Expand Up @@ -12873,46 +12849,22 @@ exports[`SendScene2 2 spendTargets lock tiles 3`] = `
}
/>
<View
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={false}
collapsable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
{
"alignItems": "center",
"alignSelf": "stretch",
"backgroundColor": "rgba(255, 255, 255, 0)",
"flexDirection": "row",
"flexShrink": 1,
"marginBottom": 11,
"marginLeft": 11,
"marginRight": 11,
"marginTop": 11,
"opacity": 1,
}
[
{
"alignItems": "center",
"alignSelf": "stretch",
"backgroundColor": "rgba(255, 255, 255, 0)",
"flexDirection": "row",
"flexShrink": 1,
},
{
"marginBottom": 11,
"marginLeft": 11,
"marginRight": 11,
"marginTop": 11,
},
]
}
>
<View
Expand Down Expand Up @@ -14203,46 +14155,22 @@ exports[`SendScene2 Render SendScene 1`] = `
}
>
<View
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": false,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
{
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={false}
collapsable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
{
"alignItems": "center",
"alignSelf": "stretch",
"backgroundColor": "rgba(255, 255, 255, 0)",
"flexDirection": "row",
"flexShrink": 1,
"marginBottom": 11,
"marginLeft": 11,
"marginRight": 11,
"marginTop": 11,
"opacity": 1,
}
[
{
"alignItems": "center",
"alignSelf": "stretch",
"backgroundColor": "rgba(255, 255, 255, 0)",
"flexDirection": "row",
"flexShrink": 1,
},
{
"marginBottom": 11,
"marginLeft": 11,
"marginRight": 11,
"marginTop": 11,
},
]
}
>
<View
Expand Down
6 changes: 2 additions & 4 deletions src/components/tiles/AddressTile2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,7 @@ export const AddressTile2 = React.forwardRef((props: Props, ref: React.Forwarded
})

const handleTilePress = useHandler(async () => {
if (!lockInputs && !!recipientAddress) {
resetSendTransaction()
}
resetSendTransaction()
})

// ---------------------------------------------------------------------------
Expand All @@ -266,7 +264,7 @@ export const AddressTile2 = React.forwardRef((props: Props, ref: React.Forwarded
const tileType = !!recipientAddress && !lockInputs ? 'delete' : 'none'

return (
<EdgeRow rightButtonType={tileType} loading={loading} title={title} onPress={handleTilePress}>
<EdgeRow rightButtonType={tileType} loading={loading} title={title} onPress={!lockInputs && !!recipientAddress ? handleTilePress : undefined}>
{!recipientAddress && (
<EdgeAnim style={styles.buttonsContainer} enter={{ type: 'stretchInY' }} exit={{ type: 'stretchOutY' }}>
<EdgeTouchableOpacity style={styles.buttonContainer} onPress={handleChangeAddress}>
Expand Down

0 comments on commit 23a53eb

Please sign in to comment.