Skip to content

Commit

Permalink
fixed prettier check
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Cai <[email protected]>
  • Loading branch information
ciiay committed Jan 13, 2025
1 parent 33a7515 commit 5080c3e
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,18 @@ const getMenuItem = (menuItem: ResolvedMenuItem, isNestedMenuItem = false) => {
);
};

const GlobalHeader = ({ mountPoints }: { mountPoints: MountPoints}) => mountPoints['application/header']?.map(
({ Component, config }) => (
<Component key='global-header' {...config?.props} />
),
);
const GlobalHeader = ({ mountPoints }: { mountPoints: MountPoints }) =>
mountPoints['application/header']?.map(({ Component, config }) => (
<Component key="global-header" {...config?.props} />
));

export const Root = ({ children }: PropsWithChildren<{}>) => {
const { dynamicRoutes, menuItems, mountPoints } = useContext(DynamicRootContext);
const { dynamicRoutes, menuItems, mountPoints } =
useContext(DynamicRootContext);
const [openItems, setOpenItems] = useState<{ [key: string]: boolean }>({});

const { position: globalHeaderPosition } = mountPoints['application/header']?.[0]?.config?.layout ?? {};
const { position: globalHeaderPosition } =
mountPoints['application/header']?.[0]?.config?.layout ?? {};

const { loading: loadingPermission, allowed: canDisplayRBACMenuItem } =
usePermission({
Expand Down Expand Up @@ -258,9 +259,13 @@ export const Root = ({ children }: PropsWithChildren<{}>) => {
};
return (
<>
{globalHeaderPosition === 'above-sidebar' && <GlobalHeader mountPoints={mountPoints} />}
{globalHeaderPosition === 'above-sidebar' && (
<GlobalHeader mountPoints={mountPoints} />
)}
<SidebarPage>
{globalHeaderPosition === 'above-main-content' && <GlobalHeader mountPoints={mountPoints} />}
{globalHeaderPosition === 'above-main-content' && (
<GlobalHeader mountPoints={mountPoints} />
)}
<Sidebar>
<SidebarLogo />
<SidebarGroup label="Search" icon={<SearchIcon />} to="/search">
Expand Down

0 comments on commit 5080c3e

Please sign in to comment.