Request pane context (#69)

This commit is contained in:
Gregory Schier
2024-09-02 14:36:55 -07:00
committed by GitHub
parent e6d7f4a928
commit 002acd05ee
12 changed files with 200 additions and 76 deletions

View File

@@ -4,6 +4,7 @@ import { Outlet } from 'react-router-dom';
import { useOsInfo } from '../hooks/useOsInfo';
import { DialogProvider, Dialogs } from './DialogContext';
import { GlobalHooks } from './GlobalHooks';
import { RequestEditorProvider } from './RequestEditorContext';
import { ToastProvider, Toasts } from './ToastContext';
export function DefaultLayout() {
@@ -11,23 +12,25 @@ export function DefaultLayout() {
return (
<DialogProvider>
<ToastProvider>
<>
{/* Must be inside all the providers, so they have access to them */}
<Toasts />
<Dialogs />
</>
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.1, delay: 0.1 }}
className={classNames(
'w-full h-full',
osInfo?.osType === 'linux' && 'border border-border-subtle',
)}
>
<Outlet />
</motion.div>
<GlobalHooks />
<RequestEditorProvider>
<>
{/* Must be inside all the providers, so they have access to them */}
<Toasts />
<Dialogs />
</>
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.1, delay: 0.1 }}
className={classNames(
'w-full h-full',
osInfo?.osType === 'linux' && 'border border-border-subtle',
)}
>
<Outlet />
</motion.div>
<GlobalHooks />
</RequestEditorProvider>
</ToastProvider>
</DialogProvider>
);