-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix breadcrum base path, added index cards and removed index pages fr…
…om sidebar
- Loading branch information
Showing
8 changed files
with
94 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/theme/components/layout/index-cards/IndexCards.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.IndexCards { | ||
--brand-Card-maxWidth: 100%; | ||
} |
37 changes: 37 additions & 0 deletions
37
packages/theme/components/layout/index-cards/IndexCards.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {Card, Grid} from '@primer/react-brand' | ||
import {MdxFile} from 'nextra' | ||
|
||
import styles from './IndexCards.module.css' | ||
|
||
type IndexCardsProps = { | ||
route: string | ||
folderData: DocsItem[] | ||
} | ||
|
||
type DocsItem = MdxFile & { | ||
title: string | ||
type: string | ||
children?: DocsItem[] | ||
firstChildRoute?: string | ||
withIndexPage?: boolean | ||
isUnderCurrentDocsTree?: boolean | ||
} | ||
|
||
export function IndexCards({route, folderData}: IndexCardsProps) { | ||
const filteredData = folderData.filter(item => item.kind === 'MdxPage' && item.route.includes(`${route}/`)) | ||
|
||
return ( | ||
<Grid className={styles.IndexCards}> | ||
{filteredData.map((item: DocsItem, index) => { | ||
return ( | ||
<Grid.Column span={{medium: 6}} key={`cell-${item.route}`}> | ||
<Card href={item.route} hasBorder style={{width: '100%'}}> | ||
<Card.Heading>{item.frontMatter.title}</Card.Heading> | ||
<Card.Description>{item.frontMatter.description}</Card.Description> | ||
</Card> | ||
</Grid.Column> | ||
) | ||
})} | ||
</Grid> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters