Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy v6.6.0 #8038

Merged
merged 102 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
9906104
Add acknowledgements section
lukassim Sep 14, 2022
a4e3c49
Update translation stats
lukassim Sep 14, 2022
6dca72d
Add chart images
lukassim Sep 16, 2022
3f16f12
Remove POAP callout banner
lukassim Sep 16, 2022
e44d717
Update src/content/contributing/translation-program/index.md
lukassim Sep 16, 2022
228b306
Add h4 headings to acknowledgements
lukassim Sep 16, 2022
038a366
Create trnaslation chart image
minimalsm Sep 16, 2022
560e33d
Fix image size
minimalsm Sep 16, 2022
5dc9d79
Fix broken query
minimalsm Sep 16, 2022
e3357c2
Fix query
minimalsm Sep 16, 2022
ed8f53b
Fix image size
minimalsm Sep 16, 2022
372e44d
Fix image
minimalsm Sep 16, 2022
6bf0b0c
Convert to Chakra
minimalsm Sep 16, 2022
7ead002
Touch up architecture
minimalsm Sep 16, 2022
4d3c6bd
refactor: Morpher to Chakra
laurentlucian Sep 16, 2022
1becd05
add paris to upgrade history
jmcook1186 Sep 19, 2022
76e5ea7
update webarchive link
jmcook1186 Sep 19, 2022
22e2587
Update Spanish (es) Homepage, Essentials, Exploring, Use Ethereum buc…
minimalsm Sep 19, 2022
34fa655
Update Homepage buckets: Georgian (ka), German (de), Korean (ko), Rom…
minimalsm Sep 19, 2022
cca2b97
Update Turkish (tr) Homepage, Essentials, Use Ethereum
minimalsm Sep 19, 2022
6773341
refactor: InfoBanner to chakra
ImMiguelP Sep 20, 2022
b42bab7
Update index.md
jmcook1186 Sep 20, 2022
9beb9cf
fix(chakra): media query
ImMiguelP Sep 22, 2022
b82825d
refactor: remove gatsby's link class
laurentlucian Sep 22, 2022
5e24446
refactor: use theme sizes
laurentlucian Sep 22, 2022
fda0a06
refactor: imagecard to chakra
ImMiguelP Sep 22, 2022
e0d54a0
Merge branch 'tp-page-revamp' into translationChartImage
minimalsm Sep 22, 2022
bcb815b
Merge pull request #7874 from ethereum/translationChartImage
minimalsm Sep 22, 2022
7e7f581
Merge branch 'dev' into tp-page-revamp
minimalsm Sep 22, 2022
bb1a1ad
Update src/components/ImageCard.tsx
ImMiguelP Sep 22, 2022
6d6c40d
Update index.md
BenedettiLucca Sep 23, 2022
962dccc
Fix typo
rayzhudev Sep 23, 2022
ed63b76
Remove incorrect zk-stark information
rayzhudev Sep 23, 2022
3c00df3
Minor changes to the OR page
BenedettiLucca Sep 23, 2022
1218ca8
Update Filipino (ph) Homepage and Essentials buckets
minimalsm Sep 23, 2022
1236128
Update Italian (it) Homepage, Essentials, and Use Ethereum buckets
minimalsm Sep 23, 2022
a3a9bbe
Update Indonesian (id) Exploring buckets
minimalsm Sep 23, 2022
c635c66
Update Swedish (se) homepage
minimalsm Sep 23, 2022
1aa0bef
Add Swedish to crowdin import
minimalsm Sep 23, 2022
cc20d38
Add Uzbek (uz) lang and Homepage bucket
minimalsm Sep 23, 2022
a470d56
Add missing header ID on zk page
minimalsm Sep 23, 2022
9553cfb
Merge pull request #7992 from ethereum/updateTurkishTranslations
minimalsm Sep 23, 2022
0afd0b1
Merge pull request #7991 from ethereum/addUzbekLangAndHomepage
minimalsm Sep 23, 2022
8117daf
Merge pull request #7988 from ethereum/updateSwedishHomepage
minimalsm Sep 23, 2022
c9f7fe3
Merge pull request #7887 from laurentlucian/chakra-morpher
pettinarip Sep 23, 2022
363fe17
remove duplicate 'items' word
z3zzz Sep 23, 2022
f3e0998
formatting
pettinarip Sep 23, 2022
c1bd754
adjust styles
pettinarip Sep 23, 2022
aae772e
Merge pull request #7989 from ethereum/updateCrowdinImport
wackerow Sep 23, 2022
656205f
Merge pull request #7929 from ImMiguelP/chakra-infobanner
pettinarip Sep 23, 2022
8249e4d
docs: update README.md [skip ci]
allcontributors[bot] Sep 23, 2022
ca2fc39
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 23, 2022
dbcd340
Merge pull request #8001 from ethereum/all-contributors/add-ImMiguelP
pettinarip Sep 23, 2022
f514110
Apply suggestions from code review
ImMiguelP Sep 23, 2022
8d76e24
formatting + use image prop from GatsbyImage
pettinarip Sep 23, 2022
4eb4044
Merge pull request #8000 from z3zzz/typo-duplicate-items
corwintines Sep 23, 2022
139c4df
Merge pull request #7999 from ethereum/addHeaderIds
corwintines Sep 23, 2022
c57d5c6
Merge pull request #7982 from BenedettiLucca/patch-2
corwintines Sep 23, 2022
122636e
Merge pull request #7959 from ImMiguelP/chakra-imagecard
pettinarip Sep 23, 2022
8128fc0
Merge pull request #7981 from rayzhudev/patch-2
corwintines Sep 23, 2022
66232cd
docs: update README.md [skip ci]
allcontributors[bot] Sep 23, 2022
aacddde
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 23, 2022
cba24ce
Merge pull request #8003 from ethereum/all-contributors/add-rayzhudev
corwintines Sep 23, 2022
f5860de
Merge pull request #7980 from rayzhudev/patch-1
corwintines Sep 23, 2022
1059973
Update src/content/developers/docs/nodes-and-clients/index.md
corwintines Sep 23, 2022
347a878
docs: update README.md [skip ci]
allcontributors[bot] Sep 23, 2022
891ae96
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 23, 2022
f488c17
Merge pull request #8004 from ethereum/all-contributors/add-Benedetti…
corwintines Sep 23, 2022
e44a881
Merge pull request #7979 from BenedettiLucca/patch-1
corwintines Sep 23, 2022
cd264e2
update copy for post-merge
wackerow Sep 23, 2022
8db7d37
Update src/content/history/index.md
wackerow Sep 23, 2022
89ab992
Fixed broken blog link on Running a node page
MacMorgan Sep 24, 2022
f945b6c
Correct hreflang for Filipino
ndrozd Sep 25, 2022
f9ec580
Aria-label for homepage link
ndrozd Sep 25, 2022
457c5a2
Fix: typos
omahs Sep 26, 2022
efb7b2e
Fix: typos
omahs Sep 26, 2022
b2d73e6
Merge pull request #8023 from omahs/dev
minimalsm Sep 26, 2022
e2aff3e
docs: update README.md [skip ci]
allcontributors[bot] Sep 26, 2022
92016d0
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 26, 2022
4df825f
Merge pull request #8027 from ethereum/all-contributors/add-ndrozd
minimalsm Sep 26, 2022
1c8e833
Merge pull request #8020 from ndrozd/fix-aria-label
minimalsm Sep 26, 2022
55005a6
Merge pull request #8019 from ndrozd/fix-hreflang-filipino
minimalsm Sep 26, 2022
23a697f
Merge pull request #8011 from MacMorgan/patch-1
minimalsm Sep 26, 2022
3fdf905
docs: update README.md [skip ci]
allcontributors[bot] Sep 26, 2022
51d80a0
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Sep 26, 2022
970778f
Merge pull request #8028 from ethereum/all-contributors/add-MacMorgan
minimalsm Sep 26, 2022
6020723
Merge pull request #8005 from ethereum/node-post-merge
minimalsm Sep 26, 2022
107bd96
Update stats
lukassim Sep 26, 2022
8376c03
Merge pull request #7986 from ethereum/updateItalianTranslations
minimalsm Sep 26, 2022
1056d4a
Update src/intl/ka/page-index.json
minimalsm Sep 26, 2022
03c7128
Merge pull request #7985 from ethereum/updateFilipinoTranslations
minimalsm Sep 26, 2022
9c48c77
Merge pull request #7935 from ethereum/updateHomepagesMultipleLangs
minimalsm Sep 26, 2022
d2a1b19
Merge pull request #7987 from ethereum/updateIndoTranslations
minimalsm Sep 26, 2022
5e3083d
Merge pull request #7934 from ethereum/updateSpanishTranslations
minimalsm Sep 26, 2022
9b0cc65
Removed reference to "POW" in bug bounty program
fredriksvantes Sep 26, 2022
95ebdc4
Merge pull request #8033 from ethereum/fredriksvantes-patch-1
corwintines Sep 26, 2022
ea87ae7
etherscan link and block clarifier
wackerow Sep 26, 2022
53d5e52
Merge pull request #7922 from ethereum/jc-history
wackerow Sep 26, 2022
1cfa5d0
remove redundant image assets
wackerow Sep 26, 2022
fde1ee9
Merge pull request #7842 from ethereum/tp-page-revamp
corwintines Sep 26, 2022
a1785e5
v6.6.0
corwintines Sep 26, 2022
486bcc9
Merge pull request #8037 from ethereum/v6-6-0
corwintines Sep 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -4661,7 +4661,8 @@
"profile": "https://github.com/ndrozd",
"contributions": [
"bug",
"doc"
"doc",
"a11y"
]
},
{
Expand Down Expand Up @@ -8961,6 +8962,43 @@
"contributions": [
"doc"
]
},
{
"login": "ImMiguelP",
"name": "Miguel",
"avatar_url": "https://avatars.githubusercontent.com/u/61770010?v=4",
"profile": "https://github.com/ImMiguelP",
"contributions": [
"code"
]
},
{
"login": "rayzhudev",
"name": "Ray Zhu",
"avatar_url": "https://avatars.githubusercontent.com/u/20132960?v=4",
"profile": "https://github.com/rayzhudev",
"contributions": [
"doc"
]
},
{
"login": "BenedettiLucca",
"name": "Lucca Benedetti",
"avatar_url": "https://avatars.githubusercontent.com/u/108427035?v=4",
"profile": "https://github.com/BenedettiLucca",
"contributions": [
"doc"
]
},
{
"login": "MacMorgan",
"name": "Mac Morgan",
"avatar_url": "https://avatars.githubusercontent.com/u/17681?v=4",
"profile": "http://www.printfly.com/",
"contributions": [
"doc",
"bug"
]
}
],
"contributorsPerLine": 7,
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr>
<td align="center"><a href="https://github.com/raj-shekhar1"><img src="https://avatars.githubusercontent.com/u/55439064?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Raj Shekhar Bhardwaj</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=raj-shekhar1" title="Documentation">📖</a> <a href="#ideas-raj-shekhar1" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://github.com/joakimengerstam"><img src="https://avatars.githubusercontent.com/u/12713452?v=4?s=100" width="100px;" alt=""/><br /><sub><b>joakimengerstam</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=joakimengerstam" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/ndrozd"><img src="https://avatars.githubusercontent.com/u/6696080?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nikita Drozd</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Androzd" title="Bug reports">🐛</a> <a href="https://github.com/ethereum/ethereum-org-website/commits?author=ndrozd" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/ndrozd"><img src="https://avatars.githubusercontent.com/u/6696080?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nikita Drozd</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3Androzd" title="Bug reports">🐛</a> <a href="https://github.com/ethereum/ethereum-org-website/commits?author=ndrozd" title="Documentation">📖</a> <a href="#a11y-ndrozd" title="Accessibility">️️️️♿️</a></td>
<td align="center"><a href="http://scottcameron.uk"><img src="https://avatars.githubusercontent.com/u/83584447?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Scott</b></sub></a><br /><a href="#design-Scott1UP" title="Design">🎨</a> <a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3AScott1UP" title="Bug reports">🐛</a></td>
<td align="center"><a href="http://stefanrs.me"><img src="https://avatars.githubusercontent.com/u/22087626?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Stefan Sathianathen</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=stefanrsathianathen" title="Documentation">📖</a></td>
<td align="center"><a href="https://miroslavlehotsky.eu/"><img src="https://avatars.githubusercontent.com/u/18735418?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Miroslav Lehotsky</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=mlehotsky13" title="Documentation">📖</a></td>
Expand Down Expand Up @@ -1420,6 +1420,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr>
<td align="center"><a href="https://github.com/d1onys1us"><img src="https://avatars.githubusercontent.com/u/13951458?v=4?s=100" width="100px;" alt=""/><br /><sub><b>d1onys1us</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=d1onys1us" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/thib-web3"><img src="https://avatars.githubusercontent.com/u/66329321?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Thibaut</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=thib-web3" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/ImMiguelP"><img src="https://avatars.githubusercontent.com/u/61770010?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Miguel</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=ImMiguelP" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/rayzhudev"><img src="https://avatars.githubusercontent.com/u/20132960?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ray Zhu</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=rayzhudev" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/BenedettiLucca"><img src="https://avatars.githubusercontent.com/u/108427035?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lucca Benedetti</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=BenedettiLucca" title="Documentation">📖</a></td>
<td align="center"><a href="http://www.printfly.com/"><img src="https://avatars.githubusercontent.com/u/17681?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Mac Morgan</b></sub></a><br /><a href="https://github.com/ethereum/ethereum-org-website/commits?author=MacMorgan" title="Documentation">📖</a> <a href="https://github.com/ethereum/ethereum-org-website/issues?q=author%3AMacMorgan" title="Bug reports">🐛</a></td>
</tr>
</tbody>
</table>
Expand Down
10 changes: 9 additions & 1 deletion i18n/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
},
{
"code": "ph",
"hrefLang": "ph",
"hrefLang": "fil",
"name": "Filipino",
"localName": "Filipino",
"langDir": "ltr",
Expand Down Expand Up @@ -359,6 +359,14 @@
"langDir": "ltr",
"dateFormat": "MM/DD/YYYY"
},
{
"code": "uz",
"hrefLang": "uz",
"name": "Uzbek",
"localName": "O'zbekcha",
"langDir": "ltr",
"dateFormat": "MM/DD/YYYY"
},
{
"code": "vi",
"hrefLang": "vi",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-org-website",
"version": "6.5.0",
"version": "6.6.0",
"description": "Website of ethereum.org",
"main": "index.js",
"repository": "[email protected]:ethereum/ethereum-org-website.git",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 12 additions & 26 deletions src/components/ImageCard.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
import React from "react"
import styled from "@emotion/styled"
import { GatsbyImage, IGatsbyImageData } from "gatsby-plugin-image"

const StyledCard = styled.div`
background: ${(props) => props.theme.colors.searchBackground};
border-radius: 4px;
border: 1px solid ${(props) => props.theme.colors.lightBorder};
padding: 1.5rem;
`

const Image = styled(GatsbyImage)`
& > img {
width: 3em !important;
height: 3em !important;
margin-bottom: 1em !important;
}
`

const Description = styled.p`
opacity: 0.8;
`
import { Box, Heading, Image, Text } from "@chakra-ui/react"

export interface IProps {
children?: React.ReactNode
Expand All @@ -36,14 +17,19 @@ const ImageCard: React.FC<IProps> = ({
title,
description,
children,
className,
}) => (
<StyledCard className={className}>
<Image image={image} alt={alt} />
<h3>{title}</h3>
<Description>{description}</Description>
<Box
bg="searchBackground"
borderRadius="base"
border="1px"
borderColor="lightBorder"
p={6}
>
<Image as={GatsbyImage} image={image} alt={alt} w={12} h={12} mb={4} />
<Heading as="h3">{title}</Heading>
<Text opacity={0.8}>{description}</Text>
{children}
</StyledCard>
</Box>
)

export default ImageCard
95 changes: 31 additions & 64 deletions src/components/InfoBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,60 +1,6 @@
import React from "react"
import styled from "@emotion/styled"
import Emoji from "./OldEmoji"
import { margin } from "styled-system"

const Container = styled.div`
display: flex;
justify-content: center;
`

const Banner = styled.div<{
shouldCenter: boolean
isWarning: boolean
}>`
position: relative;
z-index: 1;
display: flex;
align-items: center;
padding: 1.5rem;
border-radius: 2px;
max-width: ${(props) => (props.shouldCenter ? `55rem` : `100%`)};
color: ${(props) => props.theme.colors.black300};
background: ${(props) =>
props.isWarning
? props.theme.colors.warning
: props.theme.colors.infoBanner};

@media (max-width: ${(props) => props.theme.breakpoints.s}) {
flex-direction: column;
}

${margin}
`

const StyledEmoji = styled(Emoji)`
flex-grow: 0;
flex-shrink: 0;
margin-right: 1.5rem;
@media (max-width: ${(props) => props.theme.breakpoints.s}) {
align-self: flex-start;
margin-right: 0;
margin-bottom: 0.5rem;
}
`

const Content = styled.div<{
shouldSpaceBetween: boolean
}>`
display: ${(props) => (props.shouldSpaceBetween ? `flex` : `block`)};
align-items: ${(props) => (props.shouldSpaceBetween ? `center` : `auto`)};
width: ${(props) => (props.shouldSpaceBetween ? `100%` : `auto`)};
justify-content: ${(props) =>
props.shouldSpaceBetween ? `space-between` : `auto`};
@media (max-width: ${(props) => props.theme.breakpoints.s}) {
display: block;
}
`
import { Flex } from "@chakra-ui/react"
import Emoji from "./Emoji"

export interface IProps {
children?: React.ReactNode
Expand All @@ -75,17 +21,38 @@ const InfoBanner: React.FC<IProps> = ({
...props
}) => {
const banner = (
<Banner
className={className}
isWarning={isWarning}
shouldCenter={shouldCenter}
<Flex
align="center"
p={6}
borderRadius={"sm"}
maxW={shouldCenter ? "55rem" : "100%"}
color="black300"
bg={isWarning ? "warning" : "infoBanner"}
direction={{ base: "column", sm: "row" }}
{...props}
>
{emoji && <StyledEmoji text={emoji} size={2} />}
<Content shouldSpaceBetween={shouldSpaceBetween}>{children}</Content>
</Banner>
{emoji && (
<Emoji
flexGrow="0"
flexShrink="0"
mr={{ base: 0, sm: 6 }}
mb={{ base: 2, sm: 0 }}
alignSelf={{ base: "flex-start", sm: "auto" }}
text={emoji}
fontSize="4xl"
/>
)}
<Flex
display={{ base: "block", sm: shouldSpaceBetween ? "flex" : "block" }}
align={shouldSpaceBetween ? "center" : "auto"}
w={shouldSpaceBetween ? "100%" : "auto"}
justify={shouldSpaceBetween ? "space-between" : "auto"}
>
{children}
</Flex>
</Flex>
)
return shouldCenter ? <Container>{banner}</Container> : banner
return shouldCenter ? <Flex justify="center">{banner}</Flex> : banner
}

export default InfoBanner
24 changes: 8 additions & 16 deletions src/components/Morpher.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
import React, { useState, useEffect } from "react"
import styled from "@emotion/styled"
import Link from "./Link"

const NavLink = styled(Link)`
text-decoration: none;
font-size: 1rem;
color: ${(props) => props.theme.colors.text};
&:hover {
text-decoration: none;
color: ${(props) => props.theme.colors.primary};
}
&.active {
font-weight: bold;
}
`

const Morpher = () => {
const [state, setState] = useState({
text: "Ethereum",
Expand Down Expand Up @@ -154,9 +140,15 @@ const Morpher = () => {
}, [])

return (
<NavLink to="/languages/">
<Link
textDecor="none"
fontSize="md"
color="text"
_hover={{ color: "primary" }}
to="/languages/"
>
<span>{state.text}</span>
</NavLink>
</Link>
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ const Nav: React.FC<IProps> = ({ path }) => {
<NavContainer>
<StyledNav aria-label={translateMessageId("nav-primary", intl)}>
<NavContent>
<HomeLogoNavLink to="/">
<HomeLogoNavLink to="/" aria-label={translateMessageId("home", intl)}>
<HomeLogo />
</HomeLogoNavLink>
{/* Desktop */}
Expand Down
58 changes: 58 additions & 0 deletions src/components/TranslationChartImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from "react"
import { Flex, Image } from "@chakra-ui/react"
import { useColorMode } from "@chakra-ui/react"
import { useStaticQuery, graphql } from "gatsby"
import { GatsbyImage } from "gatsby-plugin-image"
import { getImage } from "../utils/image"

export interface IProps {}

const TranslationChartImage: React.FC<IProps> = () => {
const { colorMode } = useColorMode()
const isDarkTheme = colorMode === "dark"

const data = useStaticQuery(graphql`
{
pageviewsLight: file(
relativePath: { eq: "translation-program/pageviews-light.png" }
) {
childImageSharp {
gatsbyImageData(
height: 500
layout: FIXED
placeholder: BLURRED
quality: 100
)
}
}
pageviewsDark: file(
relativePath: { eq: "translation-program/pageviews-dark.png" }
) {
childImageSharp {
gatsbyImageData(
height: 500
layout: FIXED
placeholder: BLURRED
quality: 100
)
}
}
}
`)

const ethImage = isDarkTheme ? data.pageviewsDark : data.pageviewsLight

return (
<Flex justifyContent="center" objectFit="contain">
<Image
as={GatsbyImage}
image={getImage(ethImage)!}
alt=""
fit="contain"
minW="263px"
/>
</Flex>
)
}

export default TranslationChartImage
Loading