Skip to content
Draft
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
135 changes: 0 additions & 135 deletions app/actions/networkConnectionBanner/index.test.ts

This file was deleted.

84 changes: 0 additions & 84 deletions app/actions/networkConnectionBanner/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTailwind } from '@metamask/design-system-twrnc-preset';
import { useAppTheme } from '../../../util/theme';
import { useNetworkConnectionBanner } from '../../hooks/useNetworkConnectionBanner';
import { strings } from '../../../../locales/i18n';
import { NetworkConnectionBannerState } from '../../../reducers/networkConnectionBanner';
import type { NetworkConnectionBannerState } from './types';
import BannerBase from '../../../component-library/components/Banners/Banner/foundation/BannerBase';
import { Theme } from '../../../util/theme/models';
import Animated, {
Expand Down
26 changes: 26 additions & 0 deletions app/components/UI/NetworkConnectionBanner/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
import type { Hex } from '@metamask/utils';

/**
* Network Connection Banner Status
*
* Degraded: The network is taking more than 5 seconds to initialize.
* Unavailable: The network is not available.
*/
export type NetworkConnectionBannerStatus = 'degraded' | 'unavailable';

/**
* Shape consumed by the banner UI. Derived from
* `NetworkConnectionBannerController` state via the selector — the
* `visible: false` case maps to the controller's `'available'` status.
*/
export type NetworkConnectionBannerState =
| {
visible: false;
}
| {
visible: true;
chainId: Hex;
status: NetworkConnectionBannerStatus;
networkName: string;
rpcUrl: string;
isInfuraEndpoint: boolean;
/**
* Network client ID of an available Infura endpoint (for custom networks
* that have one) that can be used to switch to Infura. Undefined if no
* Infura endpoint is available.
*/
infuraNetworkClientId?: string;
};
2 changes: 0 additions & 2 deletions app/components/Views/Wallet/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ import Engine from '../../../core/Engine';
import { useSelector } from 'react-redux';
import { mockedPerpsFeatureFlagsEnabledState } from '../../UI/Perps/mocks/remoteFeatureFlagMocks';
import { initialState as cardInitialState } from '../../../core/redux/slices/card';
import { initialState as networkConnectionBannerInitialState } from '../../../reducers/networkConnectionBanner';
import {
NavigationProp,
ParamListBase,
Expand Down Expand Up @@ -477,7 +476,6 @@ const mockInitialState = {
newPrivacyPolicyToastShownDate: null,
newPrivacyPolicyToastClickedOrClosed: false,
},
networkConnectionBanner: networkConnectionBannerInitialState,
engine: {
backgroundState: {
...backgroundState,
Expand Down
Loading
Loading