PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
give / src / Views / Components / AdminDetailsPage / Tabs / TabPanels.tsx

TabPanels.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/Views/Components/AdminDetailsPage/Tabs/TabPanels.tsx

29 lines 962 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2 import { TabPanel, TabsContext } from 'react-aria-components';
3 import { Tab as TabType } from '../types';
4 import ErrorBoundary from '../ErrorBoundary';
5 import styles from '../AdminDetailsPage.module.scss';
6 import { useContext } from 'react';
7
8 /**
9 * @since 4.4.0
10 */
11 export default function TabPanels({ tabDefinitions }: { tabDefinitions: TabType[] }) {
12 // @ts-ignore
13 const {selectedKey} = useContext(TabsContext);
14 const activeTab = tabDefinitions.find((tab) => tab.id === selectedKey);
15 const isFullWidth = activeTab?.fullwidth;
16
17 return (
18 <div className={`${styles.pageContent} ${isFullWidth ? styles.fullWidth : ''}`}>
19 <ErrorBoundary>
20 {tabDefinitions.map((tab) => (
21 <TabPanel key={tab.id} id={tab.id}>
22 <tab.content />
23 </TabPanel>
24 ))}
25 </ErrorBoundary>
26 </div>
27 );
28 }
29