mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
parent
533230b65a
commit
c690fcf7fe
@ -11,7 +11,8 @@ import { useFieldSchema } from '@formily/react';
|
||||
import { useMemo, useContext } from 'react';
|
||||
import { useBlockTemplateContext } from '../../schema-templates/BlockTemplateProvider';
|
||||
import { BlockItemCardContext } from '../../schema-component/antd/block-item/BlockItemCard';
|
||||
import { useCurrentRoute } from '../../route-switch';
|
||||
import { useAllAccessDesktopRoutes, findRouteBySchemaUid } from '../../route-switch/antd/admin-layout';
|
||||
import { useCurrentPageUid } from '../../application/CustomRouterContextProvider';
|
||||
|
||||
export const useBlockHeightProps = () => {
|
||||
const fieldSchema = useFieldSchema();
|
||||
@ -20,7 +21,13 @@ export const useBlockHeightProps = () => {
|
||||
const pageSchema = useMemo(() => getPageSchema(blockTemplateSchema || fieldSchema), []);
|
||||
const { disablePageHeader, enablePageTabs, hidePageTitle } = pageSchema?.['x-component-props'] || {};
|
||||
const { titleHeight } = useContext(BlockItemCardContext) || ({} as any);
|
||||
const currentRoute = useCurrentRoute();
|
||||
const { allAccessRoutes } = useAllAccessDesktopRoutes();
|
||||
const currentPageUid = useCurrentPageUid();
|
||||
|
||||
const currentRoute = useMemo(
|
||||
() => findRouteBySchemaUid(currentPageUid, allAccessRoutes),
|
||||
[currentPageUid, allAccessRoutes],
|
||||
);
|
||||
return {
|
||||
heightProps: {
|
||||
...cardItemSchema?.['x-component-props'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user