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

Commit

Permalink
fix(naming): better naming
Browse files Browse the repository at this point in the history
changing naming to be more consistent
  • Loading branch information
eddier committed Mar 9, 2017
1 parent 21ab353 commit 4a8f96f
Show file tree
Hide file tree
Showing 16 changed files with 216 additions and 203 deletions.
55 changes: 55 additions & 0 deletions src/components/ThinCard/ThinCard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React from 'react'
import ReactDOM from 'react-dom'
import Flexbox from 'flexbox-react'
import ThinCardTitle from './ThinCardTitle'
import ThinCardPrimaryAction from './ThinCardPrimaryAction'
import ThinCardActionButton from './ThinCardActionButton'
import ThinCardWidget from './ThinCardWidget'
import ThinCardDrawer from './ThinCardDrawer';
import '../../styles/components/thin-card.css'


class ThinCard extends React.Component {
constructor(props) {
super(props)

}

static Title = ThinCardTitle
static PrimaryAction = ThinCardPrimaryAction
static ActionButon = ThinCardActionButton
static Widget = ThinCardWidget
static Drawer = ThinCardDrawer

render() {
let borderClass = '';
if (this.props.noBorder){
borderClass = 'thincard__noborder';
}
if (this.props.folder){
borderClass += ' thincard__folderpad'
}
return (
<Flexbox flexDirection="column" className={`thincard__row ${borderClass}`} key={this.props.data.id}>

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

const ThinCardActionButton = (props) => {
return (
<Flexbox alignItems='center' flexGrow={3}>
<div onClick={props.onClick} className={`thincard__action_button ${props.ClassName}`} style={props.style}>
{props.children}
</div>
</Flexbox>
)
}

ThinCardActionButton.defaultProps = {
style: {},
className: {}
}

ThinCardActionButton.propTypes = {
style: React.PropTypes.object,
className: React.PropTypes.object,
onClick: React.PropTypes.func
}

export default ThinCardActionButton
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import Flexbox from 'flexbox-react'
import Icon from '../suir/icon/Icon'

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

Expand Down Expand Up @@ -33,11 +33,12 @@ const AccordianDrawer = (props) => {
)
}

AccordianDrawer.defaultProps = {
ThinCardDrawer.defaultProps = {
expanded: false
}
AccordianDrawer.propTypes = {
expanded: React.PropTypes.bool
ThinCardDrawer.propTypes = {
expanded: React.PropTypes.bool,
onClick: React.PropTypes.func

}
export default AccordianDrawer
export default ThinCardDrawer
22 changes: 22 additions & 0 deletions src/components/ThinCard/ThinCardPrimaryAction.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react'
import Flexbox from 'flexbox-react'

const ThinCardPrimaryAction = (props) => {
return (
<Flexbox alignItems='center' className={`thincard__primary_action ${props.className}`} style={props.style}>
{props.children}
</Flexbox>
)
}

ThinCardPrimaryAction.defaultProps = {
style: {},
className: {}
}

ThinCardPrimaryAction.propTypes = {
style: React.PropTypes.object,
className: React.PropTypes.object
}

export default ThinCardPrimaryAction
22 changes: 22 additions & 0 deletions src/components/ThinCard/ThinCardTitle.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react'
import Flexbox from 'flexbox-react'

const ThinCardTitle = (props) => {
return (
<Flexbox alignItems='center' className={`thincard__title ${props.className}`} style={props.style}>
{props.children}
</Flexbox>
)
}

ThinCardTitle.defaultProps = {
style: {},
className: {}
}

ThinCardTitle.propTypes = {
style: React.PropTypes.object,
className: React.PropTypes.object
}

export default ThinCardTitle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react'
import Flexbox from 'flexbox-react'
import AccordianWidgetLabel from './AccordianWidgetLabel'
import AccordianWidgetValue from './AccordianWidgetValue'
import ThinCardWidgetLabel from './ThinCardWidgetLabel'
import ThinCardWidgetValue from './ThinCardWidgetValue'

class AccordianWidget extends React.Component {
class ThinCardWidget extends React.Component {
constructor(props) {
super(props)

}

static Label = AccordianWidgetLabel
static Value = AccordianWidgetValue
static Label = ThinCardWidgetLabel
static Value = ThinCardWidgetValue

render(){
let borderClass = '';
Expand All @@ -29,14 +29,16 @@ class AccordianWidget extends React.Component {
}
}

AccordianWidget.defaultProps = {
ThinCardWidget.defaultProps = {
borderLeft: false,
borderRight: false,
}

AccordianWidget.propTypes = {
ThinCardWidget.propTypes = {
borderLeft: React.PropTypes.bool,
borderRight: React.PropTypes.bool,
className: React.PropTypes.object,
onClick: React.PropTypes.func
}

export default AccordianWidget
export default ThinCardWidget
22 changes: 22 additions & 0 deletions src/components/ThinCard/ThinCardWidgetLabel.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react'
import Flexbox from 'flexbox-react'

const ThinCardWidgetLabel = (props) => {
return (
<Flexbox alignItems='center' className={` ${props.className} thincard__widget_label`} style={props.style}>
{props.children}
</Flexbox>
)
}

ThinCardWidgetLabel.defaultProps = {
style: {},
className: {}
}

ThinCardWidgetLabel.propTypes = {
style: React.PropTypes.object,
className: React.PropTypes.object
}

export default ThinCardWidgetLabel
20 changes: 20 additions & 0 deletions src/components/ThinCard/ThinCardWidgetValue.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'
import Flexbox from 'flexbox-react'

const ThinCardWidgetValue = (props) => {
return (
<Flexbox alignItems='center' className={` ${props.className} thincard__widget_value`} style={props.style}>
{props.children}
</Flexbox>
)
}
ThinCardWidgetValue.defaultProps = {
style: {},
className: {}
}

ThinCardWidgetValue.propTypes = {
style: React.PropTypes.object,
className: React.PropTypes.object
}
export default ThinCardWidgetValue
55 changes: 0 additions & 55 deletions src/components/accordian/Accordian.jsx

This file was deleted.

22 changes: 0 additions & 22 deletions src/components/accordian/AccordianActionButton.jsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/components/accordian/AccordianPrimaryAction.jsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/components/accordian/AccordianTitle.jsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/components/accordian/AccordianWidgetLabel.jsx

This file was deleted.

Loading

0 comments on commit 4a8f96f

Please sign in to comment.