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

[1.2.x]refactor(preferences-plugin): adjust the look to be consistent with the rest of the plugins #935

Merged
merged 1 commit into from
May 9, 2024
Merged
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
50 changes: 19 additions & 31 deletions packages/hawtio/src/preferences/HawtioPreferences.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import { helpRegistry } from '@hawtiosrc/help/registry'
import {
Card,
Nav,
NavItem,
NavList,
PageGroup,
PageNavigation,
PageSection,
PageSectionVariants,
Title,
} from '@patternfly/react-core'
import { Divider, Nav, NavItem, NavList, PageSection, PageSectionVariants, Title } from '@patternfly/react-core'
import React from 'react'
import { NavLink, Navigate, Route, Routes, useLocation } from 'react-router-dom'
import help from './help.md'
Expand All @@ -28,28 +18,26 @@ export const HawtioPreferences: React.FunctionComponent = () => {
<PageSection variant={PageSectionVariants.light}>
<Title headingLevel='h1'>Preferences</Title>
</PageSection>
<PageGroup>
<PageNavigation>
<Nav aria-label='Nav' variant='tertiary'>
<NavList>
{preferencesRegistry.getPreferences().map(prefs => (
<NavItem key={prefs.id} isActive={location.pathname === `/preferences/${prefs.id}`}>
<NavLink to={prefs.id}>{prefs.title}</NavLink>
</NavItem>
))}
</NavList>
</Nav>
</PageNavigation>
</PageGroup>
<PageSection>
<Card isFullHeight>
<Routes>
<Divider />
<PageSection type='tabs' hasShadowBottom>
<Nav aria-label='Nav' variant='tertiary'>
<NavList>
{preferencesRegistry.getPreferences().map(prefs => (
<Route key={prefs.id} path={prefs.id} element={React.createElement(prefs.component)} />
<NavItem key={prefs.id} isActive={location.pathname === `/preferences/${prefs.id}`}>
<NavLink to={prefs.id}>{prefs.title}</NavLink>
</NavItem>
))}
<Route path='/' element={<Navigate to={'home'} />} />
</Routes>
</Card>
</NavList>
</Nav>
</PageSection>
<Divider />
<PageSection variant={PageSectionVariants.light}>
<Routes>
{preferencesRegistry.getPreferences().map(prefs => (
<Route key={prefs.id} path={prefs.id} element={React.createElement(prefs.component)} />
))}
<Route path='/' element={<Navigate to={'home'} />} />
</Routes>
</PageSection>
</React.Fragment>
)
Expand Down
Loading