Closes twentyhq/core-team-issues#53 - Removes command menu top bar text input when the user is not on root page - Fixes bug when resetting command menu context - Added animations on command menu open and close - Refactored workflow visualizer code to remove unnecessary rerenders and props drilling https://github.com/user-attachments/assets/1da3adb8-220b-407b-9279-30354d3100d3
32 lines
994 B
TypeScript
32 lines
994 B
TypeScript
import { CommandMenuContainer } from '@/command-menu/components/CommandMenuContainer';
|
|
import { CommandMenuTopBar } from '@/command-menu/components/CommandMenuTopBar';
|
|
import { COMMAND_MENU_PAGES_CONFIG } from '@/command-menu/constants/CommandMenuPagesConfig';
|
|
import { commandMenuPageState } from '@/command-menu/states/commandMenuPageState';
|
|
import styled from '@emotion/styled';
|
|
import { useRecoilValue } from 'recoil';
|
|
import { isDefined } from 'twenty-ui';
|
|
|
|
const StyledCommandMenuContent = styled.div`
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
`;
|
|
|
|
export const CommandMenuRouter = () => {
|
|
const commandMenuPage = useRecoilValue(commandMenuPageState);
|
|
|
|
const commandMenuPageComponent = isDefined(commandMenuPage) ? (
|
|
COMMAND_MENU_PAGES_CONFIG.get(commandMenuPage)
|
|
) : (
|
|
<></>
|
|
);
|
|
|
|
return (
|
|
<CommandMenuContainer>
|
|
<CommandMenuTopBar />
|
|
<StyledCommandMenuContent>
|
|
{commandMenuPageComponent}
|
|
</StyledCommandMenuContent>
|
|
</CommandMenuContainer>
|
|
);
|
|
};
|