| 1 |
// Entry point for Donor Profile app |
| 2 |
|
| 3 |
// Vendor dependencies |
| 4 |
import {HashRouter as Router} from 'react-router-dom'; |
| 5 |
import {createRoot} from 'react-dom/client'; |
| 6 |
import React from 'react'; |
| 7 |
import {Provider} from 'react-redux'; |
| 8 |
|
| 9 |
import {library} from '@fortawesome/fontawesome-svg-core'; |
| 10 |
import {fas} from '@fortawesome/free-solid-svg-icons'; |
| 11 |
|
| 12 |
window.React = React; |
| 13 |
|
| 14 |
library.add(fas); |
| 15 |
|
| 16 |
// Store dependencies |
| 17 |
import {store} from './store'; |
| 18 |
|
| 19 |
// Internal dependencies |
| 20 |
import {registerDefaultTabs} from './tabs'; |
| 21 |
import {registerTab} from './utils'; |
| 22 |
|
| 23 |
// DonorDashboards app |
| 24 |
import App from './components/app'; |
| 25 |
|
| 26 |
import './style.scss'; |
| 27 |
|
| 28 |
window.giveDonorDashboard = { |
| 29 |
store, |
| 30 |
utils: { |
| 31 |
registerTab, |
| 32 |
}, |
| 33 |
}; |
| 34 |
|
| 35 |
/** |
| 36 |
* @since 2.11.1 Load after DOM Content is loaded so that wp.i18n available to parse translatable strings. |
| 37 |
* @link https://github.com/impress-org/givewp/pull/5842 |
| 38 |
*/ |
| 39 |
window.addEventListener('DOMContentLoaded', (event) => { |
| 40 |
registerDefaultTabs(); |
| 41 |
|
| 42 |
const root = createRoot(document.getElementById('give-donor-dashboard')); |
| 43 |
|
| 44 |
root.render( |
| 45 |
<Provider store={store}> |
| 46 |
<Router> |
| 47 |
<App /> |
| 48 |
</Router> |
| 49 |
</Provider>, |
| 50 |
); |
| 51 |
}); |
| 52 |
|