Skip to content
Snippets Groups Projects
Drawer.component.tsx 1.96 KiB
Newer Older
import { DRAWER_ROLE } from '@/components/Map/Drawer/Drawer.constants';
import { drawerSelector } from '@/redux/drawer/drawer.selectors';
import { useAppSelector } from '@/redux/hooks/useAppSelector';
import { twMerge } from 'tailwind-merge';
Piotr Gawron's avatar
Piotr Gawron committed
import { CommentDrawer } from '@/components/Map/Drawer/CommentDrawer';
import { LayersDrawer } from '@/components/Map/Drawer/LayersDrawer/LayersDrawer.component';
import { AvailablePluginsDrawer } from './AvailablePluginsDrawer';
import { BioEntityDrawer } from './BioEntityDrawer/BioEntityDrawer.component';
import { ExportDrawer } from './ExportDrawer';
import { OverlaysDrawer } from './OverlaysDrawer';
import { ProjectInfoDrawer } from './ProjectInfoDrawer';
import { ReactionDrawer } from './ReactionDrawer';
import { SearchDrawerWrapper as SearchDrawerContent } from './SearchDrawerWrapper';
import { SubmapsDrawer } from './SubmapsDrawer';
  const { isOpen, drawerName } = useAppSelector(drawerSelector);
mateuszmiko's avatar
mateuszmiko committed

  return (
    <div
      className={twMerge(
        'absolute bottom-0 left-[88px] top-[104px] z-10 h-calc-drawer w-[432px] -translate-x-full transform border border-divide bg-white-pearl text-font-500 transition-all duration-500',
        isOpen && 'translate-x-0',
      {isOpen && drawerName === 'search' && <SearchDrawerContent />}
      {isOpen && drawerName === 'submaps' && <SubmapsDrawer />}
      {isOpen && drawerName === 'reaction' && <ReactionDrawer />}
      {isOpen && drawerName === 'overlays' && <OverlaysDrawer />}
      {isOpen && drawerName === 'bio-entity' && <BioEntityDrawer />}
      {isOpen && drawerName === 'project-info' && <ProjectInfoDrawer />}
      {isOpen && drawerName === 'export' && <ExportDrawer />}
      {isOpen && drawerName === 'available-plugins' && <AvailablePluginsDrawer />}
Piotr Gawron's avatar
Piotr Gawron committed
      {isOpen && drawerName === 'comment' && <CommentDrawer />}
      {isOpen && drawerName === 'layers' && <LayersDrawer />}
mateuszmiko's avatar
mateuszmiko committed
  );
};