-
Notifications
You must be signed in to change notification settings - Fork 2
feature: lang integration from selfcare (PIN-7690) #1632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
c51d776
1084aef
f4d1435
cab8854
07822ac
f149174
6f8c963
501b987
5c5ef83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| import React from 'react' | ||
| import React, { useEffect } from 'react' | ||
| import { Footer, Header } from '@/components/layout' | ||
| import { AppLayout } from '@/components/layout/AppLayout' | ||
| import { PageContainerSkeleton } from '@/components/layout/containers' | ||
| import { Outlet } from 'react-router-dom' | ||
| import { Outlet, useSearchParams } from 'react-router-dom' | ||
| import useScrollTopOnLocationChange from '../../hooks/useScrollTopOnLocationChange' | ||
| import { Box } from '@mui/material' | ||
| import { AuthGuard } from './AuthGuard' | ||
|
|
@@ -11,15 +11,28 @@ import TOSAgreement from './TOSAgreement' | |
| import { useTOSAgreement } from '../../hooks/useTOSAgreement' | ||
| import { ErrorPage } from '@/pages' | ||
| import { Dialog } from '@/components/dialogs' | ||
| import { routes, useCurrentRoute } from '@/router' | ||
| import { routes, useCurrentRoute, useSwitchPathLang } from '@/router' | ||
| import { AuthHooks } from '@/api/auth' | ||
| import { Stack } from '@mui/system' | ||
| import { AllowedLanguage } from '@/router/routes' | ||
|
|
||
| function EmptyWrapper({ children }: { children: React.ReactNode }) { | ||
| return <>{children}</> | ||
| } | ||
|
|
||
| const _RoutesWrapper: React.FC = () => { | ||
| const switchLang = useSwitchPathLang() | ||
| const [searchParams] = useSearchParams() | ||
|
|
||
| useEffect(() => { | ||
| const language = AllowedLanguage.safeParse(searchParams.get('lang')) | ||
| if (language.success) { | ||
| switchLang(language.data) | ||
| } else { | ||
| console.warn('Language URL params is not valid') | ||
| } | ||
|
Comment on lines
+27
to
+33
|
||
| }, [searchParams, switchLang]) | ||
|
|
||
| const { isPublic, routeKey } = useCurrentRoute() | ||
| const { | ||
| jwt, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upgraded version of '@pagopa/interop-fe-commons' (1.5.2) requires '@pagopa/mui-italia' version ^1.9.0 as a peer dependency, but package.json specifies ^1.8.0. This peer dependency mismatch could lead to runtime issues or warnings during installation. Update '@pagopa/mui-italia' to at least version 1.9.0 to satisfy the peer dependency requirement.