Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update cards permutation to match expected usage #1418

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pages/cards/permutations.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ function createSimpleItems(count: number) {
}

const cardDefinition: CardsProps.CardDefinition<Item> = {
header: item => (item.number === 2 ? <Link href="#">{item.text}</Link> : item.text),
header: item =>
item.number === 2 ? (
<Link href="#" fontSize="inherit">
{item.text}
</Link>
) : (
item.text
),
sections: [
{
id: 'description',
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/__snapshots__/documenter.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3587,7 +3587,7 @@ add a meaningful description to the whole selection.",
Object {
"description": " Defines what to display in each card. It has the following properties:
* \`header\` ((item) => ReactNode) - Responsible for displaying the card header. You receive the current item as an argument.
Use \`fontSize=\\"heading-m\\"\` on [link](/components/link/) components inside card header.
Use \`fontSize=\\"inherit\\"\` on [link](/components/link/) components inside card header.
* \`sections\` (array) - Responsible for displaying the card content. Cards can have many sections in their
body. Each entry in the array is responsible for displaying a section. An entry has the following properties:
* \`id\`: (string) - A unique identifier for the section. The property is used as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys)
Expand Down
2 changes: 1 addition & 1 deletion src/cards/interfaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export interface CardsProps<T = any> extends BaseComponentProps {
/**
* Defines what to display in each card. It has the following properties:
* * `header` ((item) => ReactNode) - Responsible for displaying the card header. You receive the current item as an argument.
* Use `fontSize="heading-m"` on [link](/components/link/) components inside card header.
* Use `fontSize="inherit"` on [link](/components/link/) components inside card header.
* * `sections` (array) - Responsible for displaying the card content. Cards can have many sections in their
* body. Each entry in the array is responsible for displaying a section. An entry has the following properties:
* * `id`: (string) - A unique identifier for the section. The property is used as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys)
Expand Down
Loading