PluginProbe
Elementor Website Builder – more than just a page builder / 3.8.0
Elementor Website Builder – more than just a page builder v3.8.0
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 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
elementor / app / modules / onboarding / assets / js / components / progress-bar / progress-bar.js

progress-bar.js in Elementor Website Builder – more than just a page builder 3.8.0, at app/modules/onboarding/assets/js/components/progress-bar/progress-bar.js

71 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { useContext } from 'react';
2 import { OnboardingContext } from '../../context/context';
3 import { useNavigate } from '@reach/router';
4
5 import ProgressBarItem from './progress-bar-item';
6
7 export default function ProgressBar() {
8 const { state } = useContext( OnboardingContext ),
9 navigate = useNavigate(),
10 progressBarItemsConfig = [
11 {
12 id: 'account',
13 title: __( 'Elementor Account', 'elementor' ),
14 route: 'account',
15 },
16 ];
17
18 // If hello theme is already activated when onboarding starts, don't show this step in the onboarding.
19 if ( ! elementorAppConfig.onboarding.helloActivated ) {
20 progressBarItemsConfig.push( {
21 id: 'hello',
22 title: __( 'Hello Theme', 'elementor' ),
23 route: 'hello',
24 } );
25 }
26
27 progressBarItemsConfig.push( {
28 id: 'siteName',
29 title: __( 'Site Name', 'elementor' ),
30 route: 'site-name',
31 },
32 {
33 id: 'siteLogo',
34 title: __( 'Site Logo', 'elementor' ),
35 route: 'site-logo',
36 },
37 {
38 id: 'goodToGo',
39 title: __( 'Good to Go', 'elementor' ),
40 route: 'good-to-go',
41 } );
42
43 const progressBarItems = progressBarItemsConfig.map( ( itemConfig, index ) => {
44 itemConfig.index = index;
45
46 if ( state.steps[ itemConfig.id ] ) {
47 itemConfig.onClick = () => {
48 elementorCommon.events.dispatchEvent( {
49 event: 'step click',
50 version: '',
51 details: {
52 placement: elementorAppConfig.onboarding.eventPlacement,
53 step: state.currentStep,
54 next_step: itemConfig.id,
55 },
56 } );
57
58 navigate( '/onboarding/' + itemConfig.id );
59 };
60 }
61
62 return <ProgressBarItem key={ itemConfig.id } { ...itemConfig } />;
63 } );
64
65 return (
66 <div className="e-onboarding__progress-bar">
67 { progressBarItems }
68 </div>
69 );
70 }
71