forked from relax/relax
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
section option for a better options division
- Loading branch information
1 parent
ca30638
commit 9d626cc
Showing
5 changed files
with
84 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.options-section { | ||
background-color: #1D1D1D; | ||
margin: 0 -10px; | ||
cursor: pointer; | ||
padding: 0 10px; | ||
border: 1px solid #333333; | ||
margin-top: -1px; | ||
|
||
i, span { | ||
display: inline-block; | ||
vertical-align: top; | ||
line-height: 40px; | ||
color: #cccccc; | ||
} | ||
i { | ||
font-size: 16px; | ||
padding-right: 7px; | ||
} | ||
span { | ||
font-size: 11px; | ||
text-transform: uppercase; | ||
} | ||
|
||
&:hover { | ||
background-color: #2C2D2D; | ||
|
||
i, span { | ||
color: #ffffff; | ||
} | ||
} | ||
} | ||
|
||
.section-options { | ||
margin: 20px 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react'; | ||
import {Component} from 'relax-framework'; | ||
|
||
export default class Section extends Component { | ||
toggle (event) { | ||
event.preventDefault(); | ||
this.props.onChange(!this.props.value); | ||
} | ||
|
||
render () { | ||
return ( | ||
<div className='options-section' onClick={this.toggle.bind(this)}> | ||
<i className='material-icons'>{this.props.value ? 'keyboard_arrow_down' : 'chevron_right'}</i> | ||
<span>{this.props.label}</span> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
Section.propTypes = { | ||
value: React.PropTypes.bool.isRequired, | ||
label: React.PropTypes.string.isRequired, | ||
onChange: React.PropTypes.func.isRequired | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters