@@ -4,7 +4,7 @@ import VizSensor from 'react-visibility-sensor';
44import { chevronLeft , chevronRight , close } from '@wordpress/icons' ;
55import { useEffect , useState , Fragment } from '@wordpress/element' ;
66import { withDispatch , withSelect } from '@wordpress/data' ;
7- import { Spinner , Button } from '@wordpress/components' ;
7+ import { Spinner , Button , Icon } from '@wordpress/components' ;
88import { compose } from '@wordpress/compose' ;
99import { __ , isRTL } from '@wordpress/i18n' ;
1010
@@ -14,6 +14,7 @@ import Loading from '../Loading';
1414import Filters from './Filters' ;
1515import PreviewFrame from './PreviewFrame' ;
1616import ImportTemplatesModal from './ImportTemplatesModal' ;
17+ import Logo from '../Icon' ;
1718
1819const Library = ( {
1920 isGeneral,
@@ -23,6 +24,7 @@ const Library = ( {
2324 templateModal,
2425 themeStatus,
2526 currentTab,
27+ userStatus,
2628} ) => {
2729 const [ library , setLibrary ] = useState ( {
2830 gutenberg : [ ] ,
@@ -192,13 +194,13 @@ const Library = ( {
192194
193195 const handlePreview = ( url ) => {
194196 setPreviewUrl ( url ) ;
195- setPreview ( true ) ;
197+ setPreview ( true ) ;
196198 } ;
197199
198200 const handleClose = ( ) => {
199201 setPreviewUrl ( '' ) ;
200- setPreview ( false ) ;
201- }
202+ setPreview ( false ) ;
203+ } ;
202204
203205 const handleImport = ( id ) => {
204206 if ( themeStatus ) {
@@ -216,7 +218,10 @@ const Library = ( {
216218 const previewedItem =
217219 library [ type ] &&
218220 library [ type ] . find ( ( item ) => previewUrl === item . link ) ;
219- const wrapClasses = classnames ( 'cloud-items' , { 'is-grid' : isGrid } ) ;
221+ const wrapClasses = classnames ( 'cloud-items' , {
222+ 'is-grid' : isGrid || ( ! userStatus && ! isGeneral ) ,
223+ 'is-dummy' : ! userStatus && ! isGeneral ,
224+ } ) ;
220225
221226 const handlePrevious = ( ) => {
222227 let newIndex = currentPreviewIndex - 1 ;
@@ -282,6 +287,56 @@ const Library = ( {
282287 } ) ;
283288 } ;
284289
290+ if ( ! userStatus && ! isGeneral ) {
291+ return (
292+ < div className = { wrapClasses } >
293+ < div className = "table" >
294+ { [ ...Array ( 12 ) ] . map ( ( i , n ) => (
295+ < ListItem
296+ sortingOrder = { getOrder ( ) }
297+ onPreview = { handlePreview }
298+ userTemplate = { false }
299+ key = { n }
300+ item = { { } }
301+ grid = { true }
302+ />
303+ ) ) }
304+ </ div >
305+
306+ < div className = "upsell-modal-overlay" >
307+ < div className = "upsell-modal" >
308+ < div className = "upsell-modal-content" >
309+ < div className = "info" >
310+ < h3 >
311+ { __ ( 'Templates Cloud is a PRO Feature' ) }
312+ </ h3 >
313+
314+ < p >
315+ { __ (
316+ 'Unlock the Templates Cloud features and save your pages or posts in the cloud.'
317+ ) }
318+ </ p >
319+
320+ < Button
321+ variant = "primary"
322+ isPrimary
323+ href = "https://themeisle.com/themes/neve/upgrade/?utm_medium=nevedashboard& utm_source = neve & utm_campaign = templatecloud & utm_content = upgradetoprobtn and
324+ https ://themeisle.com/themes/neve/neve-upgrade-new/?utm_medium=nevedashboard&utm_source=neve&utm_campaign=templatecloud&utm_content=changeplanbtn"
325+ target = "_blank"
326+ >
327+ { __ ( 'Upgrade to PRO' ) }
328+ </ Button >
329+ </ div >
330+ < div className = "icon" >
331+ < Icon icon = { Logo } />
332+ </ div >
333+ </ div >
334+ </ div >
335+ </ div >
336+ </ div >
337+ ) ;
338+ }
339+
285340 return (
286341 < div className = { wrapClasses } >
287342 < >
@@ -377,7 +432,28 @@ const Library = ( {
377432 ) }
378433 </ >
379434 ) : (
380- < Fragment > { __ ( 'No templates found.' ) } </ Fragment >
435+ < div className = "empty-information" >
436+ < img
437+ src = {
438+ window . tiobDash . assets + '/img/layout.jpg'
439+ }
440+ alt = { __ ( 'No Templates Found' ) }
441+ />
442+ < h3 > { __ ( 'There are no templates yet' ) } </ h3 >
443+ < p >
444+ { __ (
445+ 'You can add a page or post to the cloud by accessing it with the WordPress or Elementor/Beaver editor. Learn more about this in our docs.'
446+ ) }
447+ </ p >
448+ < Button
449+ variant = "secondary"
450+ isSecondary
451+ href = "https://docs.themeisle.com/article/1354-neve-template-cloud-library?utm_medium=nevedashboard& utm_source = templatecloud & utm_campaign = neve & utm_content = learnmore "
452+ target = "_blank"
453+ >
454+ { __ ( 'Learn more' ) }
455+ </ Button >
456+ </ div >
381457 ) ) }
382458 { previewUrl && (
383459 < PreviewFrame
@@ -426,21 +502,23 @@ const Library = ( {
426502 toImport &&
427503 ! isLoading &&
428504 toImport . length > 0 && (
429- < ImportTemplatesModal
430- generalTemplates = { true }
431- isUserTemplate = { ! isGeneral }
432- templatesData = { toImport }
433- />
434- ) }
505+ < ImportTemplatesModal
506+ generalTemplates = { true }
507+ isUserTemplate = { ! isGeneral }
508+ templatesData = { toImport }
509+ />
510+ ) }
435511 </ div >
436512 ) ;
437513} ;
438514
439515export default compose (
440516 withDispatch ( ( dispatch ) => {
441- const { setInstallModalStatus, setTemplateModal, setPreviewStatus } = dispatch (
442- 'neve-onboarding'
443- ) ;
517+ const {
518+ setInstallModalStatus,
519+ setTemplateModal,
520+ setPreviewStatus,
521+ } = dispatch ( 'neve-onboarding' ) ;
444522
445523 return {
446524 setPreview : ( status ) => setPreviewStatus ( status ) ,
@@ -454,13 +532,15 @@ export default compose(
454532 getThemeAction,
455533 getCurrentEditor,
456534 getCurrentTab,
535+ getUserStatus,
457536 } = select ( 'neve-onboarding' ) ;
458537
459538 return {
460539 templateModal : getTemplateModal ( ) ,
461540 themeStatus : getThemeAction ( ) . action || false ,
462541 editor : getCurrentEditor ( ) ,
463542 currentTab : getCurrentTab ( ) ,
543+ userStatus : getUserStatus ( ) ,
464544 } ;
465545 } )
466546) ( Library ) ;
0 commit comments