Skip to content

Commit 218294d

Browse files
author
soheil
committed
Spread props in the Card component
1 parent 653ce76 commit 218294d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/components/BeaconChainActions.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ const BeaconChainActions: React.FC = () => {
9797
return (
9898
<Box mb={16}>
9999
<Flex flexDir={{ base: "column", md: "row" }} pt={4}>
100-
<Box
101-
as={Card}
100+
<Card
102101
w="full"
103102
ml={0}
104103
mr={{ base: 0, md: 4 }}
@@ -113,9 +112,8 @@ const BeaconChainActions: React.FC = () => {
113112
<ButtonLink variant="outline" to="/staking/">
114113
<Translation id="page-upgrades-index-staking-learn" />
115114
</ButtonLink>
116-
</Box>
117-
<Box
118-
as={Card}
115+
</Card>
116+
<Card
119117
w="full"
120118
mr={0}
121119
ml={{ base: 0, md: 4 }}
@@ -126,7 +124,7 @@ const BeaconChainActions: React.FC = () => {
126124
<ButtonLink variant="outline" to="/upgrades/get-involved/">
127125
<Translation id="consensus-run-beacon-chain" />
128126
</ButtonLink>
129-
</Box>
127+
</Card>
130128
</Flex>
131129
<H3>
132130
<Translation id="consensus-explore" />

src/components/Card.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { ReactNode } from "react"
2-
import { Flex, Heading, Text } from "@chakra-ui/react"
2+
import { ChakraProps, Flex, Heading, Text } from "@chakra-ui/react"
33
import Emoji from "./Emoji"
44

5-
export interface IProps {
5+
export interface IProps extends ChakraProps {
66
children?: React.ReactNode
77
emoji?: string
88
title?: ReactNode
@@ -16,6 +16,7 @@ const Card: React.FC<IProps> = ({
1616
description,
1717
children,
1818
className,
19+
...props
1920
}) => (
2021
<Flex
2122
direction="column"
@@ -28,6 +29,7 @@ const Card: React.FC<IProps> = ({
2829
borderColor="lightBorder"
2930
p={6}
3031
className={className}
32+
{...props}
3133
>
3234
<div>
3335
{emoji && <Emoji fontSize="5xl" text={emoji} mb={4} />}

0 commit comments

Comments
 (0)