Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Fixes
- Fix Attachment `styles` prop typing @levithomason ([#299](https://github.com/stardust-ui/react/pull/299))
- Fix generation of `key` for the `Accordion.Content` @mnajdova ([#305](https://github.com/stardust-ui/react/pull/305))

### Features
- Add focus styles for `Menu.Item` component @Bugaa92 ([#286](https://github.com/stardust-ui/react/pull/286))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ class AccordionExampleList extends React.Component {
const panels = [
{
title: 'Pets',
content: (
<div>
<List
items={[
{ key: 'a', media: <Image avatar src="//placehold.it/100" />, header: 'cat' },
{ key: 'b', media: <Image avatar src="//placehold.it/100" />, header: 'dog' },
{ key: 'c', media: <Image avatar src="//placehold.it/100" />, header: 'mouse' },
]}
/>
<Button>Add pet</Button>
</div>
),
content: {
key: 'animals',
content: (
<div>
<List
items={[
{ key: 'a', media: <Image avatar src="//placehold.it/100" />, header: 'cat' },
{ key: 'b', media: <Image avatar src="//placehold.it/100" />, header: 'dog' },
{ key: 'c', media: <Image avatar src="//placehold.it/100" />, header: 'mouse' },
]}
/>
<Button>Add pet</Button>
</div>
),
},
},
]

Expand Down
11 changes: 3 additions & 8 deletions src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,14 @@ class Accordion extends AutoControlledComponent<Extendable<IAccordionProps>, any

children.push(
AccordionTitle.create(title, {
generateKey: true,
defaultProps: { active, index },
overrideProps: this.handleTitleOverrides,
}),
)
children.push(
AccordionContent.create(
{ content },
{
generateKey: true,
defaultProps: { active },
},
),
AccordionContent.create(content, {
defaultProps: { active },
}),
)
})

Expand Down