Skip to content

Commit 004fada

Browse files
Merge branch 'dev' into issue#9978
2 parents ebfff1f + d7a9cce commit 004fada

File tree

4 files changed

+208
-222
lines changed

4 files changed

+208
-222
lines changed

src/components/Callout.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// Libraries
22
import React from "react"
33
import { GatsbyImage, IGatsbyImageData } from "gatsby-plugin-image"
4-
import Translation from "./Translation"
5-
import { TranslationKey } from "../utils/translations"
4+
import { Flex, FlexProps, Heading, Image, Text } from "@chakra-ui/react"
5+
66
// Components
7+
import Translation from "./Translation"
78
import Emoji from "./Emoji"
8-
import { Flex, Heading, Image, Text } from "@chakra-ui/react"
99

10-
export interface IProps {
10+
import type { TranslationKey } from "../utils/translations"
11+
12+
export interface IProps extends FlexProps {
1113
children?: React.ReactNode
1214
image?: IGatsbyImageData
1315
emoji?: string
@@ -25,6 +27,7 @@ const Callout: React.FC<IProps> = ({
2527
descriptionKey,
2628
children,
2729
className,
30+
...rest
2831
}) => (
2932
<Flex
3033
direction="column"
@@ -40,6 +43,7 @@ const Callout: React.FC<IProps> = ({
4043
mb={{ base: 16, lg: 4 }}
4144
borderRadius="base"
4245
className={className}
46+
{...rest}
4347
>
4448
{image && (
4549
<Image

src/components/CardList.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { ReactNode } from "react"
22
import { GatsbyImage, IGatsbyImageData } from "gatsby-plugin-image"
33
import {
44
Box,
5+
BoxProps,
56
Flex,
67
HStack,
78
LinkBox,
@@ -23,7 +24,7 @@ export type CardListItem = {
2324
alt?: string
2425
}
2526

26-
export interface IProps {
27+
export interface IProps extends BoxProps {
2728
content: Array<CardListItem>
2829
clickHandler?: (idx: string | number) => void
2930
}
@@ -91,8 +92,12 @@ const Card = (props: CardListItem & Omit<StackProps, "title" | "id">) => {
9192
)
9293
}
9394

94-
const CardList: React.FC<IProps> = ({ content, clickHandler = () => null }) => (
95-
<Box bg="background" width="full">
95+
const CardList: React.FC<IProps> = ({
96+
content,
97+
clickHandler = () => null,
98+
...rest
99+
}) => (
100+
<Box bg="background" w="full" {...rest}>
96101
{content.map((listItem, idx) => {
97102
const { link, id } = listItem
98103
const isLink = !!link

src/components/HorizontalCard.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import React, { ReactNode } from "react"
22
import Emoji from "./Emoji"
3-
import { Text, Box, Flex } from "@chakra-ui/react"
3+
import { Text, Box, Flex, FlexProps } from "@chakra-ui/react"
44

5-
export interface IProps {
6-
children?: React.ReactNode
5+
export interface IProps extends FlexProps {
76
emoji: string
8-
title?: ReactNode
97
description: ReactNode
108
className?: string
119
emojiSize?: number
@@ -18,15 +16,16 @@ const HorizontalCard: React.FC<IProps> = ({
1816
children,
1917
className,
2018
emojiSize,
19+
...rest
2120
}) => (
22-
<Flex borderRadius="base" className={className}>
21+
<Flex borderRadius="base" className={className} {...rest}>
2322
<Emoji fontSize={`${emojiSize}rem`} text={emoji} />
2423
<Box flexGrow="0" flexShrink="1" flexBasis="75%" ml="8">
2524
<Text fontSize="lg">{title}</Text>
2625
<Text opacity="0.8" mt="-4" mb="2">
2726
{description}
2827
</Text>
29-
{children}
28+
<>{children}</>
3029
</Box>
3130
</Flex>
3231
)

0 commit comments

Comments
 (0)