From b7fc9e8542ed487330260eef77ab64fd50426e68 Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Tue, 9 Feb 2021 01:09:58 +0200 Subject: [PATCH] new design initial --- components/builds/BuildCard.tsx | 1 - components/common/Breadcrumbs.tsx | 1 - components/common/MyContainer.tsx | 12 ++++++--- components/common/Section.tsx | 18 ------------- components/layout/Banner.tsx | 39 ++++++++++++---------------- components/layout/IconNavBar.tsx | 4 +-- components/layout/index.tsx | 32 +++++++++++++++++++---- components/t/TeamManagementModal.tsx | 7 ++++- pages/sr/player/[id].tsx | 7 +++-- pages/t/[team].tsx | 3 ++- pages/xtrends.tsx | 5 ++-- 11 files changed, 67 insertions(+), 62 deletions(-) delete mode 100644 components/common/Section.tsx diff --git a/components/builds/BuildCard.tsx b/components/builds/BuildCard.tsx index 4dfb6c6b9..d162f5fbc 100644 --- a/components/builds/BuildCard.tsx +++ b/components/builds/BuildCard.tsx @@ -55,7 +55,6 @@ const BuildCard: React.FC = ({ rounded="lg" overflow="hidden" boxShadow="md" - bg={secondaryBgColor} p="20px" {...props} > diff --git a/components/common/Breadcrumbs.tsx b/components/common/Breadcrumbs.tsx index c11d403be..349da1ac6 100644 --- a/components/common/Breadcrumbs.tsx +++ b/components/common/Breadcrumbs.tsx @@ -22,7 +22,6 @@ const Breadcrumbs: React.FC = ({ pages }) => { <> = ({ children, wide = false }) => ( - {children} +const MyContainer: React.FC = ({ + children, + wide = false, + ...props +}) => ( + + {children} + ); export default MyContainer; diff --git a/components/common/Section.tsx b/components/common/Section.tsx deleted file mode 100644 index f7a40b070..000000000 --- a/components/common/Section.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { Box, BoxProps } from "@chakra-ui/react"; -import { useMyTheme } from "hooks/common"; - -const Section: React.FC = (props) => { - const { secondaryBgColor } = useMyTheme(); - return ( - - ); -}; - -export default Section; diff --git a/components/layout/Banner.tsx b/components/layout/Banner.tsx index 89d5979e2..ae2002707 100644 --- a/components/layout/Banner.tsx +++ b/components/layout/Banner.tsx @@ -1,13 +1,12 @@ -import { Box, Image } from "@chakra-ui/react"; -import MyContainer from "components/common/MyContainer"; +import { Box, Skeleton } from "@chakra-ui/react"; const event = { - bg: "#3F3F3F", + bg: "yellow", logoUrl: "https://abload.de/img/screenshot2021-01-29agyjt6.png", - staleAfter: "2021-02-08", // always +1 from when the event ends?, + staleAfter: "2020-03-08", // always +1 from when the event ends?, link: "https://twitter.com/NineWholeGrains/status/1353110481721040897", content: - "Grand Graining Grounds is happening on February 6th and 7th. Starting prize pool of $2500!", + "Grand Graining Grounds is happening on February 6th and 7th. Starting prize pool of $2500! ", } as const; const Banner = () => { @@ -15,25 +14,19 @@ const Banner = () => { return ( - - - + + {event.content} - - + + ); }; diff --git a/components/layout/IconNavBar.tsx b/components/layout/IconNavBar.tsx index 6ccc50af3..24be5e70f 100644 --- a/components/layout/IconNavBar.tsx +++ b/components/layout/IconNavBar.tsx @@ -128,10 +128,10 @@ const IconNavBar = () => { {navIcons.map(({ displayName, code, menuItems }) => { if (!menuItems.length) { diff --git a/components/layout/index.tsx b/components/layout/index.tsx index d26e1d117..f9bf0acc1 100644 --- a/components/layout/index.tsx +++ b/components/layout/index.tsx @@ -1,6 +1,7 @@ import { Flex, useToast } from "@chakra-ui/react"; import { t } from "@lingui/macro"; import MyContainer from "components/common/MyContainer"; +import { useMyTheme } from "hooks/common"; import { useState } from "react"; import { SWRConfig } from "swr"; import Banner from "./Banner"; @@ -10,10 +11,19 @@ import TopNav from "./TopNav"; const DATE_KEYS = ["createdAt", "updatedAt"]; +const WIDE = ["analyzer", "plans", "builds", "u/"]; + const Layout = ({ children }: { children: React.ReactNode }) => { + const { secondaryBgColor } = useMyTheme(); const [errors, setErrors] = useState(new Set()); const toast = useToast(); + const isWide = + window && + WIDE.some((widePage) => + window.location.pathname.startsWith("/" + widePage) + ); + return ( { }, }} > - - - - - {children} + + + + + + + + {children} +