Remove payments API routing initialization
[ProtonMail-WebClient.git] / packages / components / containers / authentication / UnAuthenticated.tsx
blob16d46eae0e697cddf287b7fc6cb2c203869f0d94
1 import type { ReactNode } from 'react';
2 import { useLayoutEffect } from 'react';
4 import type { ThemeTypes } from '@proton/shared/lib/themes/themes';
6 import { useTheme } from '../themes/ThemeProvider';
8 /*
9  * Meant to wrap portions of ui that we know are for certain only
10  * rendered if a user visits the app(s) while unauthenticated.
11  */
12 const UnAuthenticated = ({ children, theme: maybeTheme }: { children: ReactNode; theme?: ThemeTypes }) => {
13     const theme = useTheme();
15     useLayoutEffect(() => {
16         theme.setThemeSetting();
17         if (maybeTheme !== undefined) {
18             theme.setTheme(maybeTheme);
19         }
20     }, [maybeTheme]);
22     return <>{children}</>;
25 export default UnAuthenticated;