Skip to content

Commit

Permalink
chore: Add navigation functionality to ProjectPortalPage component
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggling committed Oct 29, 2024
1 parent 1965a84 commit 4648148
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/apps/project-portal-landingpage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "project-portal-landingpage",
"version": "0.0.7",
"version": "0.0.8",
"description": "",
"private": true,
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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 (
<Styles.Wrapper>
<ProjectHeader>
Expand Down Expand Up @@ -172,7 +174,16 @@ export const ProjectPortalPage = (): JSX.Element => {
{data && data.length > 0 ? (
data.map((item, index) => (
<Styles.LinkWrapper key={item.id}>
<Typography link title={item.title} href={`/project/${item.id}`}>
<div onClick={(e) => {}}></div>
<Typography
onClick={(e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
e.preventDefault();
modules.navigation.replace(`/project/${item.id}`);
}}
link
title={item.title}
href={`/project/${item.id}`}
>
{item.title}
</Typography>
{data.length > index + 1 && <span>|</span>}
Expand Down

0 comments on commit 4648148

Please sign in to comment.