From edfcea04192fd098531f512ec45c45b47e209af3 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 19 Feb 2024 17:40:28 +0100 Subject: [PATCH] Make the layout wider on "account" pages This also fixes a bug where a double "layout" was applied to the not found pages. It also sets the layout min height to use 100svh instead of 100vh, so that it doesn't unecessarily scroll on iOS. --- .../src/components/Layout/Layout.module.css | 8 ++ frontend/src/components/Layout/Layout.tsx | 7 +- .../LoadingScreen/LoadingScreen.module.css | 6 +- .../src/components/NavBar/NavBar.module.css | 1 - frontend/src/main.tsx | 5 +- frontend/src/routes/_account.tsx | 5 +- frontend/src/routes/clients.$id.tsx | 7 +- frontend/src/routes/devices.$id.tsx | 17 ++-- frontend/src/routes/emails.$id.verify.tsx | 7 +- frontend/src/routes/reset-cross-signing.tsx | 99 ++++++++++--------- 10 files changed, 95 insertions(+), 67 deletions(-) diff --git a/frontend/src/components/Layout/Layout.module.css b/frontend/src/components/Layout/Layout.module.css index 3b7d3d33..2d04a4db 100644 --- a/frontend/src/components/Layout/Layout.module.css +++ b/frontend/src/components/Layout/Layout.module.css @@ -19,11 +19,19 @@ flex-direction: column; max-width: calc(420px + var(--cpd-space-5x) * 2); + + /* Fallback for browsers that do not support 100svh */ min-height: 100vh; + min-height: 100svh; + margin: 0 auto; padding-inline: var(--cpd-space-5x); padding-block: var(--cpd-space-12x); gap: var(--cpd-space-8x); + + &.wide { + max-width: calc(520px + var(--cpd-space-5x) * 2); + } } @media screen and (min-width: 768px) { diff --git a/frontend/src/components/Layout/Layout.tsx b/frontend/src/components/Layout/Layout.tsx index 5ae6bb5b..a68c9952 100644 --- a/frontend/src/components/Layout/Layout.tsx +++ b/frontend/src/components/Layout/Layout.tsx @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +import cx from "classnames"; + import appConfig from "../../config"; import Footer from "../Footer"; @@ -20,8 +22,9 @@ import styles from "./Layout.module.css"; const Layout: React.FC<{ children?: React.ReactNode; dontSuspend?: boolean; -}> = ({ children, dontSuspend }) => ( -
+ wide?: boolean; +}> = ({ children, dontSuspend, wide }) => ( +
{children}