@FelixMalfait WDYT?
We can refactor shouldDisplay Files/Tasks/Notes Tab etc into a hook.

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
nitin
2024-11-11 13:56:27 +05:30
committed by GitHub
parent 6d62dd9fd1
commit c19e54f24b
11 changed files with 495 additions and 198 deletions

View File

@ -7,6 +7,7 @@ import { useTabList } from '@/ui/layout/tab/hooks/useTabList';
import { TabListScope } from '@/ui/layout/tab/scopes/TabListScope';
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { LayoutCard } from '@/ui/layout/tab/types/LayoutCard';
import { Tab } from './Tab';
export type SingleTabProps = {
@ -16,6 +17,7 @@ export type SingleTabProps = {
hide?: boolean;
disabled?: boolean;
pill?: string | React.ReactElement;
cards?: LayoutCard[];
};
type TabListProps = {

View File

@ -0,0 +1,5 @@
import { CardType } from '@/object-record/record-show/types/CardType';
export type LayoutCard = {
type: CardType;
};

View File

@ -0,0 +1,11 @@
import { LayoutCard } from '@/ui/layout/tab/types/LayoutCard';
import { TabVisibilityConfig } from '@/ui/layout/tab/types/TabVisibilityConfig';
import { IconComponent } from 'twenty-ui';
export type RecordLayoutTab = {
title: string;
position: number;
Icon: IconComponent;
hide: TabVisibilityConfig;
cards: LayoutCard[];
};

View File

@ -0,0 +1,11 @@
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { FeatureFlagKey } from '@/workspace/types/FeatureFlagKey';
export type TabVisibilityConfig = {
ifMobile: boolean;
ifDesktop: boolean;
ifInRightDrawer: boolean;
ifFeaturesDisabled: FeatureFlagKey[];
ifRequiredObjectsInactive: CoreObjectNameSingular[];
ifRelationsMissing: string[];
};