Preview: http://dashboards.webkom.co/react/airframe
This commit is contained in:
Tomasz Owczarczyk
2019-08-15 00:54:44 +02:00
parent f975443095
commit 37092d1d6c
626 changed files with 56691 additions and 0 deletions

69
app/layout/default.js Executable file
View File

@@ -0,0 +1,69 @@
import React from 'react';
import PropTypes from 'prop-types';
import {
Layout,
ThemeSelector,
ThemeProvider,
PageConfigConsumer,
} from './../components';
import './../styles/bootstrap.scss';
import './../styles/main.scss';
import './../styles/plugins/plugins.scss';
import './../styles/plugins/plugins.css';
import {
RoutedNavbars,
RoutedSidebars,
} from './../routes';
const favIcons = [
{ rel: 'icon', type: 'image/x-icon', href: require('./../images/favicons/favicon.ico') },
{ rel: 'apple-touch-icon', sizes: '180x180', href: require('./../images/favicons/apple-touch-icon.png') },
{ rel: 'icon', type: 'image/png', sizes: '32x32', href: require('./../images/favicons/favicon-32x32.png') },
{ rel: 'icon', type: 'image/png', sizes: '16x16', href: require('./../images/favicons/favicon-16x16.png') }
];
class AppLayout extends React.Component {
static propTypes = {
children: PropTypes.node.isRequired
}
render() {
const { children } = this.props;
return (
<ThemeProvider initialStyle="light" initialColor="primary">
<Layout sidebarSlim favIcons={ favIcons }>
{ /* --------- Navbar ----------- */ }
<Layout.Navbar>
<RoutedNavbars />
</Layout.Navbar>
{ /* -------- Sidebar ------------*/ }
<Layout.Sidebar>
<RoutedSidebars />
</Layout.Sidebar>
{ /* -------- Content ------------*/ }
<Layout.Content>
{ children }
</Layout.Content>
{ /* -- Theme Selector (DEMO) ----*/ }
<PageConfigConsumer>
{
({ sidebarHidden, navbarHidden }) => (
<ThemeSelector styleDisabled={ sidebarHidden && navbarHidden } />
)
}
</PageConfigConsumer>
</Layout>
</ThemeProvider>
);
}
}
export default AppLayout;