PluginProbe
Elementor Website Builder – more than just a page builder / 3.8.0-beta1
Elementor Website Builder – more than just a page builder v3.8.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
elementor / app / modules / kit-library / assets / js / components / kit-list.js

kit-list.js in Elementor Website Builder – more than just a page builder 3.8.0-beta1, at app/modules/kit-library/assets/js/components/kit-list.js

35 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { useLocation } from '@reach/router';
2 import Kit from '../models/kit';
3 import KitListItem from './kit-list-item';
4 import NewPageKitListItem from '../../../../onboarding/assets/js/components/new-page-kit-list-item';
5 import { CssGrid } from '@elementor/app-ui';
6
7 export default function KitList( props ) {
8 const location = useLocation();
9
10 const referrer = new URLSearchParams( location.pathname.split( '?' )?.[ 1 ] ).get( 'referrer' );
11
12 return (
13 <CssGrid spacing={ 24 } colMinWidth={ 290 }>
14 {
15 'onboarding' === referrer &&
16 <NewPageKitListItem />
17 }
18 {
19 props.data.map( ( model, index ) => (
20 // The + 1 was added in order to start the map.index from 1 and not from 0.
21 <KitListItem key={ model.id } model={ model } index={ index + 1 } queryParams={ props.queryParams?.search } source={ props.source } />
22 ) )
23 }
24 </CssGrid>
25 );
26 }
27
28 KitList.propTypes = {
29 data: PropTypes.arrayOf( PropTypes.instanceOf( Kit ) ),
30 queryParams: PropTypes.shape( {
31 search: PropTypes.string,
32 } ),
33 source: PropTypes.string,
34 };
35