balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

index.js (536B)


      1 import { checkIfUserNeedsToInstallPlugins } from '../helpers'
      2 import RequiredPluginsModal from './RequiredPluginsModal'
      3 import { render } from '@wordpress/element'
      4 
      5 export const hasRequiredPlugins = async (template) => {
      6     return {
      7         id: 'hasRequiredPlugins',
      8         pass: !(await checkIfUserNeedsToInstallPlugins(template)),
      9         allow() {},
     10         deny() {
     11             return new Promise(() => {
     12                 render(<RequiredPluginsModal/>, document.getElementById('extendify-root'))
     13             })
     14         },
     15     }
     16 }