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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -499,26 +499,26 @@ exports[`BridgeDestTokenSelector renders with initial state and displays tokens
{
"alignItems": "center",
"borderRadius": 8,
"height": 28,
"height": 32,
"justifyContent": "center",
"opacity": 1,
"width": 28,
"width": 32,
}
}
testID="bridge-token-selector-close-button"
>
<SvgMock
color="#121314"
fill="currentColor"
height={20}
height={24}
name="Close"
style={
{
"height": 20,
"width": 20,
"height": 24,
"width": 24,
}
}
width={20}
width={24}
/>
</TouchableOpacity>
</View>
Expand Down
80 changes: 20 additions & 60 deletions app/components/UI/Bridge/components/BridgeNetworkSelectorBase.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
import React from 'react';
import { StyleSheet, TouchableOpacity, ScrollView } from 'react-native';
import { Box } from '../../Box/Box';
import { ScrollView, StyleSheet } from 'react-native';
import Text, {
TextVariant,
} from '../../../../component-library/components/Texts/Text';
import { useStyles } from '../../../../component-library/hooks';
import { Theme } from '../../../../util/theme/models';
import BottomSheetHeader from '../../../../component-library/components/BottomSheets/BottomSheetHeader';
import BottomSheet from '../../../../component-library/components/BottomSheets/BottomSheet';
import Icon, {
IconName,
} from '../../../../component-library/components/Icons/Icon';
import { IconSize } from '../../../../component-library/components/Icons/Icon/Icon.types';
import { strings } from '../../../../../locales/i18n';
import { FlexDirection, AlignItems, JustifyContent } from '../../Box/box.types';
import { ButtonIconSizes } from '../../../../component-library/components/Buttons/ButtonIcon';
import { useNavigation } from '@react-navigation/native';

const createStyles = (params: { theme: Theme }) => {
const { theme } = params;
return StyleSheet.create({
content: {
flex: 1,
backgroundColor: theme.colors.background.default,
},
headerTitle: {
flex: 1,
textAlign: 'center',
},
closeButton: {
position: 'absolute',
right: 0,
},
closeIconBox: {
padding: 8,
},
});
};
const styles = StyleSheet.create({
headerTitle: {
flex: 1,
textAlign: 'center',
},
});

interface BridgeNetworkSelectorBaseProps {
children: React.ReactNode;
Expand All @@ -44,42 +23,23 @@ interface BridgeNetworkSelectorBaseProps {
export const BridgeNetworkSelectorBase: React.FC<
BridgeNetworkSelectorBaseProps
> = ({ children }) => {
const { styles, theme } = useStyles(createStyles, {});
const navigation = useNavigation();

return (
<BottomSheet isFullscreen>
<Box style={styles.content}>
<Box gap={4}>
<BottomSheetHeader>
<Box
flexDirection={FlexDirection.Row}
alignItems={AlignItems.center}
justifyContent={JustifyContent.center}
>
<Text variant={TextVariant.HeadingMD} style={styles.headerTitle}>
{strings('bridge.select_network')}
</Text>
<Box style={[styles.closeButton, styles.closeIconBox]}>
<TouchableOpacity
onPress={() => navigation.goBack()}
testID="bridge-network-selector-close-button"
>
<Icon
name={IconName.Close}
size={IconSize.Sm}
color={theme.colors.icon.default}
/>
</TouchableOpacity>
</Box>
</Box>
</BottomSheetHeader>
</Box>
<BottomSheetHeader
onClose={() => navigation.goBack()}
closeButtonProps={{
testID: 'bridge-network-selector-close-button',
size: ButtonIconSizes.Lg,
}}
>
<Text variant={TextVariant.HeadingMD} style={styles.headerTitle}>
{strings('bridge.select_network')}
</Text>
</BottomSheetHeader>

<Box style={styles.content}>
<ScrollView>{children}</ScrollView>
</Box>
</Box>
<ScrollView>{children}</ScrollView>
</BottomSheet>
);
};
Loading
Loading