Skip to content

Commit 4ee8339

Browse files
committed
fix: adjusted height of bottom sheet conditionally and dapp network avatar no longer shows when dapp is requesting network permissions
1 parent 64761ed commit 4ee8339

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

app/components/UI/PermissionsSummary/PermissionsSummary.styles.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ const createStyles = (params: {
1010
vars: {
1111
isRenderedAsBottomSheet: boolean | undefined;
1212
nonTabView: boolean | undefined;
13+
fullNonTabView: boolean | undefined;
1314
};
1415
}) => {
1516
const { theme, vars } = params;
1617
const { colors, typography } = theme;
17-
const { isRenderedAsBottomSheet, nonTabView } = vars;
18+
const { isRenderedAsBottomSheet, nonTabView, fullNonTabView } = vars;
1819

19-
const tabHeight = nonTabView ? 400 : undefined;
20+
const tabHeight = fullNonTabView ? 400 : 325;
2021
const bottomSheetHeight = isRenderedAsBottomSheet ? undefined : '100%';
2122
const height = nonTabView ? tabHeight : bottomSheetHeight;
2223

app/components/UI/PermissionsSummary/PermissionsSummary.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ const PermissionsSummary = ({
9999
showPermissionsOnly = false,
100100
}: PermissionsSummaryProps) => {
101101
const nonTabView = showAccountsOnly || showPermissionsOnly;
102+
const fullNonTabView = showAccountsOnly && showPermissionsOnly;
102103

103104
const { colors } = useTheme();
104105
const { styles } = useStyles(styleSheet, {
105106
isRenderedAsBottomSheet,
106107
nonTabView,
108+
fullNonTabView,
107109
});
108110
const navigation = useNavigation();
109111
const { navigate } = navigation;
@@ -157,7 +159,9 @@ const PermissionsSummary = ({
157159
const url = currentPageInformation.url;
158160
const iconTitle = getHost(currentEnsName || url);
159161

160-
return isPerDappSelectedNetworkEnabled() && isAlreadyConnected ? (
162+
return isPerDappSelectedNetworkEnabled() &&
163+
isAlreadyConnected &&
164+
!nonTabView ? (
161165
<View style={[styles.domainLogoContainer, styles.assetLogoContainer]}>
162166
<TouchableOpacity
163167
onPress={switchNetwork}

app/components/UI/PermissionsSummary/__snapshots__/PermissionsSummary.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ exports[`PermissionsSummary should render only the account permissions card when
17991799
"backgroundColor": "#f3f5f9",
18001800
"borderTopLeftRadius": 20,
18011801
"borderTopRightRadius": 20,
1802-
"height": 400,
1802+
"height": 310,
18031803
"justifyContent": "flex-start",
18041804
"paddingTop": 16,
18051805
},
@@ -2497,7 +2497,7 @@ exports[`PermissionsSummary should render only the network permissions card when
24972497
"backgroundColor": "#f3f5f9",
24982498
"borderTopLeftRadius": 20,
24992499
"borderTopRightRadius": 20,
2500-
"height": 400,
2500+
"height": 310,
25012501
"justifyContent": "flex-start",
25022502
"paddingTop": 16,
25032503
},

0 commit comments

Comments
 (0)