Skip to content

Commit

Permalink
feat(GroupTabDetails): Rename state variable tab
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorKGOW committed Apr 9, 2024
1 parent 57dd2e1 commit 8574b25
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/components/InventoryGroupDetail/GroupTabDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ const GroupTabDetailsWrapper = ({
activeTab,
hasEdgeImages,
}) => {
const [tab, setTab] = useState(0);
const [groupTabKey, setGroupTabKey] = useState(groupTabKeys.systems);
const [hybridInventoryTabKey, setHybridInventoryTabKey] = useState(
hybridInventoryTabKeys.conventional.key
);

const { hasAccess: canViewHosts } = usePermissionsWithContext(
REQUIRED_PERMISSIONS_TO_READ_GROUP_HOSTS(groupId)
Expand All @@ -50,9 +52,14 @@ const GroupTabDetailsWrapper = ({
{canViewHosts && hasEdgeImages ? (
<Tabs
className="pf-m-light pf-v5-c-table"
activeKey={activeTab && tab == 0 ? activeTab : tab}
activeKey={
activeTab &&
hybridInventoryTabKey == hybridInventoryTabKeys.conventional.key
? activeTab
: hybridInventoryTabKey
}
onSelect={(_event, tabIndex) => {
setTab(tabIndex);
setHybridInventoryTabKey(tabIndex);
}}
aria-label="Hybrid inventory tabs"
>
Expand Down

0 comments on commit 8574b25

Please sign in to comment.