Side Panel Sub Page Framework® (#18579)
Replace hard-coded implementations for sub pages in the side panel with a proper framework
This commit is contained in:
committed by
GitHub
parent
5bfa4c5c39
commit
2a6fcfcfb3
@@ -0,0 +1,30 @@
|
||||
import { SidePanelSubPages } from '@/side-panel/types/SidePanelSubPages';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { assertUnreachable } from 'twenty-shared/utils';
|
||||
|
||||
export const getSidePanelSubPageTitle = (
|
||||
subPage: SidePanelSubPages,
|
||||
): string => {
|
||||
switch (subPage) {
|
||||
case SidePanelSubPages.PageLayoutGraphFilter:
|
||||
return t`Filters`;
|
||||
case SidePanelSubPages.PageLayoutFieldsLayout:
|
||||
return t`Layout`;
|
||||
case SidePanelSubPages.NewSidebarItemViewObjectPicker:
|
||||
return t`Pick an object`;
|
||||
case SidePanelSubPages.NewSidebarItemViewPicker:
|
||||
return t`Pick a view`;
|
||||
case SidePanelSubPages.NewSidebarItemViewSystemPicker:
|
||||
return t`System objects`;
|
||||
case SidePanelSubPages.NewSidebarItemObjectPicker:
|
||||
return t`Pick an object`;
|
||||
case SidePanelSubPages.NewSidebarItemObjectSystemPicker:
|
||||
return t`System objects`;
|
||||
case SidePanelSubPages.NewSidebarItemRecord:
|
||||
return t`Add a record`;
|
||||
case SidePanelSubPages.EditFolderPicker:
|
||||
return t`Move to a folder`;
|
||||
default:
|
||||
assertUnreachable(subPage);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user