PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0.1
GiveWP – Donation Plugin and Fundraising Platform v4.18.0.1
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 / error-message / index.tsx

index.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.18.0.1, at src/DonorDashboards/resources/js/app/components/error-message/index.tsx

34 lines 987 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 ModalDialog from '@givewp/components/AdminUI/ModalDialog';
3 import {store} from '../../tabs/recurring-donations/store';
4 import {setError} from '../../tabs/recurring-donations/store/actions';
5
6 import './style.scss';
7
8 type ErrorMessageProps = {
9 error: string;
10 };
11
12 export default function ErrorMessage({error}: ErrorMessageProps) {
13 const {dispatch} = store;
14
15 const toggleModal = () => {
16 dispatch(setError(null));
17 };
18
19 return (
20 <ModalDialog
21 wrapperClassName={'give-donor-dashboard__error-modal'}
22 title={__('Error', 'give')}
23 showHeader={true}
24 isOpen={!!error}
25 handleClose={toggleModal}
26 >
27 <p className={'give-donor-dashboard__error-message'}>{error}</p>
28 <button className={'give-donor-dashboard__error-close'} onClick={toggleModal}>
29 {__('Okay', 'give')}
30 </button>
31 </ModalDialog>
32 );
33 }
34