CloudLibrary
1 year ago
Settings
1 year ago
StarterSites
3 years ago
App.js
2 years ago
Card.js
3 years ago
CategoriesTabs.js
3 years ago
CategorySelector.js
2 years ago
CustomTooltip.js
3 years ago
DocNotice.js
2 years ago
EditorSelector.js
2 years ago
EditorTabs.js
4 years ago
Header.js
2 years ago
Icon.js
2 years ago
ImportModal.js
1 year ago
ImportModalError.js
2 years ago
ImportModalMock.js
4 years ago
ImportModalNote.js
4 years ago
ImportStepper.js
1 year ago
InstallModal.js
1 year ago
License.js
2 years ago
LicensePanelContext.js
3 years ago
Loading.js
4 years ago
Main.js
1 year ago
Migration.js
4 years ago
NewTCNotice.js
1 year ago
Notification.js
4 years ago
OnboardingContent.js
4 years ago
PreviewFrame.js
3 years ago
Search.js
2 years ago
StarterSiteCard.js
3 years ago
NewTCNotice.js
55 lines
| 1 | import {__} from '@wordpress/i18n'; |
| 2 | import {Button} from '@wordpress/components'; |
| 3 | import {close} from '@wordpress/icons'; |
| 4 | import {useState} from '@wordpress/element'; |
| 5 | import {ajaxAction} from '../utils/rest'; |
| 6 | |
| 7 | export default function () { |
| 8 | const [isVisible, setIsVisible] = useState(true); |
| 9 | |
| 10 | const { |
| 11 | show, |
| 12 | ajaxURL, |
| 13 | nonce |
| 14 | } = window.tiobDash.newTCNotice; |
| 15 | |
| 16 | const dismissNotice = () => { |
| 17 | ajaxAction( |
| 18 | ajaxURL, |
| 19 | 'dismiss_new_tc_notice', |
| 20 | nonce |
| 21 | ).then( (r) => { |
| 22 | console.log(r); |
| 23 | setIsVisible(false); |
| 24 | } ).catch(e => { |
| 25 | console.error(e); |
| 26 | } ); |
| 27 | }; |
| 28 | |
| 29 | if (!show || ! isVisible) { |
| 30 | return null; |
| 31 | } |
| 32 | |
| 33 | return ( |
| 34 | <div className="tiob-new-tc-notice"> |
| 35 | <div> |
| 36 | <p> |
| 37 | {__('We\'ve launched a dedicated Templates Cloud plugin that offers advanced permission controls and additional features. Try it out from your Themeisle account.', 'templates-patterns-collection')} |
| 38 | </p> |
| 39 | |
| 40 | <p className="description"> |
| 41 | {__('If you already have templates saved in the cloud, you can still use them in this plugin.', 'templates-patterns-collection')} |
| 42 | </p> |
| 43 | </div> |
| 44 | |
| 45 | <Button |
| 46 | size="compact" |
| 47 | className="dismiss" |
| 48 | icon={close} |
| 49 | iconSize={20} |
| 50 | label={__('Dismiss', 'templates-patterns-collection')} |
| 51 | onClick={dismissNotice} |
| 52 | /> |
| 53 | </div> |
| 54 | ); |
| 55 | } |