| 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 |
| |
| 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 |
• |
| 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 |
|