images
1 year ago
notification
9 months ago
query
1 year ago
state
1 year ago
index.js
1 year ago
index.scss
1 year ago
notification-icon.jsx
1 year ago
notifications-container.jsx
1 year ago
notifications.jsx
1 year ago
index.js
31 lines
| 1 | import './index.scss'; |
| 2 | import { QueryClientProvider } from '@tanstack/react-query'; |
| 3 | import { queryClient } from './query/client'; |
| 4 | import { Notifications } from './notifications'; |
| 5 | import { StateProvider } from './state/state'; |
| 6 | import { createRoot } from '@wordpress/element'; |
| 7 | |
| 8 | document.addEventListener( 'DOMContentLoaded', () => { |
| 9 | const postsContainer = document.getElementById( 'wpwrap' ); |
| 10 | if ( postsContainer ) { |
| 11 | const div = document.createElement( 'div' ); |
| 12 | const wrapper = document.createElement( 'div' ); |
| 13 | wrapper.setAttribute( 'id', 'wpchill-notifications-wrapper' ); |
| 14 | wrapper.classList.add( 'wpchill-best-grid-gallery' ); |
| 15 | div.setAttribute( 'id', 'wpchill-notifications-root' ); |
| 16 | |
| 17 | postsContainer.prepend( wrapper ); |
| 18 | wrapper.appendChild( div ); |
| 19 | const root = createRoot( |
| 20 | document.getElementById( 'wpchill-notifications-root' ), |
| 21 | ); |
| 22 | root.render( |
| 23 | <QueryClientProvider client={ queryClient }> |
| 24 | <StateProvider> |
| 25 | <Notifications /> |
| 26 | </StateProvider> |
| 27 | </QueryClientProvider>, |
| 28 | ); |
| 29 | } |
| 30 | } ); |
| 31 |