From f76a3557a0c26fd7ee21c71bbfafd81ddf025e1a Mon Sep 17 00:00:00 2001 From: Levi Thomason Date: Sat, 13 Aug 2016 19:53:03 -0700 Subject: [PATCH] refactor(Accordion): add brainstorm notes --- src/modules/Accordion/AccordionContent.js | 29 +++++++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/modules/Accordion/AccordionContent.js b/src/modules/Accordion/AccordionContent.js index a594d210f4..3b40045ca2 100644 --- a/src/modules/Accordion/AccordionContent.js +++ b/src/modules/Accordion/AccordionContent.js @@ -1,9 +1,28 @@ import React, { PropTypes } from 'react' import cx from 'classnames' -import { Content } from '../../parts' +import { ContentPart } from '../../parts' import { getUnhandledProps, META, useKeyOnly } from '../../lib' +// ======================================================== +// Brainstorming ways to abstract className buildup, etc. +// +// const AccordionContent = createContentPart({ +// cx: ({ active }) => [ +// useKeyOnly(active, 'active'), +// ], +// propTypes: { +// /** Whether or not the content is visible. */ +// active: PropTypes.bool, +// }, +// _meta: { +// name: 'AccordionContent', +// type: META.TYPES.MODULE, +// parent: 'Accordion', +// }, +// }) +// -------------------------------------------------------- + function AccordionContent(props) { const { active, className, children } = props const classes = cx( @@ -14,20 +33,20 @@ function AccordionContent(props) { const rest = getUnhandledProps(AccordionContent, props) return ( - + {children} - + ) } AccordionContent.propTypes = { - ...Content.propTypes, + ...ContentPart.propTypes, /** Whether or not the content is visible. */ active: PropTypes.bool, } AccordionContent._meta = { - ...Content._meta, + ...ContentPart._meta, name: 'AccordionContent', type: META.TYPES.MODULE, parent: 'Accordion',