-
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.
- Loading branch information
Josh Gretz
committed
May 29, 2019
1 parent
35d0eba
commit acbd01b
Showing
9 changed files
with
381 additions
and
14 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 @@ | ||
export {default as WithStyles} from './withStyles'; |
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,41 @@ | ||
import React from 'react'; | ||
import {compose, withState, withCallback} from '@truefit/bach'; | ||
import {withStyles} from '@truefit/bach-material-ui'; | ||
|
||
const WithStyles = ({classes, fontSize, increase}) => ( | ||
<div className={classes.container}> | ||
<h1 className={classes.h1}>withStyles</h1> | ||
<h2 className={classes.h2}>Font Size: {fontSize}</h2> | ||
<button className={classes.button} onClick={increase}> | ||
^ Increase ^ | ||
</button> | ||
</div> | ||
); | ||
|
||
export default compose( | ||
withState('fontSize', 'setFontSize', 12), | ||
withCallback('increase', ({fontSize, setFontSize}) => () => { | ||
setFontSize(fontSize + 1); | ||
}), | ||
withStyles(theme => ({ | ||
container: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
height: '100%', | ||
flexDirection: 'column', | ||
}, | ||
h1: { | ||
color: theme.palette.primary.main, | ||
}, | ||
h2: { | ||
color: theme.palette.secondary.main, | ||
fontSize: ({fontSize}) => fontSize, | ||
}, | ||
button: { | ||
height: 50, | ||
width: 100, | ||
borderRadius: 8, | ||
}, | ||
})), | ||
)(WithStyles); |
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,15 @@ | ||
import React from 'react'; | ||
import Menu from './controls/menu'; | ||
|
||
const simple = ['withStyles']; | ||
|
||
const combined = []; | ||
|
||
export default () => ( | ||
<Menu | ||
title="@truefit/bach-material-ui" | ||
root="bachmaterialui" | ||
simple={simple} | ||
combined={combined} | ||
/> | ||
); |
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
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
Oops, something went wrong.