Skip to content

Commit

Permalink
chore(suite): update security check URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
komret authored and Lemonexe committed Oct 7, 2024
1 parent f5e8f25 commit 03d3983
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { useEffect } from 'react';

import { isDeviceAcquired } from '@suite-common/suite-utils';
import { deviceActions } from '@suite-common/wallet-core';
import { Card } from '@trezor/components';
import { getFirmwareVersion } from '@trezor/device-utils';
import { isDeviceAcquired } from '@suite-common/suite-utils';
import { TREZOR_SUPPORT_FW_REVISION_CHECK_FAILED_URL } from '@trezor/urls';

import { WelcomeLayout } from 'src/components/suite';
import { useDevice, useDispatch } from 'src/hooks/suite';
import { captureSentryMessage, withSentryScope } from 'src/utils/suite/sentry';
import { SecurityCheckFail } from '../SecurityCheck/SecurityCheckFail';
import { deviceActions } from '@suite-common/wallet-core';
import { SecurityCheckFail } from 'src/components/suite/SecurityCheck/SecurityCheckFail';

export const DeviceCompromised = () => {
const dispatch = useDispatch();
Expand Down Expand Up @@ -45,7 +46,10 @@ export const DeviceCompromised = () => {
return (
<WelcomeLayout>
<Card data-testid="@device-compromised">
<SecurityCheckFail goBack={goToSuite} />
<SecurityCheckFail
goBack={goToSuite}
supportUrl={TREZOR_SUPPORT_FW_REVISION_CHECK_FAILED_URL}
/>
</Card>
</WelcomeLayout>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components';
import { TranslationKey } from '@suite-common/intl-types';
import { Button, Divider, H2, Row, Text } from '@trezor/components';
import { spacings, spacingsPx } from '@trezor/theme';
import { TREZOR_SUPPORT_FW_CHECK_FAILED, Url } from '@trezor/urls';
import { Url } from '@trezor/urls';

import { Translation } from 'src/components/suite';
import { SecurityChecklist } from '../../../views/onboarding/steps/SecurityCheck/SecurityChecklist';
Expand Down Expand Up @@ -38,14 +38,14 @@ interface SecurityCheckFailProps {
goBack?: () => void;
heading?: TranslationKey;
text?: TranslationKey;
supportUrl?: Url;
supportUrl: Url;
}

export const SecurityCheckFail = ({
goBack,
heading = 'TR_DEVICE_COMPROMISED_HEADING',
text = 'TR_DEVICE_COMPROMISED_TEXT',
supportUrl = TREZOR_SUPPORT_FW_CHECK_FAILED,
supportUrl,
}: SecurityCheckFailProps) => {
const chatUrl = `${supportUrl}#open-chat`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import styled from 'styled-components';

import { Modal } from 'src/components/suite';
import { SecurityCheckFail } from '../../../SecurityCheck/SecurityCheckFail';
import { SecurityCheckFail } from 'src/components/suite/SecurityCheck/SecurityCheckFail';
import { TREZOR_SUPPORT_DEVICE_AUTHENTICATION_FAILED_URL } from '@trezor/urls';

const StyledModal = styled(Modal)`
text-align: left;
`;

export const AuthenticateDeviceFailModal = () => (
<StyledModal>
<SecurityCheckFail />
<SecurityCheckFail supportUrl={TREZOR_SUPPORT_DEVICE_AUTHENTICATION_FAILED_URL} />
</StyledModal>
);
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import styled from 'styled-components';
import { checkDeviceAuthenticityThunk } from '@suite-common/device-authenticity';
import { selectDevice, selectSelectedDeviceAuthenticity } from '@suite-common/wallet-core';
import { variables } from '@trezor/components';
import { spacingsPx } from '@trezor/theme';
import { TREZOR_SUPPORT_DEVICE_AUTHENTICATION_FAILED_URL } from '@trezor/urls';

import { OnboardingButtonCta, OnboardingStepBox } from 'src/components/onboarding';
import { CollapsibleOnboardingCard } from 'src/components/onboarding/CollapsibleOnboardingCard';
import { DeviceAuthenticationExplainer, Translation } from 'src/components/suite';
import { useDispatch, useSelector } from 'src/hooks/suite';
import { selectIsDebugModeActive } from 'src/reducers/suite/suiteReducer';
import { SecurityCheckFail } from '../../../../components/suite/SecurityCheck/SecurityCheckFail';
import { spacingsPx } from '@trezor/theme';
import { SecurityCheckFail } from 'src/components/suite/SecurityCheck/SecurityCheckFail';

const StyledCard = styled(CollapsibleOnboardingCard)`
padding: ${spacingsPx.md};
Expand Down Expand Up @@ -109,7 +110,7 @@ export const DeviceAuthenticity = ({ goToNext }: DeviceAuthenticityProps) => {
if (isCheckFailed) {
return (
<StyledCard>
<SecurityCheckFail />
<SecurityCheckFail supportUrl={TREZOR_SUPPORT_DEVICE_AUTHENTICATION_FAILED_URL} />
</StyledCard>
);
}
Expand Down
6 changes: 4 additions & 2 deletions packages/urls/src/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export const TREZOR_SUPPORT_DEVICE_URL: Url =
'https://trezor.io/support/a/trezor-suite-doesn-t-see-my-device';
export const TREZOR_SUPPORT_RECOVERY_ISSUES_URL: Url =
'https://trezor.io/support/a/trezor-recovery-issues';
export const TREZOR_SUPPORT_FW_CHECK_FAILED: Url =
'https://trezor.io/support/a/trezor-firmware-revision-check-failed';
export const TREZOR_SUPPORT_DEVICE_AUTHENTICATION_FAILED_URL: Url =
'https://trezor.io/support/a/trezor-safe-device-authentication-check-failed';
export const TREZOR_SUPPORT_FW_REVISION_CHECK_FAILED_URL: Url =
'https://trezor.io/support/a/trezor-fw-revision-check-failed';
export const TREZOR_SUPPORT_FW_ALREADY_INSTALLED: Url =
'https://trezor.io/support/a/firmware-is-already-installed';
export const TREZOR_SUPPORT_IS_MY_DEVICE_SAFE: Url =
Expand Down

0 comments on commit 03d3983

Please sign in to comment.