PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.5
GiveWP – Donation Plugin and Fundraising Platform v4.15.5
4.18.0.1 4.18.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 All 258 releases
give / src / DonorDashboards / resources / js / app / components / tab-content / index.js

index.js in GiveWP – Donation Plugin and Fundraising Platform 4.15.5, at src/DonorDashboards/resources/js/app/components/tab-content/index.js

30 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {useLocation} from 'react-router-dom';
2 import {useSelector} from 'react-redux';
3 import {Fragment} from 'react';
4 import Heading from '../heading';
5 import {__} from '@wordpress/i18n';
6
7 import './style.scss';
8
9 const TabContent = () => {
10 const location = useLocation();
11 const tabsSelector = useSelector((state) => state.tabs);
12 const applicationError = useSelector((state) => state.applicationError);
13
14 const slug = location.pathname.length > 2 ? location.pathname.split('/')[1] : 'dashboard';
15 const Content = tabsSelector[slug] ? tabsSelector[slug].content : null;
16
17 return (
18 <div className="give-donor-dashboard-tab-content">
19 {applicationError ? (
20 <Fragment>
21 <Heading icon="exclamation-triangle">{__('Error', 'give')}</Heading>
22 <p style={{color: '#6b6b6b'}}>{applicationError}</p>
23 </Fragment>
24 ) : null}
25 {Content && applicationError === null ? <Content /> : null}
26 </div>
27 );
28 };
29 export default TabContent;
30