Skip to content

Commit

Permalink
fix: Hoist main element higher up DOM tree (#2994)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Apr 8, 2024
1 parent cdd78e9 commit 7eafaf2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion editor.planx.uk/src/pages/Preview/ResumePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const EmailRequired: React.FC<{ setEmail: (email: string) => void }> = ({
});

return (
<Box width="100%" component="main" id="main-content">
<Box width="100%">
<Card handleSubmit={formik.handleSubmit}>
<QuestionHeader
title="Resume your application"
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/pages/Preview/SaveAndReturn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const ConfirmEmail: React.FC<{
});

return (
<Box width="100%" component="main" id="main-content">
<Box width="100%">
<Card handleSubmit={formik.handleSubmit}>
<QuestionHeader
title="Enter your email address"
Expand Down
13 changes: 11 additions & 2 deletions editor.planx.uk/src/pages/layout/SaveAndReturnLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Box from "@mui/material/Box";
import { NotFoundError } from "navi";
import { useStore } from "pages/FlowEditor/lib/store";
import React, { PropsWithChildren } from "react";
Expand All @@ -22,8 +23,16 @@ const SaveAndReturnLayout = ({ children }: PropsWithChildren) => {
{
{
[AppPath.SingleSession]: children,
[AppPath.Save]: <SavePage />,
[AppPath.Resume]: <ResumePage />,
[AppPath.Save]: (
<Box component="main" id="main-content">
<SavePage />
</Box>
),
[AppPath.Resume]: (
<Box component="main" id="main-content">
<ResumePage />
</Box>
),
[AppPath.SaveAndReturn]: <SaveAndReturn>{children}</SaveAndReturn>,
}[path]
}
Expand Down
5 changes: 4 additions & 1 deletion editor.planx.uk/src/routes/views/standalone.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Box from "@mui/material/Box";
import gql from "graphql-tag";
import { publicClient } from "lib/graphql";
import { NaviRequest, NotFoundError } from "navi";
Expand Down Expand Up @@ -37,7 +38,9 @@ const standaloneView = async (req: NaviRequest) => {

return (
<PublicLayout>
<View />
<Box component="main" id="main-content">
<View />
</Box>
</PublicLayout>
);
};
Expand Down

0 comments on commit 7eafaf2

Please sign in to comment.