diff --git a/packages/suite/src/components/suite/DeviceInvalidModeLayout.tsx b/packages/suite/src/components/suite/DeviceInvalidModeLayout.tsx deleted file mode 100644 index 4da6a0588ff..00000000000 --- a/packages/suite/src/components/suite/DeviceInvalidModeLayout.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { ReactNode } from 'react'; - -import styled, { css } from 'styled-components'; - -import { Button, Image, ImageType } from '@trezor/components'; -import { selectDevicesCount } from '@suite-common/wallet-core'; - -import { Translation } from 'src/components/suite'; -import { useDispatch, useSelector } from 'src/hooks/suite'; -import { goto } from 'src/actions/suite/routerActions'; - -import { Modal } from './modals/Modal/Modal'; - -const StyledImage = styled(Image)<{ image: ImageType }>` - flex: 1; - margin: 20px 0; - - ${({ image }) => - image === 'UNI_WARNING' && - css` - max-height: 160px; - flex: 0 0 auto; - `} -`; - -const StyledModal = styled(Modal)` - width: 600px; -`; - -/** - * DeviceInvalidMode is subset of ApplicationState, see Preloader component. It shows that device is not in state - * application can work with and user must take one of the following actions: - * - * 1. trigger switch device menu (only available if multiple devices are connected) - * 2. click resolve button which takes user to a view where he may resolve issue with current device - * - * This is a layout component which indicates that it is supposed to unify layout of all DeviceInvalidMode - * like views listed in suite/views - */ - -type DeviceInvalidModeLayoutProps = { - title: ReactNode; - text?: ReactNode; - image?: ImageType; - allowSwitchDevice?: boolean; - resolveButton?: ReactNode; - ['data-test']?: string; -}; - -export const DeviceInvalidModeLayout = ({ - title, - text, - image = 'UNI_WARNING', - allowSwitchDevice, - resolveButton, - 'data-test': dataTest, -}: DeviceInvalidModeLayoutProps) => { - const devicesCount = useSelector(selectDevicesCount); - const dispatch = useDispatch(); - - const handleSwitchDeviceButtonClick = () => - dispatch(goto('suite-switch-device', { params: { cancelable: true } })); - - return ( - - {resolveButton && resolveButton} - {allowSwitchDevice && devicesCount > 1 && ( - - )} - - } - > - - - ); -}; diff --git a/packages/suite/src/components/suite/index.tsx b/packages/suite/src/components/suite/index.tsx index 983a1f336a7..52c425a1832 100644 --- a/packages/suite/src/components/suite/index.tsx +++ b/packages/suite/src/components/suite/index.tsx @@ -12,7 +12,6 @@ import { FiatValue } from './FiatValue'; import { WebUsbButton } from './WebUsbButton'; import { HiddenPlaceholder } from './HiddenPlaceholder'; import { QuestionTooltip } from './QuestionTooltip'; -import { DeviceInvalidModeLayout } from './DeviceInvalidModeLayout'; import { TrendTicker } from './Ticker/TrendTicker'; import { PriceTicker } from './Ticker/PriceTicker'; import { Translation } from './Translation'; @@ -59,7 +58,6 @@ export { AccountLabel, DeviceConfirmImage, CheckItem, - DeviceInvalidModeLayout, PrerequisitesGuide, WelcomeLayout, NotificationCard, diff --git a/packages/suite/src/support/messages.ts b/packages/suite/src/support/messages.ts index 045a2dd783b..1ca85803bc4 100644 --- a/packages/suite/src/support/messages.ts +++ b/packages/suite/src/support/messages.ts @@ -7224,14 +7224,6 @@ export default defineMessages({ id: 'TR_TROUBLESHOOTING_TIP_SUITE_DESKTOP_DESCRIPTION', defaultMessage: 'Run Trezor Suite desktop application', }, - TR_TROUBLESHOOTING_TIP_BRIDGE_BACKGROUND_TITLE: { - id: 'TR_TROUBLESHOOTING_TIP_BRIDGE_BACKGROUND_TITLE', - defaultMessage: 'You may also run Trezor Suite in background', - }, - TR_TROUBLESHOOTING_TIP_BRIDGE_BACKGROUND_DESCRIPTION: { - id: 'TR_TROUBLESHOOTING_TIP_BRIDGE_BACKGROUND_DESCRIPTION', - defaultMessage: 'See intructions', - }, TR_TROUBLESHOOTING_TIP_UDEV_INSTALL_DESCRIPTION: { id: 'TR_TROUBLESHOOTING_TIP_UDEV_INSTALL_DESCRIPTION', defaultMessage: diff --git a/packages/suite/src/views/suite/device-acquire/index.tsx b/packages/suite/src/views/suite/device-acquire/index.tsx deleted file mode 100644 index bfd069b944a..00000000000 --- a/packages/suite/src/views/suite/device-acquire/index.tsx +++ /dev/null @@ -1,29 +0,0 @@ -// TODO: remove whole file, replaced by @suite-components/PrerequisitesGuide/components/DeviceAcquire - -import { acquireDevice } from '@suite-common/wallet-core'; -import { Button } from '@trezor/components'; - -import { useDevice, useDispatch } from 'src/hooks/suite'; -import { Translation, DeviceInvalidModeLayout } from 'src/components/suite'; - -export const DeviceAcquire = () => { - const dispatch = useDispatch(); - const { device, isLocked } = useDevice(); - - if (!device) return null; - - const handleClick = () => dispatch(acquireDevice()); - - return ( - } - text={} - image="DEVICE_ANOTHER_SESSION" - resolveButton={ - - } - /> - ); -}; diff --git a/packages/suite/src/views/suite/device-unknown/index.tsx b/packages/suite/src/views/suite/device-unknown/index.tsx deleted file mode 100644 index 24141f3fc80..00000000000 --- a/packages/suite/src/views/suite/device-unknown/index.tsx +++ /dev/null @@ -1,7 +0,0 @@ -// TODO: remove whole file, replaced by @suite-components/PrerequisitesGuide/components/DeviceUnknown - -import { DeviceInvalidModeLayout, Translation } from 'src/components/suite'; - -export const DeviceUnknown = () => ( - } allowSwitchDevice /> -); diff --git a/packages/suite/src/views/suite/device-unreadable/index.tsx b/packages/suite/src/views/suite/device-unreadable/index.tsx deleted file mode 100644 index fdcf35131fa..00000000000 --- a/packages/suite/src/views/suite/device-unreadable/index.tsx +++ /dev/null @@ -1,26 +0,0 @@ -// TODO: remove whole file, replaced by @suite-components/PrerequisitesGuide/components/DeviceUnreadable - -import { goto } from 'src/actions/suite/routerActions'; -import { Button } from '@trezor/components'; -import { DeviceInvalidModeLayout, Translation } from 'src/components/suite'; -import { useDispatch } from 'src/hooks/suite'; - -export const DeviceUnreadable = () => { - const dispatch = useDispatch(); - - const handleClick = () => dispatch(goto('suite-bridge')); - - return ( - } - text={} - resolveButton={ - - } - allowSwitchDevice - /> - ); -};