mirror of
https://github.com/mgerb/go-discord-bot
synced 2026-01-09 08:32:48 +00:00
29 lines
811 B
TypeScript
29 lines
811 B
TypeScript
import { inject, observer } from 'mobx-react';
|
|
import React from 'react';
|
|
import { withRouter } from 'react-router';
|
|
import { Header, Navbar } from './components';
|
|
import { Util } from './util';
|
|
import './wrapper.scss';
|
|
|
|
export const Wrapper = inject('appStore')(
|
|
withRouter(
|
|
// eslint-disable-next-line
|
|
observer(({ appStore, children }: any) => {
|
|
const openClass = appStore.navbarOpen ? 'wrapper--open' : '';
|
|
const onNavClick = () => {
|
|
if (Util.isMobileScreen()) {
|
|
appStore.toggleNavbar();
|
|
}
|
|
};
|
|
|
|
return (
|
|
<div>
|
|
<Header onButtonClick={appStore.toggleNavbar} />
|
|
<Navbar appStore={appStore} onNavClick={onNavClick} />
|
|
<div className={'wrapper ' + openClass}>{children}</div>
|
|
</div>
|
|
);
|
|
}),
|
|
),
|
|
);
|