This repository was archived by the owner on Mar 17, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +27
-36
lines changed
Expand file tree Collapse file tree 4 files changed +27
-36
lines changed Original file line number Diff line number Diff line change @@ -17,47 +17,44 @@ const styles = {
1717}
1818
1919class ExpandablePanel extends Component {
20- constructor ( props ) {
20+ constructor ( props ) {
2121 super ( props )
2222 this . state = {
2323 expanded : false ,
2424 hovered : false
2525 }
2626 }
2727
28- handleClickOutside ( evt ) {
29- console . log ( evt )
30- this . setState ( { expanded : false } )
28+ handleClickOutside ( evt ) {
29+ this . setState ( { expanded : false } )
3130 }
3231
33- render ( ) {
32+ render ( ) {
3433 return (
3534 < Paper
3635 style = { this . state . expanded ? {
37- margin : '40px -20px'
38- } : {
39- ...styles . root ,
40- cursor : 'pointer' ,
41- backgroundColor : this . state . hovered ? colors . grey200 : colors . white ,
42- ...this . props . style
43- } }
44- onMouseEnter = { ( ) => this . setState ( { hovered : true } ) }
45- onMouseLeave = { ( ) => this . setState ( { hovered : false } ) }
46- onTouchTap = { ( ) => this . setState ( { expanded : true } ) }
36+ margin : '40px -20px'
37+ } : {
38+ ...styles . root ,
39+ cursor : 'pointer' ,
40+ backgroundColor : this . state . hovered ? colors . grey200 : colors . white ,
41+ ...this . props . style
42+ } }
43+ onMouseEnter = { ( ) => this . setState ( { hovered : true } ) }
44+ onMouseLeave = { ( ) => this . setState ( { hovered : false } ) }
45+ onTouchTap = { ( ) => this . setState ( { expanded : true } ) }
4746 >
48- { this . state . expanded ?
49- < div >
50- < div style = { {
51- padding : '16px 20px'
52- } } >
53- < Text type = "title" >
54- { this . props . title }
55- </ Text >
56- </ div >
57- { this . props . children }
58- </ div >
59- :
47+ { this . state . expanded ? < div >
6048 < div style = { {
49+ padding : '16px 20px'
50+ } } >
51+ < Text type = "title" >
52+ { this . props . title }
53+ </ Text >
54+ </ div >
55+ { this . props . children }
56+ </ div >
57+ : < div style = { {
6158 ...styles . text ,
6259 ...this . props . textStyle
6360 } } >
@@ -74,7 +71,6 @@ class ExpandablePanel extends Component {
7471 }
7572}
7673
77-
7874ExpandablePanel . propTypes = {
7975 title : PropTypes . string . isRequired ,
8076 description : PropTypes . string . isRequired ,
Original file line number Diff line number Diff line change @@ -3,15 +3,10 @@ import PropTypes from 'prop-types'
33import * as colors from 'material-ui/styles/colors'
44import Text from '../SettingsPanel/Text'
55
6- const styles = {
7- root : { }
8- }
9-
106export default class SettingsGroup extends Component {
11- render ( ) {
7+ render ( ) {
128 return (
139 < div style = { {
14- ...styles . root ,
1510 ...this . props . style
1611 } } >
1712 < div style = { {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const styles = {
99}
1010
1111export default class SettingsItem extends Component {
12- render ( ) {
12+ render ( ) {
1313 return (
1414 < div style = { {
1515 ...styles . root ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const styles = {
99}
1010
1111export default class SettingsPanel extends Component {
12- render ( ) {
12+ render ( ) {
1313 return (
1414 < div style = { {
1515 ...styles . root ,
You can’t perform that action at this time.
0 commit comments