Skip to content

Commit b8f76b4

Browse files
style: improve notification setting styling
1 parent 926eab1 commit b8f76b4

File tree

4 files changed

+38
-13
lines changed

4 files changed

+38
-13
lines changed

app/components/Views/Settings/NotificationsSettings/AccountsList.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ import {
77
import NotificationOptionToggle from './NotificationOptionToggle';
88
import { NotificationSettingsViewSelectorsIDs } from '../../../../../e2e/selectors/Notifications/NotificationSettingsView.selectors';
99
import AccountListHeader from '../../../../component-library/components-temp/MultichainAccounts/MultichainAccountSelectorList/AccountListHeader';
10+
import { useTheme } from '../../../../util/theme';
11+
import { useStyles } from '../../../../component-library/hooks';
12+
import styleSheet from './NotificationsSettings.styles';
1013

1114
export const AccountsList = () => {
15+
const theme = useTheme();
16+
const { styles } = useStyles(styleSheet, { theme });
17+
1218
const { accountAvatarType, firstHDWalletGroups } = useAccountProps();
1319
const {
1420
isAnyAccountLoading,
@@ -24,7 +30,10 @@ export const AccountsList = () => {
2430

2531
return (
2632
<View>
27-
<AccountListHeader title={firstHDWalletGroups.title} />
33+
<AccountListHeader
34+
title={firstHDWalletGroups.title}
35+
containerStyle={styles.accountHeader}
36+
/>
2837
<FlatList
2938
data={firstHDWalletGroups.data}
3039
keyExtractor={(item) => `address-${item.id}`}

app/components/Views/Settings/NotificationsSettings/NotificationOptionToggle/styles.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const createStyles = () =>
66
container: {
77
flexDirection: 'row',
88
alignItems: 'center',
9-
marginBottom: 24,
109
},
1110
titleContainer: {
1211
alignItems: 'flex-start',
@@ -15,9 +14,6 @@ export const createStyles = () =>
1514
title: {
1615
flex: 1,
1716
},
18-
switchElement: {
19-
// marginLeft: 16,
20-
},
2117
switch: {
2218
alignSelf: 'flex-start',
2319
},

app/components/Views/Settings/NotificationsSettings/NotificationsSettings.styles.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,31 @@ import { Theme } from '../../../../util/theme/models';
44

55
const styleSheet = (params: { theme: Theme }) =>
66
StyleSheet.create({
7-
wrapper: {
8-
backgroundColor: params.theme.colors.background.default,
9-
flex: 1,
7+
container: {
108
padding: 24,
119
paddingBottom: 48,
1210
},
11+
line: {
12+
borderTopWidth: 1,
13+
borderTopColor: params.theme.colors.border.muted,
14+
marginVertical: 16,
15+
marginHorizontal: -24,
16+
},
1317
heading: {
1418
marginTop: 16,
1519
},
1620
accessory: {
1721
marginTop: 16,
1822
},
1923
setting: {
20-
marginVertical: 16,
24+
marginTop: 16,
25+
},
26+
productAnnouncementContainer: {
27+
marginTop: 16,
28+
},
29+
accountHeader: {
30+
marginTop: 16,
31+
marginLeft: -16,
2132
},
2233
clearHistoryConfirm: {
2334
marginTop: 18,

app/components/Views/Settings/NotificationsSettings/index.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable react/display-name */
22
import { NavigationProp, ParamListBase } from '@react-navigation/native';
33
import React, { useEffect } from 'react';
4-
import { ScrollView } from 'react-native';
4+
import { ScrollView, View } from 'react-native';
55
import { useSelector } from 'react-redux';
66

77
import { strings } from '../../../../../locales/i18n';
@@ -39,7 +39,10 @@ const NotificationsSettings = ({ navigation, route }: Props) => {
3939
const isMetamaskNotificationsEnabled = useSelector(
4040
selectIsMetamaskNotificationsEnabled,
4141
);
42-
const hasFirstHDWallet = Boolean(useFirstHDWalletAccounts());
42+
const firstHDWallet = useFirstHDWalletAccounts();
43+
const hasFirstHDWallet = Boolean(
44+
firstHDWallet?.data && firstHDWallet?.data.length > 0,
45+
);
4346

4447
const loadingText = useSwitchNotificationLoadingText();
4548

@@ -62,7 +65,7 @@ const NotificationsSettings = ({ navigation, route }: Props) => {
6265
}, [colors, isFullScreenModal, navigation]);
6366

6467
return (
65-
<ScrollView style={styles.wrapper}>
68+
<ScrollView style={styles.container}>
6669
{/* Main Toggle */}
6770
<MainNotificationToggle />
6871

@@ -72,6 +75,8 @@ const NotificationsSettings = ({ navigation, route }: Props) => {
7275
{/* Push Notifications Toggle */}
7376
<PushNotificationToggle />
7477

78+
<View style={styles.line} />
79+
7580
{/* Feature Announcement Toggle */}
7681
<SessionHeader
7782
title={strings(
@@ -82,7 +87,11 @@ const NotificationsSettings = ({ navigation, route }: Props) => {
8287
)}
8388
styles={styles}
8489
/>
85-
<FeatureAnnouncementToggle />
90+
<View style={styles.productAnnouncementContainer}>
91+
<FeatureAnnouncementToggle />
92+
</View>
93+
94+
<View style={styles.line} />
8695

8796
{/* Account Notification Toggles */}
8897
{hasFirstHDWallet && (

0 commit comments

Comments
 (0)