Skip to content

Conversation

MrJithil
Copy link
Contributor

@MrJithil MrJithil commented Feb 6, 2023

Migrating the assets to Chakra UI

Description

There are some margin difference of Hero Container. I am not sure, whether we need to customise it each page, or we are following the new Chakra design. Please comment after checking the PR website deployment.

Related Issue

#9353

@github-actions github-actions bot added content 🖋️ This involves copy additions or edits review needed 👀 labels Feb 6, 2023
@MrJithil MrJithil force-pushed the migrate-to-chakraui-assets branch 3 times, most recently from 41df937 to 3644517 Compare February 6, 2023 03:02
@gatsby-cloud
Copy link

gatsby-cloud bot commented Feb 6, 2023

✅ ethereum-org-website-dev deploy preview ready

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @MrJithil 💪🏼

There are some margin difference of Hero Container. I am not sure, whether we need to customise it each page, or we are following the new Chakra design. Please comment after checking the PR website deployment.

What we try to achieve at this stage is to just migrate the existing emotion components to Chakra components, keeping the same styles we had. So, in theory, we should see the exact same page we currently have in production (same styles).

Later, when we implement our new Design System, our plan is to consolidate a lot of these repeated components that we have across different layouts/pages.

// Libraries
import React from "react"
import { useIntl } from "react-intl"
import { useTheme } from "@emotion/react"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use this anymore. Use the chakra one pls.

margin: 2rem;
}
`
import { Box, Center, Flex, Heading, Img, VStack } from "@chakra-ui/react"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import order. Lets put 3rd party imports at the top.

/>
<Content>
<HeroContainer>
<Header>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are missing this Header styles.

: data.ethDiamondBlackHero
return (
<Page>
<Flex direction={"column"} width="full">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To follow conventions, lets not wrap the value if it is a string literal (this applies also to the rest of the changes).

Suggested change
<Flex direction={"column"} width="full">
<Flex direction="column" width="full">

<HeroContainer>
<Header>
<Image
<Box padding={"1rem 2rem"}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To follow conventions, lets use as much as we can, chakra values. You can see them here.

Suggested change
<Box padding={"1rem 2rem"}>
<Box py={4} px={8}>

<Header>
<Image
<Box padding={"1rem 2rem"}>
<Flex direction={"column"} margin="2rem 0rem">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Flex direction={"column"} margin="2rem 0rem">
<Flex direction="column" my={8}>

Comment on lines 44 to 51
image={getImage(assetPageHeroImage)!}
as={GatsbyImage}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
image={getImage(assetPageHeroImage)!}
as={GatsbyImage}
as={GatsbyImage}
image={getImage(assetPageHeroImage)!}

artistUrl="https://cargocollective.com/willtempest"
/>
</Row>
<Flex>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Row has more styles that are missing here for mobile responsiveness.

@MrJithil MrJithil force-pushed the migrate-to-chakraui-assets branch from 3644517 to d0bf693 Compare February 23, 2023 09:16
Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MrJithil

I've unified the Row components and add some missing styles on the headings.

@pettinarip pettinarip merged commit e559c54 into ethereum:dev Mar 7, 2023
@corwintines corwintines mentioned this pull request Mar 7, 2023
@JithilNCA
Copy link

Thank You.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

archived: chakra-migration content 🖋️ This involves copy additions or edits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants