Skip to content

Commit

Permalink
feat(suite): display modals in WelcomeLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlesisz committed Feb 27, 2025
1 parent 69e9b0a commit 027471d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
TREZOR_SUPPORT_FW_REVISION_CHECK_FAILED_URL,
} from '@trezor/urls';

import { WelcomeLayout } from 'src/components/suite';
import { WelcomeLayout } from 'src/components/suite/layouts/WelcomeLayout/WelcomeLayout';
import { useDevice, useDispatch, useSelector } from 'src/hooks/suite';
import {
selectFirmwareHashCheckErrorIfEnabled,
Expand Down
2 changes: 0 additions & 2 deletions packages/suite/src/components/suite/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Address } from './Address';
import { DeviceConfirmImage } from './DeviceConfirmImage';
import { CheckItem } from './CheckItem';
import { PrerequisitesGuide } from './PrerequisitesGuide/PrerequisitesGuide';
import { WelcomeLayout } from './layouts/WelcomeLayout/WelcomeLayout';
import { WordInput } from './WordInput';
import { WordInputAdvanced } from './WordInputAdvanced';
import { Loading } from './Loading';
Expand Down Expand Up @@ -61,7 +60,6 @@ export {
DeviceConfirmImage,
CheckItem,
PrerequisitesGuide,
WelcomeLayout,
FiatValue,
Translation,
WordInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import { Elevation, spacings, spacingsPx } from '@trezor/theme';
import { GuideButton, GuideRouter } from 'src/components/guide';
// importing directly, otherwise unit tests fail, seems to be a styled-components issue
import { MessageSystemBanner } from 'src/components/suite/banners';
import { ModalSwitcher } from 'src/components/suite/modals/ModalSwitcher/ModalSwitcher';
import { MAX_ONBOARDING_WIDTH } from 'src/constants/suite/layout';
import { useSelector } from 'src/hooks/suite';
import { ModalContextProvider } from 'src/support/suite/ModalContext';

import { LoggedOutSidebar } from '../LoggedOutSidebar';

Expand Down Expand Up @@ -80,14 +82,17 @@ export const WelcomeLayout = ({ children }: WelcomeLayoutProps) => {
data-testid="@welcome-layout/body"
alignItems="normal"
>
<ElevationDown>
<LoggedOutSidebar />
</ElevationDown>
<ModalContextProvider>
<ModalSwitcher />
<ElevationDown>
<LoggedOutSidebar />
</ElevationDown>

<Right>{children}</Right>
<Right>{children}</Right>

<GuideButton />
<GuideRouter />
<GuideButton />
<GuideRouter />
</ModalContextProvider>
</Row>
</Column>
</ElevationDown>
Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/views/start/SuiteStart.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

import { WelcomeLayout } from 'src/components/suite';
import { WelcomeLayout } from 'src/components/suite/layouts/WelcomeLayout/WelcomeLayout';

import { StartContent } from './StartContent';

Expand Down
2 changes: 1 addition & 1 deletion packages/suite/src/views/view-only/ViewOnlyPromo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

import { WelcomeLayout } from 'src/components/suite';
import { WelcomeLayout } from 'src/components/suite/layouts/WelcomeLayout/WelcomeLayout';

import { ViewOnlyPromoContent } from './ViewOnlyPromoContent';

Expand Down

0 comments on commit 027471d

Please sign in to comment.