Skip to content

Commit fcad575

Browse files
committed
chore: remove src/notifications/settings/index.ts barrel file
1 parent ee9509d commit fcad575

File tree

11 files changed

+20
-47
lines changed

11 files changed

+20
-47
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"lint:js": "eslint --cache . --quiet",
4444
"lint:js:ci": "eslint --quiet",
4545
"lint:ts": "yarn tsc --skipLibCheck --noEmit",
46-
"check:cycles": "./scripts/check-cycles.sh 1094",
46+
"check:cycles": "./scripts/check-cycles.sh 1093",
4747
"postinstall": "./scripts/postinstall.sh",
4848
"start": "react-native start --client-logs",
4949
"start:clean": "yarn clean:packager && yarn start --reset-cache",

src/handlers/localstorage/removeWallet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { keys } from 'lodash';
33
import { accountLocalKeys } from './accountLocal';
44
import { getKey } from './common';
55
import { logger, RainbowError } from '@/logger';
6-
import { removeNotificationSettingsForWallet } from '@/notifications/settings';
6+
import { removeNotificationSettingsForWallet } from '@/notifications/settings/settings';
77
import { Network } from '@/state/backendNetworks/types';
88

99
export const removeWalletData = async (accountAddress: any) => {

src/migrations/migrations/prepareDefaultNotificationGroupSettingsState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Migration, MigrationName } from '@/migrations/types';
2-
import { addDefaultNotificationGroupSettings } from '@/notifications/settings';
2+
import { addDefaultNotificationGroupSettings } from '@/notifications/settings/initialization';
33

44
export function prepareDefaultNotificationGroupSettingsState(): Migration {
55
return {

src/model/wallet.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@ import walletTypes, { EthereumWalletType } from '@/helpers/walletTypes';
3535
import ethereumUtils from '@/utils/ethereumUtils';
3636
import { ensureError, logger, RainbowError } from '@/logger';
3737
import { deriveAccountFromBluetoothHardwareWallet, deriveAccountFromMnemonic, deriveAccountFromWalletInput } from '@/utils/wallet';
38-
import {
39-
AddressWithRelationship,
40-
initializeNotificationSettingsForAddresses,
41-
WalletNotificationRelationship,
42-
} from '@/notifications/settings';
38+
import type { AddressWithRelationship } from '@/notifications/settings/types';
39+
import { initializeNotificationSettingsForAddresses } from '@/notifications/settings/initialization';
40+
import { WalletNotificationRelationship } from '@/notifications/settings/constants';
4341
import { DebugContext } from '@/logger/debugContext';
4442
import { setHardwareTXError } from '@/navigation/HardwareWalletTxNavigator';
4543
import { Signer } from '@ethersproject/abstract-signer';

src/navigation/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { LearnCardKey, LearnCategory } from '@/components/cards/utils/types';
3030
import { CardType } from '@/components/cards/GenericCard';
3131
import { RefObject } from 'react';
3232
import { ActiveTabRef } from '@/components/DappBrowser/types';
33-
import { WalletNotificationSettings } from '@/notifications/settings';
33+
import type { WalletNotificationSettings } from '@/notifications/settings/types';
3434
import { LEDGER_ERROR_CODES } from '@/utils/ledger';
3535
import { BigNumberish } from '@ethersproject/bignumber';
3636
import { UnlockableAppIconKey } from '@/appIcons/appIcons';

src/notifications/NotificationsHandler.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212
} from '@/notifications/analytics';
1313
import { NotificationStorage } from '@/notifications/deferredNotificationStorage';
1414
import { handleShowingForegroundNotification } from '@/notifications/foregroundHandler';
15-
import { AddressWithRelationship, WalletNotificationRelationship } from '@/notifications/settings';
15+
import type { AddressWithRelationship } from '@/notifications/settings/types';
16+
import { WalletNotificationRelationship } from '@/notifications/settings/constants';
1617
import { initializeNotificationSettingsForAllAddresses } from '@/notifications/settings/initialization';
1718
import { setupAndroidChannels } from '@/notifications/setupAndroidChannels';
1819
import { registerTokenRefreshListener, saveFCMToken } from '@/notifications/tokens';

src/notifications/analytics.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@ import { analytics } from '@/analytics';
22
import { MinimalNotification } from '@/notifications/types';
33
import { getPermissionStatus } from '@/notifications/permissions';
44
import messaging from '@react-native-firebase/messaging';
5-
import {
6-
WalletNotificationRelationship,
7-
WALLET_GROUPS_STORAGE_KEY,
8-
WALLET_TOPICS_STORAGE_KEY,
9-
GroupSettings,
10-
GlobalNotificationTopicType,
11-
WalletNotificationSettings,
12-
notificationSettingsStorage,
13-
} from '@/notifications/settings';
5+
import { WalletNotificationRelationship, WALLET_GROUPS_STORAGE_KEY, WALLET_TOPICS_STORAGE_KEY } from '@/notifications/settings/constants';
6+
import type { GroupSettings, GlobalNotificationTopicType, WalletNotificationSettings } from '@/notifications/settings/types';
7+
import { notificationSettingsStorage } from '@/notifications/settings/storage';
148

159
export const trackTappedPushNotification = (notification: MinimalNotification | undefined) => {
1610
analytics.track(analytics.event.notificationsPromoTapped, {

src/notifications/settings/index.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/screens/SettingsSheet/components/NotificationsSection.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ import { RainbowAccount } from '@/model/wallet';
1111
import { useNavigation } from '@/navigation/Navigation';
1212
import Routes from '@/navigation/routesNames';
1313
import { isNotificationPermissionGranted, requestNotificationPermission } from '@/notifications/permissions';
14-
import {
15-
useAllNotificationSettingsFromStorage,
16-
useWalletGroupNotificationSettings,
17-
WalletNotificationRelationship,
18-
WalletNotificationSettings,
19-
} from '@/notifications/settings';
14+
import { useAllNotificationSettingsFromStorage, useWalletGroupNotificationSettings } from '@/notifications/settings/hooks';
15+
import { WalletNotificationRelationship } from '@/notifications/settings/constants';
16+
import type { WalletNotificationSettings } from '@/notifications/settings/types';
2017
import { GlobalNotificationTopic } from '@/notifications/settings/constants';
2118
import { toggleGlobalNotificationTopic } from '@/notifications/settings/settings';
2219
import { getNotificationSettingsForWalletWithAddress, setAllGlobalNotificationSettingsToStorage } from '@/notifications/settings/storage';

src/screens/SettingsSheet/components/WalletNotificationsSettings.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ import MenuContainer from './MenuContainer';
77
import MenuItem from './MenuItem';
88
import { ThemeContextProps, useTheme } from '@/theme';
99
import { RouteProp, useRoute } from '@react-navigation/native';
10-
import {
11-
WalletNotificationRelationship,
12-
WalletNotificationTopic,
13-
WalletNotificationTopicType,
14-
updateGroupSettings,
15-
useWalletGroupNotificationSettings,
16-
WalletNotificationSettings,
17-
} from '@/notifications/settings';
10+
import { WalletNotificationRelationship, WalletNotificationTopic } from '@/notifications/settings/constants';
11+
import type { WalletNotificationTopicType, WalletNotificationSettings } from '@/notifications/settings/types';
12+
import { updateGroupSettings } from '@/notifications/settings/storage';
13+
import { useWalletGroupNotificationSettings } from '@/notifications/settings/hooks';
1814
import { toggleGroupNotifications, toggleTopicForWallet } from '@/notifications/settings/settings';
1915
import { SettingsLoadingIndicator } from '@/screens/SettingsSheet/components/SettingsLoadingIndicator';
2016
import { showNotificationSubscriptionErrorAlert, showOfflineAlert } from '@/screens/SettingsSheet/components/notificationAlerts';

0 commit comments

Comments
 (0)