diff --git a/packages/interface/src/components/preferences-modal-tabs/index.js b/packages/interface/src/components/preferences-modal-tabs/index.js index bc8f7358b834d4..2329d0abf6f9c4 100644 --- a/packages/interface/src/components/preferences-modal-tabs/index.js +++ b/packages/interface/src/components/preferences-modal-tabs/index.js @@ -13,15 +13,22 @@ import { __experimentalText as Text, __experimentalTruncate as Truncate, FlexItem, - TabPanel, Card, CardHeader, CardBody, + privateApis as componentsPrivateApis, } from '@wordpress/components'; -import { useMemo, useCallback, useState } from '@wordpress/element'; +import { useMemo, useState } from '@wordpress/element'; import { chevronLeft, chevronRight, Icon } from '@wordpress/icons'; import { isRTL, __ } from '@wordpress/i18n'; +/** + * Internal dependencies + */ +import { unlock } from '../../../lock-unlock'; + +const { Tabs } = unlock( componentsPrivateApis ); + const PREFERENCES_MENU = 'preferences-menu'; export default function PreferencesModalTabs( { sections } ) { @@ -53,26 +60,52 @@ export default function PreferencesModalTabs( { sections } ) { return mappedTabs; }, [ sections ] ); - const getCurrentTab = useCallback( - ( tab ) => sectionsContentMap[ tab.name ] || null, - [ sectionsContentMap ] - ); + // const getCurrentTab = useCallback( + // ( tab ) => sectionsContentMap[ tab.name ] || null, + // [ sectionsContentMap ] + // ); let modalContent; // We render different components based on the viewport size. if ( isLargeViewport ) { modalContent = ( - - { getCurrentTab } - +
+ + + { tabs.map( ( tab ) => ( + + { tab.title } + + ) ) } + + { tabs.map( ( tab ) => ( + + { sectionsContentMap[ tab.name ] || null } + + ) ) } + + { /* + { getCurrentTab } + */ } +
); } else { modalContent = (