core-app-api: actually use AppRouterProps

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-12-08 17:18:25 +01:00
parent 0e91c1196d
commit 2e7a08394d
3 changed files with 13 additions and 7 deletions
+7 -1
View File
@@ -228,7 +228,13 @@ export type AppRouteBinder = <
) => void;
// @public
export function AppRouter({ children }: { children?: ReactNode }): JSX.Element;
export function AppRouter(props: AppRouterProps): JSX.Element;
// @public
export interface AppRouterProps {
// (undocumented)
children?: ReactNode;
}
// @public
export class AppThemeSelector implements AppThemeApi {
+5 -6
View File
@@ -100,9 +100,8 @@ export interface AppRouterProps {
* Until the user has successfully signed in, this component will render
* the sign-in page. Once the user has signed-in, it will instead render
* the app, while providing routing and route tracking for the app.
*
*/
export function AppRouter({ children }: { children?: ReactNode }) {
export function AppRouter(props: AppRouterProps) {
const { Router: RouterComponent, SignInPage: SignInPageComponent } =
useApp().getComponents();
@@ -145,7 +144,7 @@ export function AppRouter({ children }: { children?: ReactNode }) {
<RouterComponent>
<RouteTracker routeObjects={routeObjects} />
<Routes>
<Route path={mountPath} element={<>{children}</>} />
<Route path={mountPath} element={<>{props.children}</>} />
</Routes>
</RouterComponent>
);
@@ -154,7 +153,7 @@ export function AppRouter({ children }: { children?: ReactNode }) {
return (
<RouterComponent basename={basePath}>
<RouteTracker routeObjects={routeObjects} />
{children}
{props.children}
</RouterComponent>
);
}
@@ -168,7 +167,7 @@ export function AppRouter({ children }: { children?: ReactNode }) {
appIdentityProxy={appIdentityProxy}
>
<Routes>
<Route path={mountPath} element={<>{children}</>} />
<Route path={mountPath} element={<>{props.children}</>} />
</Routes>
</SignInPageWrapper>
</RouterComponent>
@@ -182,7 +181,7 @@ export function AppRouter({ children }: { children?: ReactNode }) {
component={SignInPageComponent}
appIdentityProxy={appIdentityProxy}
>
{children}
{props.children}
</SignInPageWrapper>
</RouterComponent>
);
+1
View File
@@ -15,6 +15,7 @@
*/
export { AppRouter } from './AppRouter';
export type { AppRouterProps } from './AppRouter';
export { createSpecializedApp } from './createSpecializedApp';
export { defaultConfigLoader } from './defaultConfigLoader';
export * from './types';