From a84261b000ac53fb08510901d929b4d67c28b21b Mon Sep 17 00:00:00 2001 From: CARLOS TRIGO Date: Thu, 7 Dec 2023 14:10:26 +0100 Subject: [PATCH 01/17] adjust routes based on isMobile hook --- .../base-route-mobile/base-route-mobile.tsx | 76 +++++ .../src/components/base-route-mobile/index.ts | 1 + .../components/base-route-mobile/styles.ts | 78 +++++ frontend/src/components/index.ts | 1 + frontend/src/navigation/route-names.ts | 4 + frontend/src/navigation/routes.tsx | 38 ++- .../create-character-mobile/confirmation.tsx | 52 +++ .../create-character-mobile.tsx | 125 +++++++ .../pages/create-character-mobile/index.ts | 1 + .../create-character-mobile/information.tsx | 115 +++++++ .../pages/create-character-mobile/payment.tsx | 91 ++++++ .../pages/create-character-mobile/styles.ts | 305 ++++++++++++++++++ frontend/src/pages/index.ts | 3 + frontend/src/pages/landing-mobile/index.ts | 1 + .../pages/landing-mobile/landing-mobile.tsx | 222 +++++++++++++ frontend/src/pages/landing-mobile/styles.ts | 104 ++++++ 16 files changed, 1204 insertions(+), 13 deletions(-) create mode 100644 frontend/src/components/base-route-mobile/base-route-mobile.tsx create mode 100644 frontend/src/components/base-route-mobile/index.ts create mode 100644 frontend/src/components/base-route-mobile/styles.ts create mode 100644 frontend/src/pages/create-character-mobile/confirmation.tsx create mode 100644 frontend/src/pages/create-character-mobile/create-character-mobile.tsx create mode 100644 frontend/src/pages/create-character-mobile/index.ts create mode 100644 frontend/src/pages/create-character-mobile/information.tsx create mode 100644 frontend/src/pages/create-character-mobile/payment.tsx create mode 100644 frontend/src/pages/create-character-mobile/styles.ts create mode 100644 frontend/src/pages/landing-mobile/index.ts create mode 100644 frontend/src/pages/landing-mobile/landing-mobile.tsx create mode 100644 frontend/src/pages/landing-mobile/styles.ts diff --git a/frontend/src/components/base-route-mobile/base-route-mobile.tsx b/frontend/src/components/base-route-mobile/base-route-mobile.tsx new file mode 100644 index 000000000..8e9cd6fb6 --- /dev/null +++ b/frontend/src/components/base-route-mobile/base-route-mobile.tsx @@ -0,0 +1,76 @@ +import React, { FC, useMemo } from "react"; + +import { text } from "../../assets"; +import { routes } from "../../navigation"; +import { Footer } from "../footer"; +import { NavigationSection, NavigationTab } from "../navigation-tab"; +import { Box, ChildrenContainer, FooterContainer, RightBox, TopbarContainer } from "./styles"; +import { useCharacterBuilder } from "../../context/character-builder-context"; +import { MAIN_MODE, Section } from "../../constants"; +import { useLocation, useNavigate, useParams } from "react-router-dom"; +import { SwitchSelector } from "../switch-selector"; +import { KreadContainer } from "../../pages/shop/styles"; +import { KreadIcon } from "../logo/styles"; +import { ButtonText, PrimaryButton } from "../atoms"; +import { color } from "../../design"; +import { useKadoWidget } from "../../context/filter-context"; +import styled from "@emotion/styled"; +import { BuyCryptoButton } from "../base-route/base-route"; + +interface BaseRouteProps { + sideNavigation: React.ReactNode; + children?: React.ReactNode; + onboarding?: boolean; + isLanding?: boolean; + isShop?: boolean; +} + +export const BaseRouteMobile: FC = ({ children, sideNavigation, onboarding = false, isLanding = false, isShop = false }) => { + const isOnboarding = onboarding ? routes.onboarding : routes.character; + const { interactionMode } = useCharacterBuilder(); + + const { pathname } = useLocation(); + const { section } = useParams<{ section: Section }>(); + const navigate = useNavigate(); + const home = () => { + navigate(routes.character); + }; + + const pageSelector = useMemo( + () => ( + + ), + [section, pathname], + ); + + return ( + <> + {interactionMode === MAIN_MODE && ( + + + + + + + + + + + {isShop && } + {!isLanding && <>{pageSelector}} + {sideNavigation} + + + )} + {children} + +