Skip to content

Commit f7f3cbf

Browse files
authored
Merge pull request #180 from ethereum/eth-page
Add "What is ETH" page
2 parents e20f8f3 + aaba7e4 commit f7f3cbf

File tree

7 files changed

+605
-30
lines changed

7 files changed

+605
-30
lines changed

next.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ module.exports = (phase, { defaultConfig }) => {
2929
test: /\.svg$/,
3030
use: "@svgr/webpack",
3131
})
32+
config.module.rules.push({
33+
test: /\.mp4$/,
34+
use: {
35+
loader: 'file-loader',
36+
options: {
37+
name: '[name].[ext]',
38+
},
39+
},
40+
});
3241

3342
return config
3443
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@emotion/styled": "^11.11.0",
2424
"clipboard": "^2.0.11",
2525
"ethereum-blockies-base64": "^1.0.2",
26+
"file-loader": "^6.2.0",
2627
"focus-trap-react": "^10.2.3",
2728
"framer-motion": "^10.13.0",
2829
"gray-matter": "^4.0.3",

src/components/ActionCard.tsx

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import React, { ReactNode } from "react"
2-
import { StaticImageData } from "next/image"
1+
import type { ReactNode } from "react"
32
import {
43
Box,
5-
BoxProps,
4+
type BoxProps,
65
Flex,
76
Heading,
87
LinkBox,
9-
LinkBoxProps,
8+
type LinkBoxProps,
109
LinkOverlay,
1110
useColorModeValue,
1211
} from "@chakra-ui/react"
1312

14-
import { Image } from "@/components/Image"
13+
import { Image, type ImageProps } from "@/components/Image"
1514
import { BaseLink } from "@/components/Link"
1615
import Text from "@/components/OldText"
1716

@@ -27,19 +26,19 @@ const linkFocusStyles: BoxProps = {
2726
textDecoration: "none",
2827
}
2928

30-
export interface IProps extends Omit<LinkBoxProps, "title"> {
31-
children?: React.ReactNode
29+
export type ActionCardProps = Omit<LinkBoxProps, "title"> & {
30+
children?: ReactNode
3231
to: string
3332
alt?: string
34-
image: StaticImageData
33+
image: ImageProps["src"]
3534
title: ReactNode
3635
description?: ReactNode
3736
className?: string
3837
isRight?: boolean
3938
isBottom?: boolean
4039
}
4140

42-
const ActionCard: React.FC<IProps> = ({
41+
const ActionCard = ({
4342
to,
4443
alt,
4544
image,
@@ -49,8 +48,8 @@ const ActionCard: React.FC<IProps> = ({
4948
className,
5049
isRight,
5150
isBottom = true,
52-
...rest
53-
}) => {
51+
...props
52+
}: ActionCardProps) => {
5453
const descriptionColor = useColorModeValue("blackAlpha.700", "whiteAlpha.800")
5554

5655
return (
@@ -64,7 +63,7 @@ const ActionCard: React.FC<IProps> = ({
6463
_focus={linkBoxFocusStyles}
6564
className={className}
6665
m={4}
67-
{...rest}
66+
{...props}
6867
>
6968
<Flex
7069
h="260px"
@@ -77,12 +76,8 @@ const ActionCard: React.FC<IProps> = ({
7776
>
7877
<Image
7978
src={image}
80-
width={320}
79+
width={220}
8180
alt={alt || ""}
82-
maxH="257px"
83-
maxW={{ base: "311px", sm: "372px" }}
84-
minW="100px"
85-
minH="100px"
8681
style={{ objectFit: "cover" }}
8782
/>
8883
</Flex>

src/components/EthVideo.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
import React from "react"
21
import { Box, useColorModeValue } from "@chakra-ui/react"
32

4-
import darkVideo from "../../public/ethereum-hero-dark.mp4"
5-
import lightVideo from "../../public/ethereum-hero-light.mp4"
3+
import darkVideo from "@/public/ethereum-hero-dark.mp4"
4+
import lightVideo from "@/public/ethereum-hero-light.mp4"
65

7-
export interface IProps {
8-
className?: string
9-
videoSrc?: string
10-
}
11-
12-
const EthVideo: React.FC<IProps> = ({ className, videoSrc }) => {
13-
const videoFile = useColorModeValue(lightVideo, darkVideo)
14-
15-
const src = videoSrc ? videoSrc : videoFile
6+
const EthVideo = () => {
7+
const src = useColorModeValue(lightVideo, darkVideo)
168

179
return (
18-
<Box className={className}>
10+
<Box>
1911
<video
2012
id="hero-video"
2113
width="100%"

src/lib/utils/translations.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ const getRequiredNamespacesForPath = (path: string) => {
6666
]
6767
}
6868

69+
if (path.startsWith("/eth")) {
70+
requiredNamespaces = [...requiredNamespaces, "page-eth"]
71+
}
72+
6973
if (path.startsWith("/glossary")) {
7074
requiredNamespaces = [...requiredNamespaces, "glossary"]
7175
}
@@ -139,6 +143,7 @@ const getRequiredNamespacesForPath = (path: string) => {
139143
path.startsWith("/nft") ||
140144
path.startsWith("/roadmap/merge") ||
141145
path.startsWith("/security") ||
146+
path.startsWith("/eth") ||
142147
path.startsWith("/wallets") ||
143148
path.startsWith("/web3") ||
144149
path.startsWith("/quizzes")

0 commit comments

Comments
 (0)