* banners * useAuthHooks * fixes to redirect and banner * extract useIntercom to custom hook * use app theme * extract user-dropdown to new component * Navigation Item * navigation and profile dropdown * Fix import * navigation and sidebar * fix type errors * fix banners being an async call * fix types * fix banner prop type * fix mobile nav item import * fix banner types * (revert) layout banner render method to fix type error --------- Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: Keith Williams <keithwillcode@gmail.com> Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
11 lines
377 B
TypeScript
11 lines
377 B
TypeScript
import { useFlagMap } from "@calcom/features/flags/context/provider";
|
|
import { isKeyInObject } from "@calcom/lib/isKeyInObject";
|
|
|
|
import type { NavigationItemType } from "./NavigationItem";
|
|
|
|
export function useShouldDisplayNavigationItem(item: NavigationItemType) {
|
|
const flags = useFlagMap();
|
|
if (isKeyInObject(item.name, flags)) return flags[item.name];
|
|
return true;
|
|
}
|