Skip to content

Commit

Permalink
just my grain of salt of the pr
Browse files Browse the repository at this point in the history
Signed-off-by: Eneko Fernandez <[email protected]>
  • Loading branch information
enekofb committed Dec 19, 2023
1 parent 96d19f0 commit d1e38cf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ui/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,20 @@ function withSearchParams(Cmp) {
};
}

// gets the right runtime navigation item based on the feature WEAVE_GITOPS_FEATURE_GITOPS_RUNTIME
function getRuntimeConfiguration(isNewRuntimeEnabled: boolean): NavItem {
function getRuntimeNavItem(isNewRuntimeEnabled: boolean): NavItem {
if (isNewRuntimeEnabled) {
return {
label: "Runtime",
link: { value: V2Routes.Runtime },
icon: IconType.FluxIcon,
}
};
}

return {
label: "Flux Runtime",
link: { value: V2Routes.FluxRuntime },
icon: IconType.FluxIcon,
}
};
}

const App = () => {
Expand All @@ -95,8 +94,6 @@ const App = () => {
console.log("WEAVE_GITOPS_FEATURE_GITOPS_RUNTIME:")
console.log(isNewRuntimeEnabled)

const runtimeNavItem: NavItem = getRuntimeConfiguration(isNewRuntimeEnabled);

const navItems: NavItem[] = [
{
label: "Applications",
Expand All @@ -118,12 +115,13 @@ const App = () => {
link: { value: V2Routes.Policies },
icon: IconType.PoliciesIcon,
},
runtimeNavItem,
getRuntimeNavItem(isNewRuntimeEnabled),
{
label: "Notifications",
link: { value: V2Routes.Notifications },
icon: IconType.NotificationsIcon,
}];
},
];

const [collapsed, setCollapsed] = React.useState<boolean>(false);
const { currentPage } = useNavigation();
Expand Down

0 comments on commit d1e38cf

Please sign in to comment.