Design fixes + hide email tab if not a company or a person (#3720)
Design fixes + hide email tab Co-authored-by: Thomas Trompette <thomast@twenty.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -129,7 +129,7 @@ const StyledButton = styled.button<
|
||||
? `0 0 0 3px ${theme.accent.tertiary}`
|
||||
: 'none'};
|
||||
color: ${!disabled
|
||||
? theme.font.color.secondary
|
||||
? theme.font.color.tertiary
|
||||
: theme.font.color.extraLight};
|
||||
&:hover {
|
||||
background: ${!disabled
|
||||
|
||||
@ -8,6 +8,7 @@ import { ObjectTasks } from '@/activities/tasks/components/ObjectTasks';
|
||||
import { Timeline } from '@/activities/timeline/components/Timeline';
|
||||
import { ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import {
|
||||
IconCheckbox,
|
||||
IconMail,
|
||||
@ -65,6 +66,12 @@ export const ShowPageRightContainer = ({
|
||||
objectNameSingular: targetableObject.targetObjectNameSingular,
|
||||
});
|
||||
|
||||
const shouldDisplayEmailsTab =
|
||||
(emails &&
|
||||
targetableObject.targetObjectNameSingular ===
|
||||
CoreObjectNameSingular.Company) ||
|
||||
targetableObject.targetObjectNameSingular === CoreObjectNameSingular.Person;
|
||||
|
||||
const TASK_TABS = [
|
||||
{
|
||||
id: 'timeline',
|
||||
@ -95,8 +102,8 @@ export const ShowPageRightContainer = ({
|
||||
id: 'emails',
|
||||
title: 'Emails',
|
||||
Icon: IconMail,
|
||||
hide: !emails,
|
||||
disabled: !isMessagingEnabled || targetableObjectMetadataItem.isCustom,
|
||||
hide: !shouldDisplayEmailsTab,
|
||||
disabled: !isMessagingEnabled,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user