-
WIBUHAX0R1337
-
/
home
/
coludnqa
/
www
/
wp-content
/
plugins
/
templates-patterns-collection
/
assets
/
src
/
Components
/
[ Home ]
Create Folder
Create File
Nama File / Folder
Size
Action
CloudLibrary
--
NONE
StarterSites
--
NONE
.htaccess
0.231KB
Edit File
Delete File
Rename
App.js
0.704KB
Edit File
Delete File
Rename
CustomTooltip.js
0.608KB
Edit File
Delete File
Rename
EditorSelector.js
2.708KB
Edit File
Delete File
Rename
EditorTabs.js
1.658KB
Edit File
Delete File
Rename
Header.js
4.188KB
Edit File
Delete File
Rename
Icon.js
0.785KB
Edit File
Delete File
Rename
ImportModal.js
16.545KB
Edit File
Delete File
Rename
ImportModalError.js
0.934KB
Edit File
Delete File
Rename
ImportModalMock.js
1.302KB
Edit File
Delete File
Rename
ImportModalNote.js
1.514KB
Edit File
Delete File
Rename
ImportStepper.js
1.873KB
Edit File
Delete File
Rename
InstallModal.js
4.639KB
Edit File
Delete File
Rename
Loading.js
0.729KB
Edit File
Delete File
Rename
Main.js
2.296KB
Edit File
Delete File
Rename
Migration.js
6.474KB
Edit File
Delete File
Rename
Notification.js
0.514KB
Edit File
Delete File
Rename
OnboardingContent.js
5.519KB
Edit File
Delete File
Rename
PreviewFrame.js
2.916KB
Edit File
Delete File
Rename
Search.js
2.939KB
Edit File
Delete File
Rename
StarterSiteCard.js
3.041KB
Edit File
Delete File
Rename
/* global tiobDash, localStorage */ import { withSelect, withDispatch } from '@wordpress/data'; import { useEffect } from '@wordpress/element'; import { Button, Icon } from '@wordpress/components'; import { useState } from '@wordpress/element'; import { compose } from '@wordpress/compose'; import { update } from '@wordpress/icons'; import { __ } from '@wordpress/i18n'; import Logo from './Icon'; import classnames from 'classnames'; import { v4 as uuidv4 } from 'uuid'; import { addUrlHash, getTabHash } from '../utils/common'; const TabNavigation = ( { setCurrentTab, currentTab, isFetching } ) => { const buttons = { starterSites: __( 'Starter Sites', 'templates-patterns-collection' ), pageTemplates: __( 'Page Templates', 'templates-patterns-collection' ), }; const [ isSyncing, setSyncing ] = useState( false ); const sync = () => { setSyncing( true ); localStorage.setItem( 'tpcCacheBuster', uuidv4() ); const nextTab = currentTab; setCurrentTab( null ); setTimeout( () => { setCurrentTab( nextTab ); setSyncing( false ); }, 100 ); }; if ( tiobDash.license && tiobDash.license.tier && tiobDash.license.tier === 3 ) { buttons.library = __( 'My Library', 'templates-patterns-collection' ); } const onHashChanged = () => { const hash = getTabHash(buttons); if (null === hash) { return; } const menu = document.getElementById('menu-appearance'); const libraryLink = menu.querySelector('a[href="themes.php?page=tiob-starter-sites#library"]'); const starterLink = menu.querySelector('a[href="themes.php?page=tiob-starter-sites"]'); // This is used only to set the active state of the links from the left admin nav. // So we check that those items exist before trying to mutate them. if ( libraryLink && starterLink ) { const libraryItem = libraryLink.parentElement; const starterSitesItem = starterLink.parentElement; const activeItem = menu.querySelector('.current'); activeItem.classList.remove('current'); libraryItem.classList.remove('current'); if ( hash === 'library' ){ libraryItem.classList.add('current'); } else { starterSitesItem.classList.add('current'); } } setCurrentTab(hash); } useEffect(() => { onHashChanged(); window.addEventListener('hashchange', onHashChanged) }, []); return ( <div className="header-nav"> { Object.keys( buttons ).map( ( slug ) => { return ( <Button href={'#' + slug} key={ slug } isTertiary isPressed={ slug === currentTab } onClick={ (e) => { e.preventDefault(); setCurrentTab( slug ); addUrlHash(slug); } } > { buttons[ slug ] } </Button> ); } ) } { currentTab !== 'starterSites' && ( <Button icon={ update } onClick={ sync } label={ __( 'Re-sync Library' ) } className={ classnames( 'is-sync', { 'is-loading': isSyncing, } ) } disabled={ isFetching || isSyncing } data-content={ __( 'Sync' ) } /> ) } </div> ); }; const Header = ( { isOnboarding, cancelOnboarding, setCurrentTab, currentTab, } ) => { return ( <div className="ob-head"> { ! isOnboarding && ( <> <div className="header-container"> <h2> { ! tiobDash.brandedTheme && ( <Icon icon={ Logo } /> ) } <span> { __( 'Templates Cloud', 'templates-patterns-collection' ) } </span> </h2> <TabNavigation setCurrentTab={ setCurrentTab } currentTab={ currentTab } /> </div> </> ) } { isOnboarding && ( <Button className="close-onboarding" isLink icon="no-alt" onClick={ cancelOnboarding } /> ) } </div> ); }; export default compose( withDispatch( ( dispatch ) => { const { setOnboardingState, setCurrentTab, setFetching } = dispatch( 'neve-onboarding' ); return { cancelOnboarding: () => { setOnboardingState( false ); }, setCurrentTab, setFetching, }; } ), withSelect( ( select ) => { const { getOnboardingStatus, getCurrentTab, getFetching } = select( 'neve-onboarding' ); return { isOnboarding: getOnboardingStatus(), currentTab: getCurrentTab(), isFetching: getFetching(), }; } ) )( Header );
Save!!!
© 2022 - 2023 WIBUHAXOR V1 By Lutfifakee || Padang Blackhat