Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
feat(accordian): adds accordian component
Browse files Browse the repository at this point in the history
includes drawer slide up down fragment and style cleanup
  • Loading branch information
eddier committed Mar 9, 2017
1 parent 104248c commit e7fea3d
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 636 deletions.
18 changes: 15 additions & 3 deletions src/components/accordian/Accordian.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import AccordianTitle from './AccordianTitle'
import AccordianPrimaryAction from './AccordianPrimaryAction'
import AccordianActionButton from './AccordianActionButton'
import AccordianWidget from './AccordianWidget'
import AccordianDrawer from './AccordianDrawer';
import '../../styles/components/accordian.css'


Expand All @@ -18,23 +19,34 @@ class Accordian extends React.Component {
static PrimaryAction = AccordianPrimaryAction
static ActionButon = AccordianActionButton
static Widget = AccordianWidget
static Drawer = AccordianDrawer

render() {
let borderClass = '';
if (this.props.noBorder){
borderClass = 'noborder';
}
return (
<Flexbox flexDirection="column" className="og__group og__row" key={this.props.data.id}>
<Flexbox flexDirection="column" className={`accordian__row ${borderClass}`} key={this.props.data.id}>

{(this.props.folder) ? (
<div className="topedge"></div>
) : ''
}
<Flexbox flexDirection="row" flexGrow={3}>
<Flexbox flexDirection="row" flexGrow={3} className="primary-content">
{this.props.children}
</Flexbox>
{this.props.drawer}
</Flexbox>
)
}
}
Accordian.defaultProps = {
folder: true,
noBorder: false
}
Accordian.propTypes = {
folder: React.PropTypes.bool
folder: React.PropTypes.bool,
noBorder: React.PropTypes.bool,
}
export default Accordian
6 changes: 3 additions & 3 deletions src/components/accordian/AccordianActionButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import Flexbox from 'flexbox-react'

const AccordianActionButton = (props) => {
return (
<Flexbox alignItems="center" flexGrow={3}>
<div onClick={props.onClick} className={`operation__group_list_manage ${props.ClassName}`} style={props.style}>
{props.children}
<Flexbox alignItems='center' flexGrow={3}>
<div onClick={props.onClick} className={`accordian__action_button ${props.ClassName}`} style={props.style}>
{props.children}
</div>
</Flexbox>
)
Expand Down
43 changes: 43 additions & 0 deletions src/components/accordian/AccordianDrawer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react'
import Flexbox from 'flexbox-react'
import Icon from '../suir/icon/Icon'

const AccordianDrawer = (props) => {
return (
<div>

{(!props.expanded) ? (
<Flexbox className='drawer' flexDirection='row' onClick={props.expandGroupToggle}>
<Flexbox className='drawer__side' flexGrow={3} />
<Flexbox className='drawer__center' width='150px' paddingLeft='1em' paddingRight='1em'>
<Flexbox alignItems='center' className='drawer__center_copy' flexGrow={2}>EXPAND</Flexbox>
<Flexbox><Icon className='ei arrow_carrot-down text-large' /></Flexbox>
</Flexbox>
<Flexbox className='drawer__side' flexGrow={3} />
</Flexbox>
) : (
<div>
{props.children}
<Flexbox className='drawer' onClick={props.expandGroupToggle}>

<Flexbox className='drawer__center' width='100%' justifyContent='center' paddingLeft='1em' paddingRight='1em'>
<Flexbox alignItems='center' className='drawer__center_copy'>COLLAPSE</Flexbox>
<Flexbox><Icon className='ei arrow_carrot-up text-large' /></Flexbox>
</Flexbox>

</Flexbox>
</div>
)
}
</div>
)
}

AccordianDrawer.defaultProps = {
expanded: false
}
AccordianDrawer.propTypes = {
expanded: React.PropTypes.bool

}
export default AccordianDrawer
4 changes: 2 additions & 2 deletions src/components/accordian/AccordianPrimaryAction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Flexbox from 'flexbox-react'

const AccordianPrimaryAction = (props) => {
return (
<Flexbox alignItems="center" className={`og__groupBox_play ${props.className}`}>
{props.children}
<Flexbox alignItems='center' className={`accordian__primary_action ${props.className}`}>
{props.children}
</Flexbox>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/accordian/AccordianTitle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Flexbox from 'flexbox-react'

const AccordianTitle = (props) => {
return (
<Flexbox alignItems="center" className="operation_group_list_item_name">
{props.children}
<Flexbox alignItems='center' className='accordian__title'>
{props.children}
</Flexbox>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/accordian/AccordianWidgetLabel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Flexbox from 'flexbox-react'

const AccordianWidgetLabel = (props) => {
return (
<Flexbox alignItems="center" className={` ${props.className} og__title`} style={props.style}>
{props.children}
<Flexbox alignItems='center' className={` ${props.className} accordian__widget_label`} style={props.style}>
{props.children}
</Flexbox>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/accordian/AccordianWidgetValue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Flexbox from 'flexbox-react'

const AccordianWidgetValue = (props) => {
return (
<Flexbox alignItems="center" className="operation__group_list_item_assets_value">
{props.children}
<Flexbox alignItems='center' className='accordian__widget_value'>
{props.children}
</Flexbox>
)
}
Expand Down
Loading

0 comments on commit e7fea3d

Please sign in to comment.