Skip to content

Commit 046bee2

Browse files
committed
update ActionCard and EthVideo components
1 parent d0a4343 commit 046bee2

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

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: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
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 {
6+
type EthVideoProps = {
87
className?: string
98
videoSrc?: string
109
}
1110

12-
const EthVideo: React.FC<IProps> = ({ className, videoSrc }) => {
11+
const EthVideo = ({ videoSrc }: EthVideoProps) => {
1312
const videoFile = useColorModeValue(lightVideo, darkVideo)
1413

15-
const src = videoSrc ? videoSrc : videoFile
14+
const src = videoSrc || videoFile
1615

1716
return (
18-
<Box className={className}>
17+
<Box>
1918
<video
2019
id="hero-video"
2120
width="100%"

0 commit comments

Comments
 (0)