Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate copilot to command menu #9522

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const StyledCommandMenu = styled.div`
top: 0%;
width: ${() => (useIsMobile() ? '100%' : '500px')};
z-index: 30;
display: flex;
flex-direction: column;
`;

export const CommandMenuContainer = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export enum CommandMenuPages {
ViewRecord = 'view-record',
ViewEmailThread = 'view-email-thread',
ViewCalendarEvent = 'view-calendar-event',
Copilot = 'copilot',
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import { CommandMenuContainer } from '@/command-menu/components/CommandMenuConta
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;
`;

export const CommandMenuRouter = () => {
const commandMenuPage = useRecoilValue(commandMenuPageState);

Expand All @@ -17,7 +22,9 @@ export const CommandMenuRouter = () => {
return (
<CommandMenuContainer>
<CommandMenuTopBar />
{commandMenuPageComponent}
<StyledCommandMenuContent>
{commandMenuPageComponent}
</StyledCommandMenuContent>
</CommandMenuContainer>
);
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { RightDrawerCalendarEvent } from '@/activities/calendar/right-drawer/components/RightDrawerCalendarEvent';
import { RightDrawerAIChat } from '@/activities/copilot/right-drawer/components/RightDrawerAIChat';
import { RightDrawerEmailThread } from '@/activities/emails/right-drawer/components/RightDrawerEmailThread';
import { CommandMenu } from '@/command-menu/components/CommandMenu';
import { CommandMenuPages } from '@/command-menu/components/CommandMenuPages';
Expand All @@ -12,4 +13,5 @@ export const COMMAND_MENU_PAGES_CONFIG = new Map<
[CommandMenuPages.ViewRecord, <RightDrawerRecord />],
[CommandMenuPages.ViewEmailThread, <RightDrawerEmailThread />],
[CommandMenuPages.ViewCalendarEvent, <RightDrawerCalendarEvent />],
[CommandMenuPages.Copilot, <RightDrawerAIChat />],
]);
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export const mapRightDrawerPageToCommandMenuPage = (
return CommandMenuPages.ViewEmailThread;
case RightDrawerPages.ViewCalendarEvent:
return CommandMenuPages.ViewCalendarEvent;
case RightDrawerPages.Copilot:
return CommandMenuPages.Copilot;
default:
return CommandMenuPages.Root;
}
Expand Down
Loading