Skip to content

Commit

Permalink
also do IndexCards
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Lozano committed Dec 13, 2023
1 parent 38b9787 commit 447d4d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/site/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Link from 'next/link'
<section style={{['--brand-Card-maxWidth']: '100%',maxWidth: '800px',margin: '0 auto', ['--brand-Grid-spacing-row']: 'var(--brand-Grid-spacing-column-gap)'}}>
<Grid>
<Grid.Column span={12}>
<Link legacyBehavior href="/getting-started/introduction">
<Link legacyBehavior passHref href="/getting-started/introduction">
<Card href="#" hasBorder style={{width: '100%'}}>
<Card.Image
src="https://assetgeneratorstorage.blob.core.windows.net/user-generated-dev/product-landscape/84aa222c-3857-4e6c-bf6b-0b759ebf4122-1200x630-inline.png"
Expand Down
16 changes: 9 additions & 7 deletions packages/theme/components/layout/index-cards/IndexCards.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import {Card, Grid} from '@primer/react-brand'
import {Folder, MdxFile} from 'nextra'
import {useRouter} from 'next/router'

import styles from './IndexCards.module.css'
import Link from 'next/link'

type IndexCardsProps = {
route: string
Expand All @@ -30,12 +30,14 @@ export function IndexCards({route, folderData}: IndexCardsProps) {
if (item.kind !== 'MdxPage') return null
return (
<Grid.Column span={{medium: 6}} key={`cell-${item.route}`}>
<Card href={item.route} hasBorder style={{width: '100%'}}>
{item.frontMatter && <Card.Heading>{item.frontMatter.title}</Card.Heading>}
{item.frontMatter && item.frontMatter.description && (
<Card.Description>{item.frontMatter.description}</Card.Description>
)}
</Card>
<Link href={item.route} legacyBehavior passHref>
<Card href="#" hasBorder style={{width: '100%'}}>
{item.frontMatter && <Card.Heading>{item.frontMatter.title}</Card.Heading>}
{item.frontMatter && item.frontMatter.description && (
<Card.Description>{item.frontMatter.description}</Card.Description>
)}
</Card>
</Link>
</Grid.Column>
)
})}
Expand Down

0 comments on commit 447d4d5

Please sign in to comment.