Skip to content

Commit

Permalink
feat(suite): rework bridge outdated modal; now it prompts user to uni…
Browse files Browse the repository at this point in the history
…nstall standalone bridge instead
  • Loading branch information
mroz22 committed Feb 28, 2025
1 parent 8aa8f38 commit 7a78937
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import {
import { isTranslationMode } from 'src/utils/suite/l10n';

import { MessageSystemBanner } from '../MessageSystemBanner';
import { BridgeDeprecated } from './BridgeDeprecatedBanner';
import { FailedBackup } from './FailedBackupBanner';
import { FirmwareAuthenticityCheckBanner } from './FirmwareAuthenticityCheckBanner';
import { FirmwareHashMismatchOnLastUpdateBanner } from './FirmwareHashMismatchOnLastUpdateBanner';
import { NoBackup } from './NoBackupBanner';
import { NoConnectionBanner } from './NoConnectionBanner';
import { SafetyChecksBanner } from './SafetyChecksBanner';
import { TranslationMode } from './TranslationModeBanner';
import { BridgeDeprecated } from './BridgeDeprecatedBanner';

const Container = styled.div<{ $isVisible?: boolean }>`
width: 100%;
Expand Down Expand Up @@ -80,7 +80,7 @@ export const SuiteBanners = () => {
// Let the user dismiss the warning.
banner = <SafetyChecksBanner onDismiss={() => setSafetyChecksDismissed(true)} />;
priority = 50;
} else if (bridge?.outdated || true) {
} else if (bridge?.outdated) {
banner = <BridgeDeprecated />;
priority = 30;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { FirmwareUpdate } from 'src/views/firmware/FirmwareUpdate';
import { Recovery } from 'src/views/recovery';
import { SwitchDevice } from 'src/views/suite/SwitchDevice/SwitchDevice';
import { BridgeUnavailable } from 'src/views/suite/bridge';
import { BridgeRequested } from 'src/views/suite/bridge-requested';
import { BridgeDeprecated } from 'src/views/suite/bridge-deprecated';
import { BridgeRequested } from 'src/views/suite/bridge-requested';
import { UdevRules } from 'src/views/suite/udev';
import { Version } from 'src/views/suite/version';

Expand Down
3 changes: 2 additions & 1 deletion packages/suite/src/support/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9543,13 +9543,14 @@ export default defineMessages({
id: 'TR_CONNECT_BLUETOOTH_BUTTON',
defaultMessage: 'Connect Trezor Safe 7 via Bluetooth',
},

TR_YOUR_BRIDGE_VERSION_WILL_SOON_BE_DEPRECATED: {
id: 'TR_YOUR_BRIDGE_VERSION_WILL_SOON_BE_DEPRECATED',
defaultMessage: 'Your Trezor Bridge version will soon be deprecated.',
},
TR_BRIDGE_UNINSTALL_INSTRUCTIONS: {
id: 'TR_BRIDGE_UNINSTALL_INSTRUCTIONS',
defaultMessage:
'You are running a very old and soon to be deprecated Trezor Bridge version. Please uninstall it from your system. {link}',
'You are running a very old and soon to be deprecated Trezor Bridge version. Please uninstall it from your system. <a>Learn more</a>',
},
});
12 changes: 10 additions & 2 deletions packages/suite/src/views/suite/bridge-deprecated/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { Button, Link } from '@trezor/components';
import { UNINSTALL_BRIDGE_URL } from '@trezor/urls';

import { goto } from 'src/actions/suite/routerActions';
import { Metadata, Modal, Translation } from 'src/components/suite';
import { useDispatch, useLayout } from 'src/hooks/suite';

/**
* modal that should show users basic information how to uninstall old standalone bridge
*/
export const BridgeDeprecated = () => {
const dispatch = useDispatch();

Expand All @@ -13,12 +17,16 @@ export const BridgeDeprecated = () => {

return (
<Modal
heading={'Unsupported Trezor Bridge version detected'}
heading={<Translation id="TR_YOUR_BRIDGE_VERSION_WILL_SOON_BE_DEPRECATED" />}
description={
<Translation
id="TR_BRIDGE_UNINSTALL_INSTRUCTIONS"
values={{
link: <Link href={UNINSTALL_BRIDGE_URL} variant="underline" />,
a: chunks => (
<Link href={UNINSTALL_BRIDGE_URL} typographyStyle="hint">
{chunks}
</Link>
),
}}
/>
}
Expand Down
2 changes: 2 additions & 0 deletions packages/urls/src/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,5 @@ export const ESHOP_KEEP_METAL_SINGLE_SHARE_URL: Url =
'https://trezor.io/trezor-keep-metal-single-share';

export const TRADING_DOWNLOAD_INVITY_APP_URL: Url = 'https://get.invity.io';

export const UNINSTALL_BRIDGE_URL: Url = 'https://trezor.io/learn/a/what-is-trezor-bridge';
7 changes: 7 additions & 0 deletions suite-common/suite-config/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ export const routes = [
isForegroundApp: true,
params: modalAppParams,
},
{
name: 'suite-bridge-deprecated',
pattern: '/bridge-bridge',
app: 'bridge-deprecated',
isForegroundApp: true,
params: modalAppParams,
},
{
name: 'suite-udev',
pattern: '/udev',
Expand Down

0 comments on commit 7a78937

Please sign in to comment.