Skip to content

Commit 6a7c6f7

Browse files
committed
use CoreProvider
1 parent 68a88c7 commit 6a7c6f7

3 files changed

Lines changed: 37 additions & 37 deletions

File tree

apps/gateway/src/Root.tsx

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useEffect, useRef } from 'react';
22

3-
import { LanguageToggle, NotificationHub, ThemeToggle } from '@douglasneuroinformatics/libui/components';
3+
import { LanguageToggle, ThemeToggle } from '@douglasneuroinformatics/libui/components';
44
import { useNotificationsStore } from '@douglasneuroinformatics/libui/hooks';
5+
import { CoreProvider } from '@douglasneuroinformatics/libui/providers';
56
import { Branding, InstrumentRenderer } from '@opendatacapture/react-core';
67
import type { InstrumentSubmitHandler } from '@opendatacapture/react-core';
78
import type { UpdateRemoteAssignmentData } from '@opendatacapture/schemas/assignment';
@@ -52,31 +53,32 @@ export const Root = ({ id, initialSeriesIndex, target, token }: RootProps) => {
5253
};
5354

5455
return (
55-
<div className="flex h-screen flex-col" ref={ref} style={{ display: 'none' }}>
56-
<header className="fixed top-0 z-10 w-full bg-white/80 text-slate-700 shadow-sm backdrop-blur-lg dark:bg-slate-800/75 dark:text-slate-300">
57-
<div className="container flex items-center justify-between py-3 font-medium">
58-
<Branding className="[&>span]:hidden sm:[&>span]:block" fontSize="md" />
59-
<div className="flex gap-3">
60-
<ThemeToggle className="h-9 w-9" />
61-
<LanguageToggle
62-
options={{
63-
en: 'English',
64-
fr: 'Français'
65-
}}
66-
triggerClassName="h-9 w-9"
67-
/>
56+
<CoreProvider>
57+
<div className="flex h-screen flex-col" ref={ref} style={{ display: 'none' }}>
58+
<header className="fixed top-0 z-10 w-full bg-white/80 text-slate-700 shadow-sm backdrop-blur-lg dark:bg-slate-800/75 dark:text-slate-300">
59+
<div className="container flex items-center justify-between py-3 font-medium">
60+
<Branding className="[&>span]:hidden sm:[&>span]:block" fontSize="md" />
61+
<div className="flex gap-3">
62+
<ThemeToggle className="h-9 w-9" />
63+
<LanguageToggle
64+
options={{
65+
en: 'English',
66+
fr: 'Français'
67+
}}
68+
triggerClassName="h-9 w-9"
69+
/>
70+
</div>
6871
</div>
69-
</div>
70-
</header>
71-
<main className="container flex min-h-0 max-w-3xl grow flex-col pb-16 pt-32 xl:max-w-5xl">
72-
<InstrumentRenderer
73-
className="min-h-full w-full"
74-
initialSeriesIndex={initialSeriesIndex}
75-
target={target}
76-
onSubmit={handleSubmit}
77-
/>
78-
</main>
79-
<NotificationHub />
80-
</div>
72+
</header>
73+
<main className="container flex min-h-0 max-w-3xl grow flex-col pb-16 pt-32 xl:max-w-5xl">
74+
<InstrumentRenderer
75+
className="min-h-full w-full"
76+
initialSeriesIndex={initialSeriesIndex}
77+
target={target}
78+
onSubmit={handleSubmit}
79+
/>
80+
</main>
81+
</div>
82+
</CoreProvider>
8183
);
8284
};

apps/playground/src/App.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import { NotificationHub } from '@douglasneuroinformatics/libui/components';
3+
import { CoreProvider } from '@douglasneuroinformatics/libui/providers';
44
import { ErrorPage, LoadingPage } from '@opendatacapture/react-core';
55
import { ErrorBoundary } from 'react-error-boundary';
66

@@ -13,10 +13,11 @@ export const App = () => {
1313
<LoadingPage subtitle="Please Be Patient, This May Take a While" title="Loading Editor and Toolchain" />
1414
}
1515
>
16-
<ErrorBoundary FallbackComponent={ErrorPage}>
17-
<NotificationHub />
18-
<IndexPage />
19-
</ErrorBoundary>
16+
<CoreProvider>
17+
<ErrorBoundary FallbackComponent={ErrorPage}>
18+
<IndexPage />
19+
</ErrorBoundary>
20+
</CoreProvider>
2021
</React.Suspense>
2122
);
2223
};

apps/web/src/routes/__root.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { Fragment } from 'react';
2-
3-
import { NotificationHub } from '@douglasneuroinformatics/libui/components';
1+
import { CoreProvider } from '@douglasneuroinformatics/libui/providers';
42
import type { QueryClient } from '@tanstack/react-query';
53
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
64
import { createRootRouteWithContext, Outlet } from '@tanstack/react-router';
@@ -16,11 +14,10 @@ type RouterContext = {
1614

1715
export const Route = createRootRouteWithContext<RouterContext>()({
1816
component: () => (
19-
<Fragment>
17+
<CoreProvider>
2018
<Outlet />
21-
<NotificationHub />
2219
<ReactQueryDevtools buttonPosition="bottom-right" position="left" />
2320
<TanStackRouterDevtools />
24-
</Fragment>
21+
</CoreProvider>
2522
)
2623
});

0 commit comments

Comments
 (0)