Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions app/components/Nav/Main/MainNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ import RewardsClaimBottomSheetModal from '../../UI/Rewards/components/Tabs/Level
import RewardOptInAccountGroupModal from '../../UI/Rewards/components/Settings/RewardOptInAccountGroupModal';
import ReferralBottomSheetModal from '../../UI/Rewards/components/ReferralBottomSheetModal';
import { selectRewardsSubscriptionId } from '../../../selectors/rewards';
import { getImportTokenNavbarOptions } from '../../UI/Navbar';
import getHeaderCenterNavbarOptions from '../../../component-library/components-temp/HeaderCenter/getHeaderCenterNavbarOptions';
import {
TOKEN_TITLE,
NFT_TITLE,
Expand Down Expand Up @@ -1006,12 +1006,13 @@ const MainNavigator = () => {
name="AddAsset"
component={AddAsset}
options={({ route, navigation }) => ({
...getImportTokenNavbarOptions(
navigation,
strings(
...getHeaderCenterNavbarOptions({
title: strings(
`add_asset.${route.params?.assetType === TOKEN ? TOKEN_TITLE : NFT_TITLE}`,
),
),
onBack: () => navigation.goBack(),
includesTopInset: true,
}),
headerShown: true,
})}
/>
Expand Down
185 changes: 93 additions & 92 deletions app/components/UI/ActionView/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -77,101 +77,102 @@ exports[`ActionView should render correctly 1`] = `
Confirm
</Text>
</View>
<View
</View>
</RCTScrollView>
<View
style={
[
{
"flexDirection": "row",
"gap": 16,
"paddingBottom": 16,
"paddingHorizontal": 16,
"paddingTop": 24,
"width": "100%",
},
undefined,
]
}
>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
disabled={false}
onPressIn={[Function]}
onPressOut={[Function]}
style={
{
"alignItems": "center",
"alignSelf": "flex-start",
"backgroundColor": "#3c4d9d0f",
"borderColor": "transparent",
"borderRadius": 12,
"borderWidth": 1,
"flex": 1,
"flexDirection": "row",
"height": 48,
"justifyContent": "center",
"overflow": "hidden",
"paddingHorizontal": 16,
}
}
testID=""
>
<Text
accessibilityRole="text"
style={
[
{
"flexDirection": "row",
"gap": 16,
"paddingHorizontal": 16,
"paddingVertical": 16,
"width": "100%",
},
undefined,
]
{
"color": "#121314",
"fontFamily": "Geist-Medium",
"fontSize": 16,
"letterSpacing": 0,
"lineHeight": 24,
}
}
>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
disabled={false}
onPressIn={[Function]}
onPressOut={[Function]}
style={
{
"alignItems": "center",
"alignSelf": "flex-start",
"backgroundColor": "#3c4d9d0f",
"borderColor": "transparent",
"borderRadius": 12,
"borderWidth": 1,
"flex": 1,
"flexDirection": "row",
"height": 48,
"justifyContent": "center",
"overflow": "hidden",
"paddingHorizontal": 16,
}
}
testID=""
>
<Text
accessibilityRole="text"
style={
{
"color": "#121314",
"fontFamily": "Geist-Medium",
"fontSize": 16,
"letterSpacing": 0,
"lineHeight": 24,
}
}
>
Cancel
</Text>
</TouchableOpacity>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
disabled={false}
loading={false}
onPressIn={[Function]}
onPressOut={[Function]}
style={
{
"alignItems": "center",
"alignSelf": "flex-start",
"backgroundColor": "#121314",
"borderRadius": 12,
"flex": 1,
"flexDirection": "row",
"height": 48,
"justifyContent": "center",
"overflow": "hidden",
"paddingHorizontal": 16,
}
Cancel
</Text>
</TouchableOpacity>
<TouchableOpacity
accessibilityRole="button"
accessible={true}
activeOpacity={1}
disabled={false}
loading={false}
onPressIn={[Function]}
onPressOut={[Function]}
style={
{
"alignItems": "center",
"alignSelf": "flex-start",
"backgroundColor": "#121314",
"borderRadius": 12,
"flex": 1,
"flexDirection": "row",
"height": 48,
"justifyContent": "center",
"overflow": "hidden",
"paddingHorizontal": 16,
}
}
testID=""
>
<Text
accessibilityRole="text"
style={
{
"color": "#ffffff",
"fontFamily": "Geist-Medium",
"fontSize": 16,
"letterSpacing": 0,
"lineHeight": 24,
}
testID=""
>
<Text
accessibilityRole="text"
style={
{
"color": "#ffffff",
"fontFamily": "Geist-Medium",
"fontSize": 16,
"letterSpacing": 0,
"lineHeight": 24,
}
}
>
Confirm
</Text>
</TouchableOpacity>
</View>
</View>
</RCTScrollView>
}
>
Confirm
</Text>
</TouchableOpacity>
</View>
</View>
`;
66 changes: 34 additions & 32 deletions app/components/UI/ActionView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
StyleSheet,
View,
TouchableWithoutFeedback,
Platform,
} from 'react-native';
import { baseStyles } from '../../../styles/common';
import { strings } from '../../../../locales/i18n';
Expand All @@ -25,7 +26,8 @@ const getStyles = (colors) =>
StyleSheet.create({
actionContainer: {
flexDirection: 'row',
paddingVertical: 16,
paddingTop: 24,
paddingBottom: Platform.OS === 'android' ? 0 : 16,
paddingHorizontal: 16,
gap: 16,
width: '100%',
Expand Down Expand Up @@ -98,38 +100,38 @@ export default function ActionView({
>
{children}
</TouchableWithoutFeedback>

<View style={[styles.actionContainer, buttonContainerStyle]}>
{showCancelButton && (
<Button
onPress={onCancelPress}
variant={ButtonVariants.Secondary}
size={ButtonSize.Lg}
label={cancelText}
testID={cancelTestID}
style={styles.button}
isDisabled={confirmed}
/>
)}
{showConfirmButton && (
<Button
onPress={onConfirmPress}
variant={ButtonVariants.Primary}
size={ButtonSize.Lg}
label={confirmText}
testID={confirmTestID}
style={[
styles.button,
confirmButtonState === ConfirmButtonState.Warning &&
styles.confirmButtonWarning,
]}
isDisabled={confirmed || confirmDisabled || loading}
loading={confirmed || loading}
isDanger={confirmButtonState === ConfirmButtonState.Error}
/>
)}
</View>
</KeyboardAwareScrollView>

<View style={[styles.actionContainer, buttonContainerStyle]}>
{showCancelButton && (
<Button
onPress={onCancelPress}
variant={ButtonVariants.Secondary}
size={ButtonSize.Lg}
label={cancelText}
testID={cancelTestID}
style={styles.button}
isDisabled={confirmed}
/>
)}
{showConfirmButton && (
<Button
onPress={onConfirmPress}
variant={ButtonVariants.Primary}
size={ButtonSize.Lg}
label={confirmText}
testID={confirmTestID}
style={[
styles.button,
confirmButtonState === ConfirmButtonState.Warning &&
styles.confirmButtonWarning,
]}
isDisabled={confirmed || confirmDisabled || loading}
loading={confirmed || loading}
isDanger={confirmButtonState === ConfirmButtonState.Error}
/>
)}
</View>
</View>
);
}
Expand Down
Loading
Loading