File tree Expand file tree Collapse file tree 2 files changed +33
-22
lines changed Expand file tree Collapse file tree 2 files changed +33
-22
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
import { withStyles } from '@material-ui/core/styles' ;
4
+ import classNames from 'classnames' ;
5
+ import capitalize from 'lodash/capitalize' ;
4
6
5
7
import styles from './styles' ;
6
8
@@ -11,12 +13,15 @@ class Footer extends React.PureComponent {
11
13
} ;
12
14
13
15
render ( ) {
14
- const { classes, children } = this . props ;
15
- return (
16
- < div className = { classes . footer } >
17
- { children }
18
- </ div >
16
+ const { classes, color, className : classNameProp , children } = this . props ;
17
+ const className = classNames (
18
+ classes . footer ,
19
+ {
20
+ [ classes [ `color${ capitalize ( color ) } ` ] ] : color !== 'inherit' ,
21
+ } ,
22
+ classNameProp
19
23
) ;
24
+ return < div className = { className } > { children } </ div > ;
20
25
}
21
26
}
22
27
Original file line number Diff line number Diff line change 1
- const styles = theme => ( {
2
- footer : {
3
- backgroundColor : theme . palette . background . appBar ,
4
- color : theme . palette . getContrastText ( theme . palette . background . appBar ) ,
5
- padding : '20px 10px' ,
6
- } ,
7
- message : {
8
- textAlign : 'center' ,
9
- marginBottom : '30px' ,
10
- } ,
11
- logoImage : {
12
- maxHeight : '50px' ,
13
- maxWidth : '300px' ,
14
- margin : '0' ,
15
- padding : '0' ,
16
- } ,
17
- } ) ;
1
+ const styles = theme => {
2
+ const backgroundColorDefault =
3
+ theme . palette . type === 'light'
4
+ ? theme . palette . grey [ 100 ]
5
+ : theme . palette . grey [ 900 ] ;
6
+ return {
7
+ footer : {
8
+ padding : '20px 10px' , // TODO use units and spacing
9
+ } ,
10
+ colorDefault : {
11
+ backgroundColor : backgroundColorDefault ,
12
+ color : theme . palette . getContrastText ( backgroundColorDefault ) ,
13
+ } ,
14
+ colorPrimary : {
15
+ backgroundColor : theme . palette . primary . main ,
16
+ color : theme . palette . primary . contrastText ,
17
+ } ,
18
+ colorSecondary : {
19
+ backgroundColor : theme . palette . secondary . main ,
20
+ color : theme . palette . secondary . contrastText ,
21
+ } ,
22
+ } ;
23
+ } ;
18
24
19
25
export default styles ;
You can’t perform that action at this time.
0 commit comments