Add update chevron (#5988)

Fixes #5986 


1. Added right chevron to Fields Menu Item
<img width="735" alt="Screenshot 2024-06-21 at 5 59 46 PM"
src="https://github.com/twentyhq/twenty/assets/63531478/1515aba0-6732-424d-a0b3-5cc826a35b16">



2. Changed color of Hidden fields menu item chevron and stroke of left
chevron
<img width="735" alt="Screenshot 2024-06-21 at 6 21 30 PM"
src="https://github.com/twentyhq/twenty/assets/63531478/20952197-2f09-486c-a3bb-5b6c285a6996">

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Aakarshan Thapa
2024-06-24 09:01:21 -04:00
committed by GitHub
parent 901ef65545
commit 57bbd7c129
4 changed files with 18 additions and 3 deletions

View File

@ -132,6 +132,7 @@ export const RecordIndexOptionsDropdownContent = ({
onClick={() => handleSelectMenu('fields')} onClick={() => handleSelectMenu('fields')}
LeftIcon={IconTag} LeftIcon={IconTag}
text="Fields" text="Fields"
hasSubMenu
/> />
<MenuItem <MenuItem
onClick={() => openRecordSpreadsheetImport()} onClick={() => openRecordSpreadsheetImport()}

View File

@ -105,7 +105,7 @@ export const LightIconButton = ({
active={active} active={active}
title={title} title={title}
> >
{Icon && <Icon size={theme.icon.size.sm} stroke={theme.icon.stroke.sm} />} {Icon && <Icon size={theme.icon.size.sm} />}
</StyledButton> </StyledButton>
); );
}; };

View File

@ -1,5 +1,6 @@
import { FunctionComponent, MouseEvent, ReactElement, ReactNode } from 'react'; import { FunctionComponent, MouseEvent, ReactElement, ReactNode } from 'react';
import { IconComponent } from 'twenty-ui'; import { useTheme } from '@emotion/react';
import { IconChevronRight, IconComponent } from 'twenty-ui';
import { LightIconButtonProps } from '@/ui/input/button/components/LightIconButton'; import { LightIconButtonProps } from '@/ui/input/button/components/LightIconButton';
import { LightIconButtonGroup } from '@/ui/input/button/components/LightIconButtonGroup'; import { LightIconButtonGroup } from '@/ui/input/button/components/LightIconButtonGroup';
@ -30,6 +31,7 @@ export type MenuItemProps = {
onMouseLeave?: (event: MouseEvent<HTMLDivElement>) => void; onMouseLeave?: (event: MouseEvent<HTMLDivElement>) => void;
testId?: string; testId?: string;
text: ReactNode; text: ReactNode;
hasSubMenu?: boolean;
}; };
export const MenuItem = ({ export const MenuItem = ({
@ -43,7 +45,9 @@ export const MenuItem = ({
onMouseLeave, onMouseLeave,
testId, testId,
text, text,
hasSubMenu = false,
}: MenuItemProps) => { }: MenuItemProps) => {
const theme = useTheme();
const showIconButtons = Array.isArray(iconButtons) && iconButtons.length > 0; const showIconButtons = Array.isArray(iconButtons) && iconButtons.length > 0;
const handleMenuItemClick = (event: MouseEvent<HTMLDivElement>) => { const handleMenuItemClick = (event: MouseEvent<HTMLDivElement>) => {
@ -72,6 +76,13 @@ export const MenuItem = ({
<LightIconButtonGroup iconButtons={iconButtons} size="small" /> <LightIconButtonGroup iconButtons={iconButtons} size="small" />
)} )}
</div> </div>
{hasSubMenu && (
<IconChevronRight
size={theme.icon.size.sm}
color={theme.font.color.tertiary}
/>
)}
</StyledHoverableMenuItemBase> </StyledHoverableMenuItemBase>
); );
}; };

View File

@ -27,7 +27,10 @@ export const MenuItemNavigate = ({
<StyledMenuItemLeftContent> <StyledMenuItemLeftContent>
<MenuItemLeftContent LeftIcon={LeftIcon} text={text} /> <MenuItemLeftContent LeftIcon={LeftIcon} text={text} />
</StyledMenuItemLeftContent> </StyledMenuItemLeftContent>
<IconChevronRight size={theme.icon.size.md} /> <IconChevronRight
size={theme.icon.size.sm}
color={theme.font.color.tertiary}
/>
</StyledMenuItemBase> </StyledMenuItemBase>
); );
}; };