PluginProbe
Extendify / 0.2.0
Extendify v0.2.0
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / components / notices / WelcomeNotice.js

WelcomeNotice.js in Extendify 0.2.0, at src/components/notices/WelcomeNotice.js

47 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n'
2 import { Button } from '@wordpress/components'
3 import { useUserStore } from '../../state/User'
4 import { useGlobalStore } from '../../state/GlobalState'
5
6 export default function WelcomeNotice() {
7 const setOpen = useGlobalStore((state) => state.setOpen)
8
9 const disableLibrary = () => {
10 const button = document.getElementById(
11 'extendify-templates-inserter-btn',
12 )
13 button.classList.add('invisible')
14 useUserStore.setState({ enabled: false })
15 setOpen(false)
16 }
17
18 return (
19 <>
20 <span className="text-black">
21 {__('Welcome to the Extendify Library', 'extendify')}
22 </span>
23 <span className="px-2 opacity-50" aria-hidden="true">
24 &#124;
25 </span>
26 <div className="flex space-x-2 justify-center items-center">
27 <Button
28 variant="link"
29 className="text-black underline hover:no-underline p-0 h-auto"
30 href={`https://extendify.com/welcome/?utm_source=${window.extendifyData.sdk_partner}&utm_medium=library&utm_campaign=welcome-notice&utm_content=tell-me-more`}
31 target="_blank">
32 {__('Tell me more', 'extendify')}
33 </Button>
34 <span className="font-bold" aria-hidden="true">
35 &bull;
36 </span>
37 <Button
38 variant="link"
39 className="text-black underline hover:no-underline p-0 h-auto"
40 onClick={disableLibrary}>
41 {__('Turn off the library', 'extendify')}
42 </Button>
43 </div>
44 </>
45 )
46 }
47