Refactor app state to be a state machine with access selectors

This commit is contained in:
Gabe Kangas
2022-05-25 20:38:40 -07:00
parent dde9878a46
commit 7b1667bf6a
21 changed files with 421 additions and 223 deletions

View File

@@ -23,6 +23,7 @@ import '../styles/offline-notice.scss';
import { AppProps } from 'next/app';
import { Router, useRouter } from 'next/router';
import { RecoilRoot } from 'recoil';
import AdminLayout from '../components/layouts/admin-layout';
import SimpleLayout from '../components/layouts/SimpleLayout';
@@ -31,7 +32,11 @@ function App({ Component, pageProps }: AppProps) {
if (router.pathname.startsWith('/admin')) {
return <AdminLayout pageProps={pageProps} Component={Component} router={router} />;
}
return <SimpleLayout pageProps={pageProps} Component={Component} router={router} />;
return (
<RecoilRoot>
<SimpleLayout pageProps={pageProps} Component={Component} router={router} />
</RecoilRoot>
);
}
export default App;