From 4648148052c6f4fbbd7dad8b4e599d10104c1b1d Mon Sep 17 00:00:00 2001 From: Christopher Berge Hove Date: Tue, 29 Oct 2024 15:46:06 +0100 Subject: [PATCH] chore: Add navigation functionality to ProjectPortalPage component --- .../apps/project-portal-landingpage/package.json | 2 +- .../src/components/ProjectPortalPage.tsx | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/client/apps/project-portal-landingpage/package.json b/client/apps/project-portal-landingpage/package.json index 6dedbc0d..3a22880c 100644 --- a/client/apps/project-portal-landingpage/package.json +++ b/client/apps/project-portal-landingpage/package.json @@ -1,6 +1,6 @@ { "name": "project-portal-landingpage", - "version": "0.0.7", + "version": "0.0.8", "description": "", "private": true, "type": "module", diff --git a/client/apps/project-portal-landingpage/src/components/ProjectPortalPage.tsx b/client/apps/project-portal-landingpage/src/components/ProjectPortalPage.tsx index 4b656ea6..484c5e36 100644 --- a/client/apps/project-portal-landingpage/src/components/ProjectPortalPage.tsx +++ b/client/apps/project-portal-landingpage/src/components/ProjectPortalPage.tsx @@ -15,6 +15,8 @@ import InfoBox from './InfoBox/InfoBox'; // import { useNavigateOnContextChange } from '../hooks/use-navigate-on-context-change'; import { User } from './user/UserCard'; import { useNavigateOnContextChange } from '../hooks/use-navigate-on-context-change'; +import { NavigationModule } from '@equinor/fusion-framework-module-navigation'; +import { useFramework } from '@equinor/fusion-framework-react'; // const styles = { // contentSection: css` @@ -126,7 +128,7 @@ export const ProjectPortalPage = (): JSX.Element => { const { data, isLoading } = useUserOrgDetails(value); const { feature } = useFeature('project-prediction'); useNavigateOnContextChange(); - + const { modules } = useFramework<[NavigationModule]>(); return ( @@ -172,7 +174,16 @@ export const ProjectPortalPage = (): JSX.Element => { {data && data.length > 0 ? ( data.map((item, index) => ( - +
{}}>
+ ) => { + e.preventDefault(); + modules.navigation.replace(`/project/${item.id}`); + }} + link + title={item.title} + href={`/project/${item.id}`} + > {item.title} {data.length > index + 1 && |}