diff --git a/front/Navigation.tsx b/front/Navigation.tsx index efcbb29..653b65f 100644 --- a/front/Navigation.tsx +++ b/front/Navigation.tsx @@ -40,6 +40,9 @@ const protectedRoutes = () => component: SetttingsNavigator, options: { title: 'Settings' }, link: '/settings/:screen?', + stringify: { + screen: () => '', + }, }, Song: { component: SongLobbyView, @@ -134,13 +137,20 @@ const routesToScreens = (routes: Partial>) = )); const routesToLinkingConfig = ( - routes: Partial> + routes: Partial< + Record string> }> + > ) => { - const pagesToRoute = {} as Record; + // Too lazy to (find the) type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const pagesToRoute = {} as Record; Object.keys(routes).forEach((route) => { const index = route as keyof AppRouteParams; if (routes[index]?.link) { - pagesToRoute[index] = routes[index]!.link!; + pagesToRoute[index] = { + path: routes[index]!.link!, + stringify: routes[index]!.stringify, + }; } }); return { diff --git a/front/views/settings/SettingsView.tsx b/front/views/settings/SettingsView.tsx index 84f609d..9fc68bd 100644 --- a/front/views/settings/SettingsView.tsx +++ b/front/views/settings/SettingsView.tsx @@ -79,7 +79,7 @@ type SetttingsNavigatorProps = { const SetttingsNavigator = (props?: RouteProps) => { const userQuery = useQuery(['user'], () => API.getUserInfo()); const user = useMemo(() => userQuery.data, [userQuery]); - + console.log(props?.screen); if (userQuery.isLoading) { return (