Skip to content

Commit ff6e37f

Browse files
committed
add types and fix image dimensions inside CardList
1 parent 13120d3 commit ff6e37f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/pages/learn.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import OriginalCard, {
2121
import DocLink from "@/components/DocLink"
2222
import FeedbackCard from "@/components/FeedbackCard"
2323
import { HubHero } from "@/components/Hero"
24-
import { Image } from "@/components/Image"
24+
import { Image, type ImageProps } from "@/components/Image"
2525
import LeftNavBar from "@/components/LeftNavBar"
2626
import InlineLink from "@/components/Link"
2727
import { ContentContainer } from "@/components/MdComponents"
@@ -121,6 +121,10 @@ const H3 = ({ children, ...props }: HeadingProps) => (
121121
</OldHeading>
122122
)
123123

124+
type Props = SSRConfig & {
125+
lastDeployDate: string
126+
}
127+
124128
export const getStaticProps = (async (context) => {
125129
const { locale } = context
126130

@@ -134,7 +138,7 @@ export const getStaticProps = (async (context) => {
134138
lastDeployDate,
135139
},
136140
}
137-
}) satisfies GetStaticProps<SSRConfig>
141+
}) satisfies GetStaticProps<Props>
138142

139143
const LearnPage = () => {
140144
const { t } = useTranslation("page-learn")
@@ -195,7 +199,10 @@ const LearnPage = () => {
195199
],
196200
}
197201

198-
const height200 = { h: 200, style: { width: "auto" } }
202+
const height200: Partial<ImageProps> = {
203+
height: 200,
204+
style: { width: "auto", objectFit: "cover" },
205+
}
199206

200207
return (
201208
<Box position="relative" w="full">

0 commit comments

Comments
 (0)