From cd510a6d7cdb65d1a1895a9225ff5e82b413039a Mon Sep 17 00:00:00 2001 From: mheggelund Date: Wed, 24 Jan 2024 14:30:40 +0100 Subject: [PATCH 01/10] fix: Logo click navigates to "/" --- src/features/AppBar/AppBar.styled.ts | 7 ++++++- src/features/AppBar/AppBar.tsx | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/features/AppBar/AppBar.styled.ts b/src/features/AppBar/AppBar.styled.ts index f446cd47..289c771c 100644 --- a/src/features/AppBar/AppBar.styled.ts +++ b/src/features/AppBar/AppBar.styled.ts @@ -5,4 +5,9 @@ import { spacings } from '../../tokens/spacings'; const StyledTopBar = styled(TopBar)` column-gap: ${spacings.X_LARGE}; `; -export { StyledTopBar as TopBar }; + +const StyledHeader = styled(TopBar.Header)` + cursor: pointer; +`; + +export { StyledHeader as Header, StyledTopBar as TopBar }; diff --git a/src/features/AppBar/AppBar.tsx b/src/features/AppBar/AppBar.tsx index 5adb361c..96ff67f5 100644 --- a/src/features/AppBar/AppBar.tsx +++ b/src/features/AppBar/AppBar.tsx @@ -1,12 +1,21 @@ import { TopBar } from '@equinor/eds-core-react'; +import { useNavigate } from 'react-router-dom'; import * as Styled from './AppBar.styled'; import { Icons } from './Icons/Icons'; import { Navigation } from './Navigation/Navigation'; const AppBar = ({ title }: { title: string }) => { + const navigate = useNavigate(); + return ( - {title} + { + navigate(''); + }} + > + {title} + From 6d67af33c660c2114bb02608b5798ddbb2c34ec8 Mon Sep 17 00:00:00 2001 From: mheggelund Date: Wed, 24 Jan 2024 15:20:28 +0100 Subject: [PATCH 02/10] refactor: Resize and fix style for ModelMetadataView. --- .../ModelMetadataView.styled.tsx | 47 ++++++++++--------- .../ModelMetadataView/ModelMetadataView.tsx | 42 ++++++++--------- src/features/ModelView/ModelView.styled.tsx | 4 -- .../ModelView/TableDataCell/TableDataCell.tsx | 8 ++-- 4 files changed, 48 insertions(+), 53 deletions(-) diff --git a/src/features/ModelView/ModelMetadataView/ModelMetadataView.styled.tsx b/src/features/ModelView/ModelMetadataView/ModelMetadataView.styled.tsx index d93bcb71..3afc5ff8 100644 --- a/src/features/ModelView/ModelMetadataView/ModelMetadataView.styled.tsx +++ b/src/features/ModelView/ModelMetadataView/ModelMetadataView.styled.tsx @@ -1,34 +1,35 @@ +import { Table } from '@equinor/eds-core-react'; import styled from 'styled-components'; import { spacings } from '../../../tokens/spacings'; export const Metadata = styled.div` - width: 100%; - min-width: 256px; + display: flex; + flex-direction: column; + row-gap: ${spacings.LARGE}; + + > button { + width: fit-content; + } `; -export const MetadataTable = styled.div` - width: 100%; - min-width: 256px; - > table { - width: 85%; +const DataTable = styled(Table)` + min-width: 256px; + width: 65%; +`; - > tbody { - > tr { - > .table-first-col { - width: 20%; - padding-right: ${spacings.X_LARGE}; - } +export const NameCell = styled(Table.Cell)` + width: 20%; + padding-right: ${spacings.X_LARGE}; +`; - > .table-second-col { - display: flex; - flex-direction: row; - align-items: center; +export const DataCell = styled(Table.Cell)` + display: flex; + flex-direction: row; + align-items: center; - > p { - padding-right: 10px; - } - } - } - } + > p { + padding-right: 10px; } `; + +export { DataTable as Table }; diff --git a/src/features/ModelView/ModelMetadataView/ModelMetadataView.tsx b/src/features/ModelView/ModelMetadataView/ModelMetadataView.tsx index c0d9704f..1b03a0cc 100644 --- a/src/features/ModelView/ModelMetadataView/ModelMetadataView.tsx +++ b/src/features/ModelView/ModelMetadataView/ModelMetadataView.tsx @@ -149,28 +149,26 @@ export const ModelMetadataView = () => { Description and metadata {data.data.description &&
{data.data.description}
} - - - - - Field - - - - Fomation - - - - Analouge - - - - Zone - - - -
-
+ + + + Field + + + + Fomation + + + + Analouge + + + + Zone + + + +