Skip to content

Commit

Permalink
fix(accordionItem): fixed naming for accordionItem component
Browse files Browse the repository at this point in the history
  • Loading branch information
davidicus committed Jul 3, 2019
1 parent fd17d91 commit 8d0cec9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 22 deletions.
16 changes: 8 additions & 8 deletions packages/example/src/pages/components/Accordion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ title: Accordion

<PageDescription>

The `<Accordion>` and `<AccordionItems>` components are used together to display a list of content sections that can be toggled open by clicking the respective title of each section.
The `<Accordion>` and `<AccordionItem>` components are used together to display a list of content sections that can be toggled open by clicking the respective title of each section.

</PageDescription>

## Example

<Accordion>
<AccordionItems title={(<div>Title 1</div>)}>Content Section</AccordionItems>
<AccordionItems title='Title 2'>Content Section</AccordionItems>
<AccordionItems title='Title 3'>Content Section</AccordionItems>
<AccordionItem title={(<div>Title 1</div>)}>Content Section</AccordionItem>
<AccordionItem title='Title 2'>Content Section</AccordionItem>
<AccordionItem title='Title 3'>Content Section</AccordionItem>
</Accordion>


Expand All @@ -23,9 +23,9 @@ The `<Accordion>` and `<AccordionItems>` components are used together to display

```
<Accordion>
<AccordionItems title='Title 1'>Content Section</AccordionItems>
<AccordionItems title='Title 2'>Content Section</AccordionItems>
<AccordionItems title='Title 3'>Content Section</AccordionItems>
<AccordionItem title='Title 1'>Content Section</AccordionItem>
<AccordionItem title='Title 2'>Content Section</AccordionItem>
<AccordionItem title='Title 3'>Content Section</AccordionItem>
</Accordion>
```

Expand All @@ -37,7 +37,7 @@ The `<Accordion>` and `<AccordionItems>` components are used together to display
| children | node | | | Pass in the children that will be rendered within the Accordion |
| className | string | | | Specify an optional className to be applied to the container node |

### `AccordionItems` Props
### `AccordionItem` Props

| property | propType | required | default | description |
| --------------- | -------- | -------- | -------------- ----------------| ----------------------------------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-theme-carbon/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generic MDX Components
export { Accordion, AccordionItems } from './src/components/Accordion';
export { Accordion, AccordionItem } from './src/components/Accordion';
export { AnchorLinks, AnchorLink } from './src/components/AnchorLinks';
export { default as PageDescription } from './src/components/PageDescription';
export { default as Video } from './src/components/Video/Video';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import cx from 'classnames';
import { AccordionItem as CarbonAccordionItem } from 'carbon-components-react';

const AccordionItem = ({ className, children, ...rest }) => (
<CarbonAccordionItem {...rest} className={cx(className)}>
{children}
</CarbonAccordionItem>
);

export default AccordionItem;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as Accordion } from './Accordion';
export { default as AccordionItems } from './AccordionItems';
export { default as AccordionItem } from './AccordionItem';

0 comments on commit 8d0cec9

Please sign in to comment.