From 75f6acd86531972b7576758edf798fbde676d566 Mon Sep 17 00:00:00 2001 From: amit-ksh Date: Sat, 18 Feb 2023 17:36:31 +0530 Subject: [PATCH 1/4] refactor: page components from emotion to chakra --- src/pages/upgrades/vision.tsx | 168 +++++++++++++++++++++------------- 1 file changed, 105 insertions(+), 63 deletions(-) diff --git a/src/pages/upgrades/vision.tsx b/src/pages/upgrades/vision.tsx index a6e7c569501..95150267008 100644 --- a/src/pages/upgrades/vision.tsx +++ b/src/pages/upgrades/vision.tsx @@ -1,7 +1,15 @@ -import React from "react" -import styled from "@emotion/styled" +import React, { ComponentPropsWithRef, ReactNode } from "react" import { graphql, PageProps } from "gatsby" import { useIntl } from "react-intl" +import { + Box, + Divider, + Flex, + FlexProps, + Heading, + HeadingProps, + useToken, +} from "@chakra-ui/react" import Translation from "../../components/Translation" import Card from "../../components/Card" @@ -16,66 +24,100 @@ import Breadcrumbs from "../../components/Breadcrumbs" import ButtonLink from "../../components/ButtonLink" import PageMetadata from "../../components/PageMetadata" import InfoBanner from "../../components/InfoBanner" -import { - CardContainer, - Content, - Page, - Divider, -} from "../../components/SharedStyledComponents" import FeedbackCard from "../../components/FeedbackCard" import { translateMessageId } from "../../utils/translations" import { getImage } from "../../utils/image" -const ProblemCardContainer = styled(CardContainer)` - max-width: ${(props) => props.theme.breakpoints.l}; - margin: 0 auto; -` +type ChildOnlyProp = { + children: ReactNode +} -const StyledCardContainer = styled(CardContainer)` - margin-top: 2rem; - margin-bottom: 3rem; -` +const Page = (props: ChildOnlyProp) => ( + +) -const H2 = styled.h2` - margin-top: 0; -` +const PageDivider = () => ( + +) -const CenterH2 = styled(H2)` - text-align: center; - margin-bottom: 2rem; -` +const PageContent = (props: ChildOnlyProp) => ( + +) -const CentreCard = styled(Card)` - flex: 1 1 30%; - min-width: 240px; - margin: 1rem; - padding: 1.5rem; - border: 0px; - text-align: center; - @media (max-width: ${(props) => props.theme.breakpoints.l}) { - flex: 1 1 30%; - } -` +const H2 = (props: HeadingProps) => ( + +) -const CentralContent = styled.div` - margin: 0rem 12rem; - justify-content: center; - @media (max-width: ${(props) => props.theme.breakpoints.l}) { - margin: 0rem 0rem; - } -` +const CenterH2 = (props: HeadingProps) => ( +

+) -const TrilemmaContent = styled.div` - width: 100%; - margin: 2rem 0; - background: ${(props) => props.theme.colors.cardGradient}; - padding: 2rem; -` +const H3 = (props: HeadingProps) => ( + +) -const StyledBreadcrumbs = styled(Breadcrumbs)` - justify-content: center; -` +const H6 = (props: HeadingProps) => ( + +) + +const CardContainer = (props: FlexProps) => ( + +) + +const ProblemCardContainer = (props: ChildOnlyProp) => { + const containerMaxWidth = useToken("breakpoints", ["lg"]) + + return +} +const StyledCardContainer = (props: ChildOnlyProp) => ( + +) + +const CentreCard = (props: ComponentPropsWithRef) => ( + +) + +const CentralContent = (props: ChildOnlyProp) => ( + +) + +const TrilemmaContent = (props: ChildOnlyProp) => ( + +) const paths = [ { @@ -136,9 +178,9 @@ const VisionPage = ({ description={translateMessageId("page-upgrades-vision-meta-desc", intl)} /> - - - + + + @@ -186,9 +228,9 @@ const VisionPage = ({

-
- - + + + @@ -202,12 +244,12 @@ const VisionPage = ({ /> ))} - + - - + + @@ -293,9 +335,9 @@ const VisionPage = ({ - - - + + +

@@ -313,7 +355,7 @@ const VisionPage = ({ ))} -
+ ) From 9ee84f61848fbe85f445d62b8af9ba596e769818 Mon Sep 17 00:00:00 2001 From: amit-ksh Date: Sat, 18 Feb 2023 17:58:35 +0530 Subject: [PATCH 2/4] refactor: h3, h6, p, ul and li tags to chakra --- src/pages/upgrades/vision.tsx | 117 +++++++++++++++++----------------- 1 file changed, 60 insertions(+), 57 deletions(-) diff --git a/src/pages/upgrades/vision.tsx b/src/pages/upgrades/vision.tsx index 95150267008..f7e707840a5 100644 --- a/src/pages/upgrades/vision.tsx +++ b/src/pages/upgrades/vision.tsx @@ -8,6 +8,9 @@ import { FlexProps, Heading, HeadingProps, + List, + ListItem, + Text, useToken, } from "@chakra-ui/react" @@ -185,48 +188,48 @@ const VisionPage = ({ -

+ -

-

+ + -

-

+ + {" "} -

-
    -
  • + + + -
  • -
  • + + -
  • -
  • + + -
  • -
  • + + -
  • -
  • + + -
  • -
-

+ + + -

-

+ + -

+ @@ -254,82 +257,82 @@ const VisionPage = ({ -

+

{" "} -

-

+

+ -

-

+ + -

-

+ + {" "} {" "} -

-

+ +

{" "} -

-

+ + -

-

+ + {" "} {" "} -

-

+ + {" "} -

-

+ + -

-

+ + -

-

+ + {" "} -

+
-

+

{" "} -

-

+ + -

-

+ + {" "} -

-

+ + {" "} -

-

+ + -

+ -

+ -

+ @@ -351,7 +354,7 @@ const VisionPage = ({ description={upgrade.description} to={upgrade.to} > -
{upgrade.date}
+
{upgrade.date}
))} From 8038472b1d904afd35f0e0ceeeab3f42f8785092 Mon Sep 17 00:00:00 2001 From: amit-ksh Date: Tue, 28 Feb 2023 20:04:39 +0530 Subject: [PATCH 3/4] H2 margin --- src/pages/upgrades/vision.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/upgrades/vision.tsx b/src/pages/upgrades/vision.tsx index f7e707840a5..9b8d27a30ab 100644 --- a/src/pages/upgrades/vision.tsx +++ b/src/pages/upgrades/vision.tsx @@ -57,7 +57,7 @@ const H2 = (props: HeadingProps) => ( ( /> ) -const CenterH2 = (props: HeadingProps) => ( -

-) +const CenterH2 = (props: HeadingProps) =>

const H3 = (props: HeadingProps) => ( Date: Thu, 2 Mar 2023 10:46:58 -0300 Subject: [PATCH 4/4] reuse type --- src/pages/upgrades/vision.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/upgrades/vision.tsx b/src/pages/upgrades/vision.tsx index 9b8d27a30ab..f3bf4cbf2ed 100644 --- a/src/pages/upgrades/vision.tsx +++ b/src/pages/upgrades/vision.tsx @@ -1,4 +1,4 @@ -import React, { ComponentPropsWithRef, ReactNode } from "react" +import React, { ComponentPropsWithRef } from "react" import { graphql, PageProps } from "gatsby" import { useIntl } from "react-intl" import { @@ -32,9 +32,7 @@ import FeedbackCard from "../../components/FeedbackCard" import { translateMessageId } from "../../utils/translations" import { getImage } from "../../utils/image" -type ChildOnlyProp = { - children: ReactNode -} +import type { ChildOnlyProp } from "../../types" const Page = (props: ChildOnlyProp) => (