Refactor page frame component

This commit is contained in:
Germán Martínez 2019-09-20 12:08:43 +02:00
parent 11335b487d
commit 0e58604395
1 changed files with 9 additions and 8 deletions

View File

@ -1,8 +1,8 @@
// @flow
import * as React from 'react'
import { SnackbarProvider } from 'notistack'
import SidebarProvider from '~/components/Sidebar'
import { withStyles } from '@material-ui/core/styles'
import SidebarProvider from '~/components/Sidebar'
import Header from '~/components/Header'
import Img from '~/components/layout/Img'
import AlertLogo from './assets/alert.svg'
@ -10,7 +10,7 @@ import CheckLogo from './assets/check.svg'
import ErrorLogo from './assets/error.svg'
import styles from './index.scss'
const classes = {
const notificationStyles = {
success: {
background: '#ffffff',
fontFamily: 'Averta',
@ -51,6 +51,7 @@ const classes = {
type Props = {
children: React.Node,
classes: Object,
}
const PageFrame = ({ children, classes }: Props) => (
@ -65,17 +66,17 @@ const PageFrame = ({ children, classes }: Props) => (
variantInfo: classes.info,
}}
iconVariant={{
success: <img src={CheckLogo} />,
error: <img src={ErrorLogo} />,
warning: <img src={AlertLogo} />,
success: <Img src={CheckLogo} />,
error: <Img src={ErrorLogo} />,
warning: <Img src={AlertLogo} />,
}}
><>
>
<SidebarProvider>
<Header />
{children}
</SidebarProvider></>
</SidebarProvider>
</SnackbarProvider>
</div>
)
export default withStyles(classes)(PageFrame)
export default withStyles(notificationStyles)(PageFrame)