mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-02-20 00:33:07 +01:00
feat(suite): hash check failure UI tweaks
This commit is contained in:
committed by
Jan Komárek
parent
1037a6343f
commit
b57ab9eca8
@@ -56,7 +56,6 @@ const useSecurityCheckFailProps = (): SecurityCheckFailProps => {
|
||||
heading: 'TR_FAILED_VERIFY_DEVICE_HEADING',
|
||||
text: 'TR_FAILED_VERIFY_DEVICE_TEXT',
|
||||
checklistItems: softFailureChecklistItems,
|
||||
supportButtonVariant: 'warning',
|
||||
goBack: goToSuite,
|
||||
supportUrl: TREZOR_SUPPORT_FW_REVISION_CHECK_FAILED_URL,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { ComponentProps } from 'react';
|
||||
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { TranslationKey } from '@suite-common/intl-types';
|
||||
@@ -30,7 +28,6 @@ export type SecurityCheckFailProps = {
|
||||
text?: TranslationKey;
|
||||
supportUrl: Url;
|
||||
checklistItems?: SecurityChecklistItem[];
|
||||
supportButtonVariant?: ComponentProps<typeof Button>[`variant`];
|
||||
};
|
||||
|
||||
export const SecurityCheckFail = ({
|
||||
@@ -39,7 +36,6 @@ export const SecurityCheckFail = ({
|
||||
text = 'TR_DEVICE_COMPROMISED_TEXT',
|
||||
supportUrl,
|
||||
checklistItems = hardFailureChecklistItems,
|
||||
supportButtonVariant = 'primary',
|
||||
}: SecurityCheckFailProps) => {
|
||||
const chatUrl = `${supportUrl}#open-chat`;
|
||||
|
||||
@@ -72,7 +68,7 @@ export const SecurityCheckFail = ({
|
||||
href={chatUrl}
|
||||
isFullWidth
|
||||
size="large"
|
||||
variant={supportButtonVariant}
|
||||
variant="primary"
|
||||
>
|
||||
<Translation id="TR_CONTACT_TREZOR_SUPPORT" />
|
||||
</Button>
|
||||
|
||||
@@ -2,10 +2,7 @@ import { TranslationKey } from '@suite-common/intl-types';
|
||||
import { Banner, Row } from '@trezor/components';
|
||||
import { FirmwareHashCheckError, FirmwareRevisionCheckError } from '@trezor/connect';
|
||||
import { spacings } from '@trezor/theme';
|
||||
import {
|
||||
HELP_CENTER_FIRMWARE_REVISION_CHECK,
|
||||
TREZOR_SUPPORT_FW_REVISION_CHECK_FAILED_URL,
|
||||
} from '@trezor/urls';
|
||||
import { TREZOR_SUPPORT_FW_REVISION_CHECK_FAILED_URL } from '@trezor/urls';
|
||||
|
||||
import { Translation, TrezorLink } from 'src/components/suite';
|
||||
import { SkippedHashCheckError } from 'src/constants/suite/firmware';
|
||||
@@ -53,11 +50,6 @@ const BannerButtons = () => (
|
||||
<Translation id="TR_CONTACT_TREZOR_SUPPORT" />
|
||||
</Banner.Button>
|
||||
</TrezorLink>
|
||||
<TrezorLink variant="nostyle" href={HELP_CENTER_FIRMWARE_REVISION_CHECK}>
|
||||
<Banner.Button isSubtle>
|
||||
<Translation id="TR_LEARN_MORE" />
|
||||
</Banner.Button>
|
||||
</TrezorLink>
|
||||
</Row>
|
||||
);
|
||||
|
||||
@@ -67,6 +59,7 @@ export const FirmwareAuthenticityCheckBanner = () => {
|
||||
const wasOffline = firmwareRevisionError === 'cannot-perform-check-offline';
|
||||
const isHashCheckOtherError =
|
||||
firmwareRevisionError === null && firmwareHashError === 'other-error';
|
||||
const hideBannerButtons = wasOffline || isHashCheckOtherError;
|
||||
|
||||
const message = useAuthenticityCheckMessage();
|
||||
if (message === null) return null;
|
||||
@@ -75,7 +68,7 @@ export const FirmwareAuthenticityCheckBanner = () => {
|
||||
<Banner
|
||||
icon
|
||||
variant={isHashCheckOtherError ? 'warning' : 'destructive'}
|
||||
rightContent={wasOffline ? null : <BannerButtons />}
|
||||
rightContent={hideBannerButtons ? null : <BannerButtons />}
|
||||
>
|
||||
<Translation id={message} />
|
||||
</Banner>
|
||||
|
||||
@@ -7115,7 +7115,7 @@ export default defineMessages({
|
||||
},
|
||||
TR_FAILED_VERIFY_DEVICE_HEADING: {
|
||||
id: 'TR_FAILED_VERIFY_DEVICE_HEADING',
|
||||
defaultMessage: 'Failed to verify device',
|
||||
defaultMessage: "Couldn't verify device",
|
||||
},
|
||||
TR_FAILED_VERIFY_DEVICE_TEXT: {
|
||||
id: 'TR_FAILED_VERIFY_DEVICE_TEXT',
|
||||
@@ -7340,7 +7340,7 @@ export default defineMessages({
|
||||
TR_DEVICE_FIRMWARE_HASH_CHECK_OTHER_ERROR: {
|
||||
id: 'TR_DEVICE_FIRMWARE_HASH_CHECK_OTHER_ERROR',
|
||||
defaultMessage:
|
||||
"Failed to verify device. Reconnect your Trezor and try again. Don't send any funds until the issue is resolved. If the issue persists, contact Trezor Support.",
|
||||
'Couldn’t verify device. Reconnect your Trezor to try resolving the issue. If the problem continues, contact Trezor Support.',
|
||||
},
|
||||
TR_ONBOARDING_COINS_STEP: {
|
||||
id: 'TR_ONBOARDING_COINS_STEP',
|
||||
|
||||
Reference in New Issue
Block a user