[REFACTOR] Twenty UI multi barrel (#11301)
# Introduction closes https://github.com/twentyhq/core-team-issues/issues/591 Same than for `twenty-shared` made in https://github.com/twentyhq/twenty/pull/11083. ## TODO - [x] Manual migrate twenty-website twenty-ui imports ## What's next: - Generate barrel and migration script factorization within own package + tests - Refactoring using preconstruct ? TimeBox - Lint circular dependencies - Lint import from barrel and forbid them ### Preconstruct We need custom rollup plugins addition, but preconstruct does not expose its rollup configuration. It might be possible to handle this using the babel overrides. But was a big tunnel. We could give it a try afterwards ! ( allowing cjs interop and stuff like that ) Stuck to vite lib app Closed related PRs: - https://github.com/twentyhq/twenty/pull/11294 - https://github.com/twentyhq/twenty/pull/11203
This commit is contained in:
@ -13,7 +13,7 @@ import { useIsSettingsDrawer } from '@/navigation/hooks/useIsSettingsDrawer';
|
||||
|
||||
import { MainNavigationDrawerItems } from '@/navigation/components/MainNavigationDrawerItems';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { AdvancedSettingsToggle } from 'twenty-ui';
|
||||
import { AdvancedSettingsToggle } from 'twenty-ui/navigation';
|
||||
|
||||
export type AppNavigationDrawerProps = {
|
||||
className?: string;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useRecoilState, useSetRecoilState } from 'recoil';
|
||||
import { IconSearch, IconSettings } from 'twenty-ui';
|
||||
|
||||
import { useOpenRecordsSearchPageInCommandMenu } from '@/command-menu/hooks/useOpenRecordsSearchPageInCommandMenu';
|
||||
import { CurrentWorkspaceMemberFavoritesFolders } from '@/favorites/components/CurrentWorkspaceMemberFavoritesFolders';
|
||||
@ -18,6 +17,7 @@ import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
|
||||
import styled from '@emotion/styled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
|
||||
import { IconSearch, IconSettings } from 'twenty-ui/display';
|
||||
|
||||
const StyledMainSection = styled(NavigationDrawerSection)`
|
||||
min-height: fit-content;
|
||||
|
||||
@ -4,15 +4,15 @@ import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpe
|
||||
import { useOpenSettingsMenu } from '@/navigation/hooks/useOpenSettings';
|
||||
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { useIsSettingsPage } from '../hooks/useIsSettingsPage';
|
||||
import { currentMobileNavigationDrawerState } from '../states/currentMobileNavigationDrawerState';
|
||||
import {
|
||||
IconComponent,
|
||||
IconList,
|
||||
IconSearch,
|
||||
IconSettings,
|
||||
NavigationBar,
|
||||
} from 'twenty-ui';
|
||||
import { useIsSettingsPage } from '../hooks/useIsSettingsPage';
|
||||
import { currentMobileNavigationDrawerState } from '../states/currentMobileNavigationDrawerState';
|
||||
} from 'twenty-ui/display';
|
||||
import { NavigationBar } from 'twenty-ui/navigation';
|
||||
|
||||
type NavigationBarItemName = 'main' | 'search' | 'tasks' | 'settings';
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { createState } from '@ui/utilities/state/utils/createState';
|
||||
|
||||
import { createState } from 'twenty-ui/utilities';
|
||||
export const currentMobileNavigationDrawerState = createState<
|
||||
'main' | 'settings'
|
||||
>({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { createState } from 'twenty-ui';
|
||||
import { localStorageEffect } from '~/utils/recoil-effects';
|
||||
import { createState } from 'twenty-ui/utilities';
|
||||
|
||||
export const lastVisitedObjectMetadataItemIdState = createState<string | null>({
|
||||
key: 'lastVisitedObjectMetadataItemIdState',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { createState } from 'twenty-ui';
|
||||
import { localStorageEffect } from '~/utils/recoil-effects';
|
||||
import { createState } from 'twenty-ui/utilities';
|
||||
|
||||
export const lastVisitedViewPerObjectMetadataItemState = createState<Record<
|
||||
string,
|
||||
|
||||
Reference in New Issue
Block a user