Rename document tab in sidebar based on editor mode

[MAILPOET-6336]
This commit is contained in:
Rostislav Wolny
2024-12-02 16:13:29 +01:00
committed by Rostislav Wolný
parent ed8d64816c
commit c612eb1c4e

View File

@ -13,12 +13,16 @@ import { Tabs } from '../../private-apis';
* Internal dependencies
*/
import { mainSidebarDocumentTab, mainSidebarBlockTab } from '../../store';
import { useEditorMode } from '../../hooks';
export function HeaderTabs( _, ref ) {
const [ editorMode ] = useEditorMode();
return (
<Tabs.TabList ref={ ref }>
<Tabs.Tab tabId={ mainSidebarDocumentTab }>
{ __( 'Email', 'mailpoet' ) }
{ editorMode === 'template'
? __( 'Template', 'mailpoet' )
: __( 'Email', 'mailpoet' ) }
</Tabs.Tab>
<Tabs.Tab tabId={ mainSidebarBlockTab }>{ __( 'Block' ) }</Tabs.Tab>
</Tabs.TabList>