Skip to content

Commit

Permalink
style: Updated styling of Browse models
Browse files Browse the repository at this point in the history
  • Loading branch information
mheggelund committed Sep 22, 2023
1 parent 1df1a2d commit a971afe
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/App.styled.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from 'styled-components'

const StyledOutletWrapper = styled.section`
height: calc(100% - 200px);
height: calc(100% - 128px);
overflow: scroll;
`
export { StyledOutletWrapper as OutletWrapper }
4 changes: 0 additions & 4 deletions src/components/Table.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ export const StyledDiv = styled.div`
> table {
width: auto !important;
}
> div {
max-width: none !important;
}
}
`
2 changes: 1 addition & 1 deletion src/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const Table = () => {
enablePagination
emptyMessage="Empty :("
rows={models.data.data}
pageSize={15}
pageSize={5}
columns={[
{
accessorKey: 'analogueModelId',
Expand Down
18 changes: 18 additions & 0 deletions src/pages/Browse/Browse.styled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import styled from 'styled-components'
import { spacings } from '../../tokens/spacings'

export const BrowseWrapper = styled.div`
column-gap: ${spacings.X_LARGE};
padding: ${spacings.XXX_LARGE} ${spacings.X_LARGE};
display: flex;
flex-direction: column;
row-gap: ${spacings.X_LARGE};
> .btn-div {
> button {
width: 136px;
margin-right: 50px;
}
}
`
20 changes: 12 additions & 8 deletions src/pages/Browse/Browse.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Button, Snackbar } from '@equinor/eds-core-react'
import { Button, Snackbar, Typography } from '@equinor/eds-core-react'
import { useState } from 'react'
import { Table } from '../../components/Table'
import { AddModelDialog } from '../../features/AddModelDialog/AddModelDialog'
import { useAnalogueModels } from '../../hooks/useAnalogueModels'
import * as Styled from './Browse.styled'

enum UploadProcess {
STARTED = 'We are uploading your new model. Please keep this browser tab open.',
Expand Down Expand Up @@ -51,13 +52,16 @@ export const Browse = () => {

return (
<>
<div>
<Button href="/model/bf2171bc-2f5e-44a1-f6e0-08dbb5ed15e2/details">
model
</Button>
</div>
<Button onClick={toggleDialog}>Add new model</Button>
<Table />
<Styled.BrowseWrapper>
<Typography variant="h1">Browse all models</Typography>
<div className="btn-div">
<Button onClick={toggleDialog}>Add new model</Button>
<Button href="/model/bf2171bc-2f5e-44a1-f6e0-08dbb5ed15e2/details">
Model view - Hardkodet
</Button>
</div>
<Table />
</Styled.BrowseWrapper>
<AddModelDialog
isOpen={isAddModelDialog}
confirm={uploadModel}
Expand Down

0 comments on commit a971afe

Please sign in to comment.