-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ddf5db
commit 22b4565
Showing
5 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const Compute = () => { | ||
return ( | ||
<div> | ||
<p>Compute models here!</p> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import styled from 'styled-components' | ||
|
||
export const Wrapper = styled.div` | ||
display: flex; | ||
flex: auto; | ||
flex-direction: row; | ||
position: relative; | ||
width: 100%; | ||
` | ||
|
||
export const SidebarWrapper = styled.div` | ||
heigth: 100%; | ||
max-width: 256px; | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { useEffect, useState } from 'react' | ||
import { Outlet, useParams } from 'react-router-dom' | ||
import { useAnalogueModels } from '../../hooks/useAnalogueModels' | ||
import { components } from '../../models/schema' | ||
import * as Styled from './Model.styled' | ||
|
||
import { ModelNameFrame } from '../../features/ModelView/ModelNameFrame/ModelNameFrame' | ||
import { ModelNavigationBar } from '../../features/ModelView/ModelNavigationBar/ModelNavigationBar' | ||
|
||
export type ModelType = Partial< | ||
components['schemas']['GetAnalogueModelQueryResponse']['data'] | ||
> | ||
|
||
export const Model = () => { | ||
const [model, setModel] = useState<ModelType>() | ||
const { id } = useParams() | ||
const { fetchModel } = useAnalogueModels() | ||
|
||
useEffect(() => { | ||
async function getModel() { | ||
return await fetchModel({ | ||
params: { path: { id: id ?? '' } }, | ||
}).then((response) => response?.data) | ||
} | ||
if (!model) { | ||
getModel().then((model) => model && setModel(model as ModelType)) | ||
} | ||
}, [id, model, fetchModel]) | ||
|
||
return ( | ||
<> | ||
{model && <ModelNameFrame model={model} />} | ||
<Styled.Wrapper> | ||
<Styled.SidebarWrapper> | ||
<ModelNavigationBar /> | ||
</Styled.SidebarWrapper> | ||
<Outlet /> | ||
</Styled.Wrapper> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const Results = () => { | ||
return ( | ||
<div> | ||
<p>Resukts for models here!</p> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters