Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/app cleanup #102

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export function App() {
<>
<AuthenticatedTemplate>
<AppBar title="PEPM" />
<p>Authenticated</p>
<button onClick={() => instance.logoutRedirect()}>Log out</button>
<Styled.OutletWrapper>
<Outlet />
</Styled.OutletWrapper>
Expand Down
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
5 changes: 4 additions & 1 deletion src/features/AppBar/Icons/Icons.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMsal } from '@azure/msal-react'
import { Menu } from '@equinor/eds-core-react'
import { Button, Menu } from '@equinor/eds-core-react'
import {
account_circle as accountCircle,
notifications,
Expand Down Expand Up @@ -29,6 +29,9 @@ export const Icons = () => {
<MenuIcon icon={icons.userInfo}>
<Menu.Section title="Logged in">
<Menu.Item>{instance.getActiveAccount()?.name}</Menu.Item>
<Menu.Item>
<Button onClick={() => instance.logoutRedirect()}>Log out</Button>
</Menu.Item>
</Menu.Section>
</MenuIcon>
</Styled.Icons>
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