Skip to content

Commit

Permalink
chore: Cleanup and fixed imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mheggelund committed Oct 2, 2023
1 parent 7b1fece commit 9152bdb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,7 @@ export const StyledSidebarLink = styled(SideBar.Link)`
}
`

export const StyledAccordian = styled(SideBar.Accordion)`
&.activeTab {
background: none;
> p {
color: ${theme.light.primary.resting};
font-weight: bold;
}
> svg {
fill: ${theme.light.primary.resting};
opacity: 1;
}
}
`

export const StyledAccordianItem = styled(SideBar.AccordionItem)`
export const StyledAccordionItem = styled(SideBar.AccordionItem)`
> div {
border-left: solid;
border-color: ${theme.light.ui.background.medium};
Expand Down Expand Up @@ -65,8 +51,7 @@ export const StyledAccordianItem = styled(SideBar.AccordionItem)`
`

export {
StyledAccordian as Accordian,
StyledAccordianItem as AccordianItem,
StyledAccordionItem as AccordionItem,
StyledSidebarContent as SidebarContent,
StyledSidebarLink as SidebarLink,
}
41 changes: 11 additions & 30 deletions src/features/ModelView/ModelNavigationBar/ModelNavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type MenuItems = SidebarLinkProps & {
export const ModelNavigationBar = () => {
const location = useLocation()
const tab = location.pathname.split('/')
const path = tab[tab.length - 1]

const menuItems: SidebarLinkProps[] = [
{
Expand All @@ -30,7 +31,6 @@ export const ModelNavigationBar = () => {
href: 'details',
active: false,
},

{
label: 'Results',
icon: approve,
Expand Down Expand Up @@ -62,54 +62,35 @@ export const ModelNavigationBar = () => {
return (
<SideBar open>
<Styled.SidebarContent>
{/* <Styled.StyledSidebarToggle /> */}
{/* {menuItems.map((m) => (
<Styled.StyledSidebarLink
className={m.href === tab[tab.length - 1] && 'activeTab'}
key={m.label}
{...m}
active={m.href === tab[tab.length - 1]}
></Styled.StyledSidebarLink>
))} */}

<Styled.SidebarLink
className={menuItems[0].href === tab[tab.length - 1] && 'activeTab'}
className={menuItems[0].href === path && 'activeTab'}
key={menuItems[0].label}
{...menuItems[0]}
active={menuItems[0].href === tab[tab.length - 1]}
active={menuItems[0].href === path}
></Styled.SidebarLink>
<Styled.SidebarLink
disabled
className={
('object' === tab[tab.length - 1] ||
'variogram' === tab[tab.length - 1]) &&
'activeTab'
}
className={('object' === path || 'variogram' === path) && 'activeTab'}
isExpanded
label={sidebarCompute.label}
icon={sidebarCompute.icon}
active={
'object' === tab[tab.length - 1] ||
'variogram' === tab[tab.length - 1]
}
active={'object' === path || 'variogram' === path}
href={'variogram'}
></Styled.SidebarLink>
{sidebarCompute.subItems?.map((item) => (
<Styled.AccordianItem
className={item.href === tab[tab.length - 1] && 'activeTab actTab'}
<Styled.AccordionItem
className={item.href === path && 'activeTab actTab'}
key={item.label}
label={item.label}
active={
item.href === tab[tab.length - 1] && item.label === 'Variogram'
}
active={item.href === path && item.label === 'Variogram'}
href={item.href}
></Styled.AccordianItem>
></Styled.AccordionItem>
))}
<Styled.SidebarLink
className={menuItems[1].href === tab[tab.length - 1] && 'activeTab'}
className={menuItems[1].href === path && 'activeTab'}
key={menuItems[1].label}
{...menuItems[1]}
active={menuItems[1].href === tab[tab.length - 1]}
active={menuItems[1].href === path}
></Styled.SidebarLink>
</Styled.SidebarContent>
</SideBar>
Expand Down
4 changes: 2 additions & 2 deletions src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { About } from './pages/About/About'
import { Api } from './pages/Api/Api'
import { Browse } from './pages/Browse/Browse'
import { InvalidURL } from './pages/InvalidURL/InvalidURL'
import { ComputeObject } from './pages/ModelPages/Compute/ComputeObject'
import { ComputeVariogram } from './pages/ModelPages/Compute/ComputeVariogram'
import { ComputeObject } from './pages/ModelPages/Compute/ComputeObject/ComputeObject'
import { ComputeVariogram } from './pages/ModelPages/Compute/ComputeVariogram/ComputeVariogram'
import { Model } from './pages/ModelPages/Model/Model'
import { Results } from './pages/ModelPages/Results/Results'

Expand Down

0 comments on commit 9152bdb

Please sign in to comment.