From f57f90d7d64f27d7a3eed3ea71586525527ed850 Mon Sep 17 00:00:00 2001 From: Sinthusan <56731626+sin2san@users.noreply.github.com> Date: Sun, 9 Jun 2024 17:21:53 +0800 Subject: [PATCH] Set minimum width for screen resolution (#159) Co-authored-by: sinthu-natc Co-authored-by: Karthik Jayaraman --- src/App.tsx | 121 +++++++++++++++--- src/utilities/useGetDdimensionsHook/index.ts | 1 + .../useGetDimensionsHook.tsx | 26 ++++ 3 files changed, 133 insertions(+), 15 deletions(-) create mode 100644 src/utilities/useGetDdimensionsHook/index.ts create mode 100644 src/utilities/useGetDdimensionsHook/useGetDimensionsHook.tsx diff --git a/src/App.tsx b/src/App.tsx index c15c25a..1f8a556 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,28 +1,119 @@ -import { ChakraProvider } from "@chakra-ui/react"; -import { AuthProvider } from "./services/firebase/authProvider"; -import Routing from "./routing"; -import { Paths } from "./routing/Paths"; +import { + ChakraProvider, + Box, + Text, + Center, + VStack, + Image, + Flex, + HStack, +} from "@chakra-ui/react"; +import { useGetWindowDimensionsHook } from "./utilities/useGetDdimensionsHook"; +import logo from "./assets/images/logo/Mendisphere Logo colour.png"; import Header from "./components/Header"; import Footer from "./components/Footer"; +import { AuthProvider } from "./services/firebase/authProvider"; import mendisphereTheme from "./theme/index"; +import { Route, Routes } from "react-router-dom"; +import { Paths } from "./routing/Paths"; +import Home from "./pages/Home"; +import Login from "./pages/Login"; +import UserDashboard from "./pages/UserDashboard"; +import Registration from "./pages/Registration"; +import ProfileSetup from "./pages/Registration/ProfileSetup"; +import OrganisationList from "./pages/OrganisationList"; +import OrganisationProfile from "./pages/OrganisationProfile"; +import FirestoreMockPage from "./mocks/FirestoreMock"; function App() { - // Get current page - const currentPage = window.location.pathname; + const { width } = useGetWindowDimensionsHook(); + + const isNotDesktopWidth = width <= 720; + if (isNotDesktopWidth) { + return ( + + + + + + - // Check the current page is not login and registration page - const isShowHeaderAndFooter = ![ - Paths.login, - Paths.signup, - Paths.profileSetup, - ].includes(currentPage); + + + + + + + Site not optimised for mobile resolution + + + For the best possible experience, please access the portal + via desktop or laptop with a screen resolution width of 720 + px or higher. + + + + +
+ disclaimer +
+
+
+
+
+
+ ); + } return ( - {isShowHeaderAndFooter &&
} - - {isShowHeaderAndFooter &&