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
Main.js
102 lines
| 1 | import { Fragment } from '@wordpress/element'; |
| 2 | import { withSelect, withDispatch } from '@wordpress/data'; |
| 3 | import { compose } from '@wordpress/compose'; |
| 4 | |
| 5 | import InstallModal from './InstallModal'; |
| 6 | import Migration from './Migration'; |
| 7 | import Library from './CloudLibrary/Library'; |
| 8 | import ImportModal from './ImportModal'; |
| 9 | import DemoSiteTemplatesImport from './CloudLibrary/DemoSiteTemplatesImport'; |
| 10 | import Header from './Header'; |
| 11 | import OnboardingContent from './OnboardingContent'; |
| 12 | import Settings from './Settings/Settings'; |
| 13 | import NewTCNotice from './NewTCNotice'; |
| 14 | |
| 15 | const Onboarding = ( { |
| 16 | getSites, |
| 17 | installModal, |
| 18 | currentTab, |
| 19 | singleImport, |
| 20 | importModal, |
| 21 | currentSiteData, |
| 22 | isOnboarding, |
| 23 | } ) => { |
| 24 | const { migration } = getSites; |
| 25 | |
| 26 | return ( |
| 27 | <Fragment> |
| 28 | <div className="ob"> |
| 29 | <Header /> |
| 30 | <div className="ob-body"> |
| 31 | <div className="content-container"> |
| 32 | |
| 33 | {['library', 'settings'].includes(currentTab) && <NewTCNotice/>} |
| 34 | |
| 35 | { migration && <Migration data={ migration } /> } |
| 36 | |
| 37 | { 'starterSites' === currentTab && |
| 38 | ( singleImport ? ( |
| 39 | <DemoSiteTemplatesImport |
| 40 | slug={ singleImport } |
| 41 | /> |
| 42 | ) : ( |
| 43 | <OnboardingContent /> |
| 44 | ) ) } |
| 45 | { 'library' === currentTab && <Library /> } |
| 46 | { 'pageTemplates' === currentTab && ( |
| 47 | <Library isGeneral={ true } /> |
| 48 | ) } |
| 49 | { 'settings' === currentTab && <Settings /> } |
| 50 | </div> |
| 51 | </div> |
| 52 | </div> |
| 53 | { importModal && currentSiteData && <ImportModal /> } |
| 54 | </Fragment> |
| 55 | ); |
| 56 | }; |
| 57 | |
| 58 | export default compose( |
| 59 | withDispatch( ( dispatch ) => { |
| 60 | const { |
| 61 | setOnboardingState, |
| 62 | setCurrentCategory, |
| 63 | setCurrentTab, |
| 64 | } = dispatch( 'neve-onboarding' ); |
| 65 | return { |
| 66 | cancelOnboarding: () => { |
| 67 | setOnboardingState( false ); |
| 68 | }, |
| 69 | resetCategory: () => { |
| 70 | setCurrentCategory( 'all' ); |
| 71 | }, |
| 72 | setCurrentTab, |
| 73 | }; |
| 74 | } ), |
| 75 | withSelect( ( select ) => { |
| 76 | const { |
| 77 | getCurrentEditor, |
| 78 | getCurrentCategory, |
| 79 | getPreviewStatus, |
| 80 | getCurrentSite, |
| 81 | getImportModalStatus, |
| 82 | getOnboardingStatus, |
| 83 | getSites, |
| 84 | getInstallModalStatus, |
| 85 | getCurrentTab, |
| 86 | getSingleImport, |
| 87 | } = select( 'neve-onboarding' ); |
| 88 | return { |
| 89 | editor: getCurrentEditor(), |
| 90 | category: getCurrentCategory(), |
| 91 | previewOpen: getPreviewStatus(), |
| 92 | currentSiteData: getCurrentSite(), |
| 93 | importModal: getImportModalStatus(), |
| 94 | installModal: getInstallModalStatus(), |
| 95 | isOnboarding: getOnboardingStatus(), |
| 96 | getSites: getSites(), |
| 97 | currentTab: getCurrentTab(), |
| 98 | singleImport: getSingleImport(), |
| 99 | }; |
| 100 | } ) |
| 101 | )( Onboarding ); |
| 102 |