HEX
Server: LiteSpeed
System: Linux server334.web-hosting.com 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User: richfield (1256)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/richfield/text.pio.richfield-egy.com/wp-content/themes/blocksy/static/js/notification/main.js
import { createElement, createRoot } from '@wordpress/element'
import Notification from './Notification'
import $ from 'jquery'

export const mount = (el) => {
	if (el.querySelector('.notice-blocksy-plugin-root')) {
		const root = createRoot(el.querySelector('.notice-blocksy-plugin-root'))
		root.render(
			<Notification
				initialStatus={
					el.querySelector('.notice-blocksy-plugin-root').dataset
						.pluginStatus
				}
				url={
					el.querySelector('.notice-blocksy-plugin-root').dataset.url
				}
				pluginUrl={
					el.querySelector('.notice-blocksy-plugin-root').dataset
						.pluginUrl
				}
				pluginLink={
					el.querySelector('.notice-blocksy-plugin-root').dataset.link
				}
			/>
		)
	}

	;[...document.querySelectorAll('[data-dismiss]')].map((el) => {
		el.addEventListener('click', (e) => {
			e.preventDefault()

			el.closest('.notice-blocksy-woo-deprecation').remove()

			$.ajax(ajaxurl, {
				type: 'POST',
				data: {
					action: 'blocksy_dismissed_notice_woo_deprecation',
				},
			})
		})
	})
}