exporting layout to a layout file

This commit is contained in:
Unknown committed 2018-11-07 21:31:08 +01:00
1 parent 0b5c37a443
commit eb8ede7a63
5 files changed
+33 -9

No files matched your search

+3 -5
View File
@@ -11,7 +11,7 @@ import { theme, globalStyles } from './styles'
import { client } from './graphql/apollo'
import Auth from './auth'
import { Header, Footer, Home, Charts, Callback } from './views'
import { Layout, Home, Charts, Callback } from './views'
import Users from '@advancedalgos/users-client'
import Teams from '@advancedalgos/teams-client'
@@ -28,8 +28,7 @@ export const MasterApp = (props) => (
<ApolloProvider client={client}>
<MuiThemeProvider theme={theme}>
<CssBaseline />
<Header auth={auth} />
<div className={props.classes.mainContainer}>
<Layout auth={auth}>
<Switch>
<Route exact path='/' component={Home} />
<Route
@@ -60,8 +59,7 @@ export const MasterApp = (props) => (
render={props => <KeyVault {...props} auth={auth} />}
/>
</Switch>
</div>
<Footer />
</Layout>
</MuiThemeProvider>
</ApolloProvider>
</BrowserRouter>
-3
View File
@@ -66,9 +66,6 @@ export const globalStyles = theme => ({
[theme.breakpoints.up('sm')]: {
paddingBottom: theme.spacing.unit * 2
}
},
mainContainer: {
minHeight: 'calc(100vh - 420px)'
}
})
+2 -1
View File
@@ -3,5 +3,6 @@ import Footer from './footer'
import Home from './home'
import Charts from './charts'
import Callback from './callback'
import Layout from './layout'
export { Header, Footer, Home, Charts, Callback }
export { Layout, Header, Footer, Home, Charts, Callback }
+21
View File
@@ -0,0 +1,21 @@
import React from 'react'
import { withStyles } from '@material-ui/core/styles'
import Footer from '../footer'
import Header from '../header'
// styles
import styles from './styles'
class Index extends React.Component {
render () {
return (
<div className={this.props.classes.mainContainer}>
<Header auth={this.props.auth} />
{this.props.children}
<Footer />
</div>
)
}
}
export default withStyles(styles)(Index)
+7
View File
@@ -0,0 +1,7 @@
const styles = theme => ({
mainContainer: {
minHeight: 1000
}
})
export default styles