refactor: pages import styles

This commit is contained in:
sealday 2024-03-17 12:29:29 +08:00
parent a5145e64f7
commit 7de2f749b1
5 changed files with 11 additions and 9 deletions

View File

@ -8,16 +8,12 @@ import {
SchemaSettingOptions,
useCollection,
} from '@nocobase/client';
import { HeraAdminLayout } from './layouts';
import { remove } from 'lodash';
import { CalendarBlockInitializer } from './schema-initializer/CalendarBlockInitializer';
import { MenuDesigner } from './components/ExtendedMenuDesigner';
import { SessionSubmit, SessionUpdate } from './components/ExtendedActionDesigner';
import { DetailsPage } from './pages/DetailsPage';
import { OutboundPage } from './pages/OutboundPage';
import { HomePageConfiguration } from './pages/HomePageConfiguration';
import { Configuration } from './components/TokenConfiguration';
import { HomePage } from './pages/Home';
import { InternalPDFViewer } from './schema-components/PDFViewer';
import {
PDFViewerBlockInitializer,
@ -34,7 +30,6 @@ import { FilterAssociatedFields } from './schema-initializer/FilterAssociatedFie
import { useFieldSchema } from '@formily/react';
import { isValid } from '@formily/shared';
import { useCreateActionProps } from './hooks/useCreateActionProps';
import { PageLayout } from './pages/PageLayout';
import { useOutboundActionProps } from './hooks/useOutboundActionProps';
import { ExtendedAssociationField } from './schema-components/association-field/Editable';
import { AssociatedField } from './components/AssociatedField';
@ -87,6 +82,7 @@ import { CustomField } from './components/CustomField';
import { useGetCustomAssociatedComponents } from './hooks/useGetCustomAssociatedComponents';
import { useGetCustomComponents } from './hooks/useGetCustomComponents';
import { AutoComplete } from './schema-components/AutoComplete/AutoComplete';
import { AdminLayout, DetailsPage, HomePage, OutboundPage, PageLayout } from './pages';
export { usePDFViewerRef } from './schema-initializer/PDFVIewerBlockInitializer';
export * from './custom-components';
@ -165,7 +161,7 @@ export class PluginCoreClient extends Plugin {
OutboundLinkActionInitializer,
PDFViewerBlockInitializer,
PDFViwer: InternalPDFViewer,
AdminLayout: HeraAdminLayout,
AdminLayout,
ExtendedCalendarBlockInitializer: CalendarBlockInitializer,
SettingBlock: SettingBlockInitializer,
CreateSubmitActionInitializer,

View File

@ -451,7 +451,7 @@ const usePageStyle = () => {
return useContext(PageStyleContext).style;
};
export const HeraAdminLayout = (props) => {
export const AdminLayout = (props) => {
const { addMenuItem } = useCurrentUserSettingsMenu();
const [style, setStyle] = useState('classical');
const tabItem = useTabSettings({ style, setStyle });

View File

@ -8,7 +8,7 @@ import {
} from '@nocobase/client';
import { useNavigate, useParams } from 'react-router-dom';
import pathToRegexp from 'path-to-regexp';
import { useHeadStyles } from '../pages/style';
import { useHeadStyles } from './style';
import { PageHeader as AntdPageHeader } from '@ant-design/pro-layout';
export const DetailsPage: React.FC = () => {

View File

@ -2,7 +2,7 @@ import React from 'react';
import { useStyles } from './style';
import { Carousel, Image } from 'antd';
import { useRequest } from '@nocobase/client';
import { useAppSpin } from '../layouts';
import { useAppSpin } from './AdminLayout';
export const HomePage: React.FC<{}> = () => {
const { styles } = useStyles();

View File

@ -0,0 +1,6 @@
export * from './AdminLayout';
export * from './DetailsPage';
export * from './Home';
export * from './HomePageConfiguration';
export * from './OutboundPage';
export * from './PageLayout';