Skip to content

Commit

Permalink
feat(RHINENG-9686): Add system table toggle details
Browse files Browse the repository at this point in the history
Add "View by" text to the left of system table toggle on the Systems table page header. Each toggle button should have tooltips.
  • Loading branch information
Michael Johnson committed Apr 26, 2024
1 parent 9f6dc03 commit 3f2132c
Showing 1 changed file with 32 additions and 13 deletions.
45 changes: 32 additions & 13 deletions src/routes/InventoryComponents/InventoryPageHeader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { ToggleGroup, ToggleGroupItem } from '@patternfly/react-core';
import {
ToggleGroup,
ToggleGroupItem,
Text,
TextContent,
TextVariants,
Tooltip,
} from '@patternfly/react-core';
import {
PageHeader,
PageHeaderTitle,
Expand All @@ -13,18 +20,30 @@ import FontAwesomeImageIcon from '../../components/FontAwesomeImageIcon';

const InventoryContentToggle = ({ changeMainContent, mainContent }) => (
<ToggleGroup aria-label="Inventory content toggle">
<ToggleGroupItem
icon={<DesktopIcon />}
aria-label="Hybrid inventory"
isSelected={mainContent === pageContents.hybridInventory.key}
onChange={() => changeMainContent(pageContents.hybridInventory.key)}
/>
<ToggleGroupItem
icon={<FontAwesomeImageIcon />}
aria-label="Bifrost"
isSelected={mainContent === pageContents.bifrost.key}
onChange={() => changeMainContent(pageContents.bifrost.key)}
/>
<TextContent>
<Text
style={{ paddingTop: '5px', paddingRight: '16px' }}
component={TextVariants.h4}
>
View by
</Text>
</TextContent>
<Tooltip content="View by systems" position="top-end">
<ToggleGroupItem
icon={<DesktopIcon />}
aria-label="Hybrid inventory"
isSelected={mainContent === pageContents.hybridInventory.key}
onChange={() => changeMainContent(pageContents.hybridInventory.key)}
/>
</Tooltip>
<Tooltip content="View by images" position="top-end">
<ToggleGroupItem
icon={<FontAwesomeImageIcon />}
aria-label="Bifrost"
isSelected={mainContent === pageContents.bifrost.key}
onChange={() => changeMainContent(pageContents.bifrost.key)}
/>
</Tooltip>
</ToggleGroup>
);

Expand Down

0 comments on commit 3f2132c

Please sign in to comment.