Skip to content

Commit

Permalink
refactor(springboot-plugin): Change the styling to be consistent amon…
Browse files Browse the repository at this point in the history
…g plugins
  • Loading branch information
mmelko authored and tadayosi committed Apr 24, 2024
1 parent 096c83f commit 6c26756
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
6 changes: 3 additions & 3 deletions packages/hawtio/src/plugins/springboot/Health.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react'
import { Card, CardBody, CardHeader, Flex, FlexItem, Grid, GridItem, PageSection, Title } from '@patternfly/react-core'
import { Card, CardBody, CardHeader, Flex, FlexItem, Grid, GridItem, Title } from '@patternfly/react-core'
import { springbootService } from './springboot-service'
import { HealthComponentDetail, HealthData } from './types'
import { TableComposable, Tbody, Td, Tr } from '@patternfly/react-table'
Expand Down Expand Up @@ -88,7 +88,7 @@ export const Health: React.FunctionComponent = () => {
}, [])

return (
<PageSection variant='default'>
<React.Fragment>
{healthData && (
<Grid hasGutter span={4}>
<GridItem span={12}>
Expand Down Expand Up @@ -137,6 +137,6 @@ export const Health: React.FunctionComponent = () => {
})}
</Grid>
)}
</PageSection>
</React.Fragment>
)
}
6 changes: 3 additions & 3 deletions packages/hawtio/src/plugins/springboot/Info.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react'
import { FormGroup, PageSection } from '@patternfly/react-core'
import { FormGroup } from '@patternfly/react-core'
import { springbootService } from './springboot-service'
import { TableComposable, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table'

Expand All @@ -13,7 +13,7 @@ export const Info: React.FunctionComponent = () => {
}, [])

return (
<PageSection variant='light'>
<React.Fragment>
<FormGroup>
<TableComposable aria-label='Message Table' variant='compact' height='80vh' isStriped isStickyHeader>
<Thead>
Expand All @@ -34,6 +34,6 @@ export const Info: React.FunctionComponent = () => {
</Tbody>
</TableComposable>
</FormGroup>
</PageSection>
</React.Fragment>
)
}
5 changes: 2 additions & 3 deletions packages/hawtio/src/plugins/springboot/Loggers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
EmptyStateIcon,
FormGroup,
Label,
PageSection,
Pagination,
SearchInput,
Toolbar,
Expand Down Expand Up @@ -210,7 +209,7 @@ export const Loggers: React.FunctionComponent = () => {
)

return (
<PageSection variant='light'>
<React.Fragment>
{tableToolbar}
{getCurrentPage().length > 0 && (
<FormGroup>
Expand Down Expand Up @@ -253,6 +252,6 @@ export const Loggers: React.FunctionComponent = () => {
</EmptyState>
</Bullseye>
)}
</PageSection>
</React.Fragment>
)
}
33 changes: 18 additions & 15 deletions packages/hawtio/src/plugins/springboot/SpringBoot.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Nav, NavItem, NavList, PageGroup, PageNavigation, PageSection, Title } from '@patternfly/react-core'
import { Divider, Nav, NavItem, NavList, PageSection, PageSectionVariants, Title } from '@patternfly/react-core'
import React, { useEffect, useState } from 'react'

import { Navigate, NavLink, Route, Routes, useLocation } from 'react-router-dom'
Expand Down Expand Up @@ -52,20 +52,23 @@ export const SpringBoot: React.FunctionComponent = () => {
<PageSection variant='light'>
<Title headingLevel='h1'>Spring Boot</Title>
</PageSection>
<PageGroup>
<PageNavigation>
<Nav aria-label='Spring-boot Nav' variant='tertiary'>
<NavList>
{navItems.map(navItem => (
<NavItem key={navItem.id} isActive={location.pathname === `/springboot/${navItem.id}`}>
<NavLink to={navItem.id}>{navItem.title}</NavLink>
</NavItem>
))}
</NavList>
</Nav>
</PageNavigation>
</PageGroup>
<PageSection>
<Divider />
<PageSection type='tabs' hasShadowBottom>
<Nav aria-label='Spring-boot Nav' variant='tertiary'>
<NavList>
{navItems.map(navItem => (
<NavItem key={navItem.id} isActive={location.pathname === `/springboot/${navItem.id}`}>
<NavLink to={navItem.id}>{navItem.title}</NavLink>
</NavItem>
))}
</NavList>
</Nav>
</PageSection>
<Divider />
<PageSection
aria-label='Spring-boot Content'
variant={location.pathname === '/springboot/health' ? PageSectionVariants.default : PageSectionVariants.light}
>
<Routes>
{navItems.map(navItem => (
<Route key={navItem.id} path={navItem.id} element={navItem.component} />
Expand Down

0 comments on commit 6c26756

Please sign in to comment.