Hide tabs (#7841)
@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:
@ -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 = {
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
import { CardType } from '@/object-record/record-show/types/CardType';
|
||||
|
||||
export type LayoutCard = {
|
||||
type: CardType;
|
||||
};
|
||||
@ -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[];
|
||||
};
|
||||
@ -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[];
|
||||
};
|
||||
Reference in New Issue
Block a user