Skip to content

Commit

Permalink
Fix Copy Icon Visibility
Browse files Browse the repository at this point in the history
Logic was hiding the right button if onPress
wasn't provided
  • Loading branch information
Jon-edge committed Jan 23, 2024
1 parent bb4a80d commit c8b47db
Show file tree
Hide file tree
Showing 3 changed files with 265 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ exports[`TransactionListRow should render with loading props 1`] = `
]
}
>
Synchronizing
Syncing...
</Text>
<Text
adjustsFontSizeToFit={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,71 @@ exports[`TransactionDetailsScene should render 1`] = `
this is the txid
</Text>
</View>
<View
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"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": "flex-end",
"height": "100%",
"justifyContent": "center",
"opacity": 1,
"position": "absolute",
"right": 0,
"width": "100%",
}
}
>
<Text
allowFontScaling={false}
style={
[
{
"color": undefined,
"fontSize": 22,
},
{
"color": "#00f1a2",
"marginLeft": 11,
"textAlign": "center",
},
{
"fontFamily": "FontAwesome",
"fontStyle": "normal",
"fontWeight": "normal",
},
{},
]
}
>
</Text>
</View>
</View>
</View>
</View>
Expand Down Expand Up @@ -1551,6 +1616,71 @@ exports[`TransactionDetailsScene should render 1`] = `
this is a signed tx
</Text>
</View>
<View
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"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": "flex-end",
"height": "100%",
"justifyContent": "center",
"opacity": 1,
"position": "absolute",
"right": 0,
"width": "100%",
}
}
>
<Text
allowFontScaling={false}
style={
[
{
"color": undefined,
"fontSize": 22,
},
{
"color": "#00f1a2",
"marginLeft": 11,
"textAlign": "center",
},
{
"fontFamily": "FontAwesome",
"fontStyle": "normal",
"fontWeight": "normal",
},
{},
]
}
>
</Text>
</View>
</View>
</View>
</View>
Expand Down Expand Up @@ -2675,6 +2805,71 @@ exports[`TransactionDetailsScene should render with negative nativeAmount and fi
this is the txid
</Text>
</View>
<View
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"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": "flex-end",
"height": "100%",
"justifyContent": "center",
"opacity": 1,
"position": "absolute",
"right": 0,
"width": "100%",
}
}
>
<Text
allowFontScaling={false}
style={
[
{
"color": undefined,
"fontSize": 22,
},
{
"color": "#00f1a2",
"marginLeft": 11,
"textAlign": "center",
},
{
"fontFamily": "FontAwesome",
"fontStyle": "normal",
"fontWeight": "normal",
},
{},
]
}
>
</Text>
</View>
</View>
</View>
</View>
Expand Down Expand Up @@ -3271,6 +3466,71 @@ exports[`TransactionDetailsScene should render with negative nativeAmount and fi
this is a signed tx
</Text>
</View>
<View
accessibilityState={
{
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"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": "flex-end",
"height": "100%",
"justifyContent": "center",
"opacity": 1,
"position": "absolute",
"right": 0,
"width": "100%",
}
}
>
<Text
allowFontScaling={false}
style={
[
{
"color": undefined,
"fontSize": 22,
},
{
"color": "#00f1a2",
"marginLeft": 11,
"textAlign": "center",
},
{
"fontFamily": "FontAwesome",
"fontStyle": "normal",
"fontWeight": "normal",
},
{},
]
}
>
</Text>
</View>
</View>
</View>
</View>
Expand Down
6 changes: 4 additions & 2 deletions src/components/ui4/RowUi4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const RowUi4 = (props: Props) => {
</View>
{
// If right action icon button is visible, only the icon dims on row tap
isTappable && rightButtonVisible ? (
rightButtonVisible ? (
<TouchableOpacity style={styles.tappableIconContainer} accessible={false} onPress={handlePress} onLongPress={handleLongPress} disabled={loading}>
{rightButtonType === 'touchable' ? <FontAwesome5 name="chevron-right" style={styles.tappableIcon} size={theme.rem(1)} /> : null}
{rightButtonType === 'editable' ? <FontAwesomeIcon name="edit" style={styles.tappableIcon} size={theme.rem(1)} /> : null}
Expand All @@ -111,7 +111,9 @@ export const RowUi4 = (props: Props) => {
</>
)

// The entire row dims on tap if not handled by the right action icon button
// The entire row dims on tap if not handled by the right action icon button.
// TODO: If a right button is specified, onPress/onLogPress is ignored! Refine
// API and possibly restructure JSX.
return isTappable && !rightButtonVisible ? (
<TouchableOpacity style={[styles.container, margin]} accessible={false} onPress={handlePress} onLongPress={handleLongPress} disabled={loading}>
{content}
Expand Down

0 comments on commit c8b47db

Please sign in to comment.