PluginProbe
Extendify / 0.10.1
Extendify v0.10.1
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 / Library / components / notices / WelcomeNotice.js

WelcomeNotice.js in Extendify 0.10.1, at src/Library/components/notices/WelcomeNotice.js

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