The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/sidebar/SidebarPortal.tsx

18 lines
516 B

import { Box } from '@rocket.chat/fuselage';
import type { ReactNode } from 'react';
import { memo } from 'react';
import { createPortal } from 'react-dom';
type SidebarPortalProps = { children?: ReactNode };
const SidebarPortal = ({ children }: SidebarPortalProps) => {
const sidebarRoot = document.getElementById('sidebar-region');
if (!sidebarRoot) {
return null;
}
return <>{createPortal(<Box className='rcx-sidebar flex-nav'>{children}</Box>, sidebarRoot)}</>;
};
export default memo(SidebarPortal);