Skip to content

Commit

Permalink
/landing redirects to welcome. (#5431)
Browse files Browse the repository at this point in the history
  • Loading branch information
me-andre authored Jan 23, 2024
1 parent 460544c commit 440b7e7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/domain/platform/routes/RedirectToWelcomeSite.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { useLayoutEffect } from 'react';
import useLandingUrl from '../../../main/landing/useLandingUrl';

const RedirectToWelcomeSite = () => {
const landingUrl = useLandingUrl();

useLayoutEffect(() => {
if (landingUrl) {
window.location.replace(landingUrl);
}
}, [landingUrl]);

return null;
};

export default RedirectToWelcomeSite;
2 changes: 2 additions & 0 deletions src/main/routing/TopLevelRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { innovationPacksPath } from '../../domain/collaboration/InnovationPack/u
import NonIdentity from '../../domain/platform/routes/NonIdentity';
import useRedirectToIdentityDomain from '../../core/auth/authentication/routing/useRedirectToIdentityDomain';
import { NotFoundPageLayout } from '../../domain/journey/common/EntityPageLayout';
import RedirectToWelcomeSite from '../../domain/platform/routes/RedirectToWelcomeSite';

export const TopLevelRoutes: FC = () => {
const { t } = useTranslation();
Expand All @@ -49,6 +50,7 @@ export const TopLevelRoutes: FC = () => {
}
>
<Route index element={<RedirectToLanding />} />
<Route path="landing" element={<RedirectToWelcomeSite />} />
<Route
path={ROUTE_HOME}
element={
Expand Down

0 comments on commit 440b7e7

Please sign in to comment.