From e45be71abc4bcb6ef057333ad5157887b6b2b328 Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Mon, 29 Jul 2024 15:42:14 +0800 Subject: [PATCH] refactor: change name for add blocks menu --- .../client/pages/mobile-action-page/MobileActionPage.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/plugins/@nocobase/plugin-mobile/src/client/pages/mobile-action-page/MobileActionPage.tsx b/packages/plugins/@nocobase/plugin-mobile/src/client/pages/mobile-action-page/MobileActionPage.tsx index 949d9b4fcf..044f837114 100644 --- a/packages/plugins/@nocobase/plugin-mobile/src/client/pages/mobile-action-page/MobileActionPage.tsx +++ b/packages/plugins/@nocobase/plugin-mobile/src/client/pages/mobile-action-page/MobileActionPage.tsx @@ -20,6 +20,7 @@ import { import _ from 'lodash'; import React, { useEffect, useMemo, useState } from 'react'; import { createPortal } from 'react-dom'; +import { usePluginTranslation } from '../../locale'; import { useMobileActionPageStyle } from './MobileActionPage.style'; import { MobileTabsForMobileActionPage } from './MobileTabsForMobileActionPage'; @@ -39,6 +40,7 @@ const useMobileBlockInitializersInSubpage = ( const [originalInitializers] = useState(() => app.schemaInitializerManager.get('popup:common:addBlock'), ); + const { t } = usePluginTranslation(); const dataBlocks = originalInitializers.options.items.find((item) => item.name === 'dataBlocks'); const dataBlocksChildren = [...dataBlocks.useChildren(), ...dataBlocks.children]; @@ -47,6 +49,7 @@ const useMobileBlockInitializersInSubpage = ( const options = _.cloneDeep(originalInitializers.options); options.items = options.items.filter((item) => { if (item.name === 'dataBlocks') { + item.title = t('Desktop data blocks'); item.children = dataBlocksChildren.filter((child) => { return supportsDataBlocks.includes(child.name); }); @@ -54,6 +57,10 @@ const useMobileBlockInitializersInSubpage = ( return true; } + if (item.name === 'otherBlocks') { + item.title = t('Other desktop blocks'); + } + return item.name !== 'filterBlocks'; });