2020-02-09 03:36:19 +01:00
|
|
|
import React from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import posed, { PoseGroup } from 'react-pose'
|
|
|
|
import shortid from 'shortid'
|
|
|
|
import AppProvider from './store/AppProvider'
|
2020-02-25 04:10:06 +01:00
|
|
|
import PriceProvider from './store/PriceProvider'
|
2020-02-09 03:36:19 +01:00
|
|
|
import { defaultAnimation } from './components/Animations'
|
|
|
|
import Titlebar from './components/Titlebar'
|
|
|
|
import styles from './Layout.module.css'
|
|
|
|
|
|
|
|
const Animation = posed.div(defaultAnimation)
|
|
|
|
|
|
|
|
export default function Layout({ children }) {
|
|
|
|
return (
|
2020-02-25 04:10:06 +01:00
|
|
|
<PriceProvider>
|
|
|
|
<AppProvider>
|
|
|
|
{process.platform === 'darwin' && <Titlebar />}
|
|
|
|
<div className={styles.app}>
|
|
|
|
<PoseGroup animateOnMount>
|
|
|
|
<Animation key={shortid.generate()}>{children}</Animation>
|
|
|
|
</PoseGroup>
|
|
|
|
</div>
|
|
|
|
</AppProvider>
|
|
|
|
</PriceProvider>
|
2020-02-09 03:36:19 +01:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
Layout.propTypes = {
|
|
|
|
children: PropTypes.any.isRequired
|
|
|
|
}
|