mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
Merge branch 'next' into develop
This commit is contained in:
commit
a2c2255d48
@ -11,6 +11,7 @@ import { useFieldSchema } from '@formily/react';
|
|||||||
import { useMemo, useContext } from 'react';
|
import { useMemo, useContext } from 'react';
|
||||||
import { useBlockTemplateContext } from '../../schema-templates/BlockTemplateProvider';
|
import { useBlockTemplateContext } from '../../schema-templates/BlockTemplateProvider';
|
||||||
import { BlockItemCardContext } from '../../schema-component/antd/block-item/BlockItemCard';
|
import { BlockItemCardContext } from '../../schema-component/antd/block-item/BlockItemCard';
|
||||||
|
import { useCurrentRoute } from '../../route-switch';
|
||||||
|
|
||||||
export const useBlockHeightProps = () => {
|
export const useBlockHeightProps = () => {
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
@ -19,13 +20,13 @@ export const useBlockHeightProps = () => {
|
|||||||
const pageSchema = useMemo(() => getPageSchema(blockTemplateSchema || fieldSchema), []);
|
const pageSchema = useMemo(() => getPageSchema(blockTemplateSchema || fieldSchema), []);
|
||||||
const { disablePageHeader, enablePageTabs, hidePageTitle } = pageSchema?.['x-component-props'] || {};
|
const { disablePageHeader, enablePageTabs, hidePageTitle } = pageSchema?.['x-component-props'] || {};
|
||||||
const { titleHeight } = useContext(BlockItemCardContext) || ({} as any);
|
const { titleHeight } = useContext(BlockItemCardContext) || ({} as any);
|
||||||
|
const currentRoute = useCurrentRoute();
|
||||||
return {
|
return {
|
||||||
heightProps: {
|
heightProps: {
|
||||||
...cardItemSchema?.['x-component-props'],
|
...cardItemSchema?.['x-component-props'],
|
||||||
title: cardItemSchema?.['x-component-props']?.title || cardItemSchema?.['x-component-props']?.description,
|
title: cardItemSchema?.['x-component-props']?.title || cardItemSchema?.['x-component-props']?.description,
|
||||||
disablePageHeader,
|
disablePageHeader,
|
||||||
enablePageTabs,
|
enablePageTabs: currentRoute.enableTabs || enablePageTabs,
|
||||||
hidePageTitle,
|
hidePageTitle,
|
||||||
titleHeight: titleHeight,
|
titleHeight: titleHeight,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user