-
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
1 parent
15a1615
commit c237234
Showing
8 changed files
with
149 additions
and
47 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
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,68 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
import { createStyleSheet, createStyleManager } from 'stylishly'; | ||
import { createPluginRegistry } from 'stylishly/lib/pluginRegistry'; | ||
import vendorPrefixer from 'stylishly-vendor-prefixer'; | ||
import pseudoClasses from 'stylishly-pseudo-classes'; | ||
import descendants from 'stylishly-descendants'; | ||
import chained from 'stylishly-chained'; | ||
import units from 'stylishly-units'; | ||
import nested from 'stylishly-nested'; | ||
import mediaQueries from 'stylishly-media-queries'; | ||
|
||
import Home from './pages/Home'; | ||
|
||
export const styleSheet = createStyleSheet('App', () => { | ||
return { | ||
'@raw body': { | ||
color: '#111', | ||
backgroundColor: '#fafafa', | ||
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif' | ||
}, | ||
'@raw img': { | ||
maxWidth: '100%' | ||
}, | ||
'@raw #app': { | ||
width: '100%', | ||
height: '100vh', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center' | ||
} | ||
}; | ||
}); | ||
|
||
export default class App extends Component { | ||
static propTypes = { | ||
styleManager: PropTypes.object | ||
}; | ||
|
||
static childContextTypes = { | ||
styleManager: PropTypes.object.isRequired | ||
}; | ||
|
||
getChildContext() { | ||
const { styleManager } = this; | ||
return { | ||
styleManager: styleManager | ||
}; | ||
} | ||
|
||
componentWillMount() { | ||
this.styleManager = createStyleManager({ | ||
pluginRegistry: createPluginRegistry( | ||
nested(), | ||
mediaQueries(), | ||
descendants(), | ||
pseudoClasses(), | ||
chained(), | ||
units(), | ||
vendorPrefixer() | ||
) | ||
}); | ||
} | ||
|
||
render() { | ||
this.styleManager.render(styleSheet); | ||
return <Home />; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,31 @@ | ||
import 'normalize.css'; | ||
import './index.css'; | ||
import { AppContainer } from 'react-hot-loader'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App'; | ||
|
||
if (process.env.NODE_ENV !== 'production') { | ||
require('../index.html'); | ||
} | ||
// import a11y from 'react-a11y'; | ||
|
||
// if (process.env.NODE_ENV !== 'production') { | ||
// a11y(React, {includeSrcNode: true}); | ||
// } | ||
|
||
const rootEl = document.getElementById('app'); | ||
ReactDOM.render( | ||
<AppContainer> | ||
<App /> | ||
</AppContainer>, | ||
rootEl | ||
); | ||
|
||
export default function hello() { | ||
return 'hello'; | ||
if (module.hot) { | ||
module.hot.accept('./App', () => { | ||
const NextApp = require('./App').default; | ||
ReactDOM.render( | ||
<AppContainer> | ||
<NextApp /> | ||
</AppContainer>, | ||
rootEl | ||
); | ||
}); | ||
} |
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 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
import { createStyleSheet } from 'stylishly'; | ||
|
||
export const styleSheet = createStyleSheet('Home', () => { | ||
return { | ||
logoContainer: { | ||
display: 'flex', | ||
alignItems: 'center' | ||
}, | ||
logo: { | ||
width: 75, | ||
marginRight: 10 | ||
}, | ||
logoText: { | ||
whiteSpace: 'nowrap', | ||
fontWeight: 500 | ||
} | ||
}; | ||
}); | ||
|
||
export default class Home extends Component { | ||
static contextTypes = { | ||
styleManager: PropTypes.object.isRequired | ||
} | ||
|
||
render() { | ||
const classes = this.context.styleManager.render(styleSheet); | ||
return ( | ||
<div className={classes.logoContainer}> | ||
<img src="/assets/images/logo.svg" alt="Front End Skeleton logo" className={classes.logo} /> | ||
<h1 className={classes.logoText}>Front End Skeleton</h1> | ||
</div> | ||
); | ||
} | ||
} |
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