diff --git a/packages/components/src/components/NewModal/NewModal.tsx b/packages/components/src/components/NewModal/NewModal.tsx index f2636cee1ed..75886bba64f 100644 --- a/packages/components/src/components/NewModal/NewModal.tsx +++ b/packages/components/src/components/NewModal/NewModal.tsx @@ -28,7 +28,7 @@ import { withFrameProps, } from '../../utils/frameProps'; import { TransientProps } from '../../utils/transientProps'; -import { NewModalIcon } from './NewModalIcon'; +import { NewModalIcon, type NewModalIconColors } from './NewModalIcon'; export const allowedNewModalFrameProps = ['height'] as const satisfies FramePropsKeys[]; type AllowedFrameProps = Pick; @@ -247,4 +247,4 @@ NewModal.ModalBase = NewModalBase; NewModal.Icon = NewModalIcon; export { NewModal, NEW_MODAL_CONTENT_ID }; -export type { NewModalProps, NewModalSize }; +export type { NewModalProps, NewModalSize, NewModalIconColors }; diff --git a/packages/suite-desktop-ui/src/support/DesktopUpdater/EarlyAccessDisable.tsx b/packages/suite-desktop-ui/src/support/DesktopUpdater/EarlyAccessDisable.tsx index 3b28a1dafa8..9e790d72b43 100644 --- a/packages/suite-desktop-ui/src/support/DesktopUpdater/EarlyAccessDisable.tsx +++ b/packages/suite-desktop-ui/src/support/DesktopUpdater/EarlyAccessDisable.tsx @@ -1,33 +1,15 @@ import { useCallback, useState } from 'react'; -import styled from 'styled-components'; +import { useTheme } from 'styled-components'; import { SUITE_URL } from '@trezor/urls'; import { analytics, EventType } from '@trezor/suite-analytics'; import { desktopApi } from '@trezor/suite-desktop-api'; -import { Button, Image } from '@trezor/components'; +import { Button, Column, NewModal, Paragraph } from '@trezor/components'; +import { spacings } from '@trezor/theme'; +import { NewModalIconColors } from '@trezor/components'; -import { Translation, Modal, TrezorLink } from 'src/components/suite'; -import { DialogModal } from 'src/components/suite/modals/Modal/DialogRenderer'; - -import { ImageWrapper, Description, Title } from './styles'; - -export const Link = styled(TrezorLink)` - width: 100%; -`; - -const StyledModal = styled(Modal)` - ${Modal.BottomBar} { - > * { - flex: 1; - } - } -`; - -// eslint-disable-next-line local-rules/no-override-ds-component -const LinkButton = styled(Button)` - width: 100%; -`; +import { Translation, TrezorLink } from 'src/components/suite'; interface EarlyAccessDisableProps { hideWindow: () => void; @@ -36,6 +18,8 @@ interface EarlyAccessDisableProps { export const EarlyAccessDisable = ({ hideWindow }: EarlyAccessDisableProps) => { const [enabled, setEnabled] = useState(true); + const theme = useTheme(); + const allowPrerelease = useCallback(() => { analytics.report({ type: EventType.SettingsGeneralEarlyAccess, @@ -47,9 +31,19 @@ export const EarlyAccessDisable = ({ hideWindow }: EarlyAccessDisableProps) => { setEnabled(false); }, []); + const purpleModalColorBranding: NewModalIconColors = { + foreground: theme.iconAlertPurple, + background: theme.backgroundAlertPurpleSubtleOnElevationNegative, + }; + + const eapIconComponent = ; + return enabled ? ( - } + bottomContent={ <> + } - /> + > + + + + + + + + + ); }; diff --git a/packages/suite-desktop-ui/src/support/DesktopUpdater/EarlyAccessEnable.tsx b/packages/suite-desktop-ui/src/support/DesktopUpdater/EarlyAccessEnable.tsx index 84afcef66ee..6fb08b3fe90 100644 --- a/packages/suite-desktop-ui/src/support/DesktopUpdater/EarlyAccessEnable.tsx +++ b/packages/suite-desktop-ui/src/support/DesktopUpdater/EarlyAccessEnable.tsx @@ -1,33 +1,21 @@ import { useCallback, useState } from 'react'; -import styled from 'styled-components'; +import { useTheme } from 'styled-components'; import { analytics, EventType } from '@trezor/suite-analytics'; import { desktopApi } from '@trezor/suite-desktop-api'; -import { Button, Paragraph, Tooltip, Image } from '@trezor/components'; +import { + Button, + Paragraph, + Tooltip, + NewModal, + Card, + Column, + NewModalIconColors, +} from '@trezor/components'; +import { spacings } from '@trezor/theme'; -import { CheckItem, Translation, Modal } from 'src/components/suite'; -import { DialogModal } from 'src/components/suite/modals/Modal/DialogRenderer'; - -import { Description, Divider } from './styles'; - -const DescriptionWrapper = styled.div` - display: flex; -`; - -const DescriptionTextWrapper = styled.div` - display: flex; - flex-direction: column; - align-items: flex-start; - justify-content: space-around; - margin-left: 20px; - text-align: left; -`; - -// Checkbox has 80% max-width by default but it's nicer full width here. -const Checkbox = styled(CheckItem)` - max-width: 100%; -`; +import { CheckItem, Translation } from 'src/components/suite'; interface EarlyAccessEnableProps { hideWindow: () => void; @@ -37,6 +25,8 @@ export const EarlyAccessEnable = ({ hideWindow }: EarlyAccessEnableProps) => { const [understood, setUnderstood] = useState(false); const [enabled, setEnabled] = useState(false); + const theme = useTheme(); + const allowPrerelease = useCallback(() => { analytics.report({ type: EventType.SettingsGeneralEarlyAccess, @@ -50,12 +40,19 @@ export const EarlyAccessEnable = ({ hideWindow }: EarlyAccessEnableProps) => { const checkForUpdates = useCallback(() => desktopApi.checkForUpdates(true), []); + const purpleModalColorBranding: NewModalIconColors = { + foreground: theme.iconAlertPurple, + background: theme.backgroundAlertPurpleSubtleOnElevationNegative, + }; + + const eapIconComponent = ; + return enabled ? ( - } - body={} - bottomBarComponents={ + } + onCancel={hideWindow} + bottomContent={ <> } - /> + > + + ) : ( - } - isCancelable onCancel={hideWindow} - bottomBarComponents={ + bottomContent={ { } >