PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.1.3
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.1.3
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / wizard / assets / src / wizard-steps / WelcomeStep.js

WelcomeStep.js in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.1.3, at wizard/assets/src/wizard-steps/WelcomeStep.js

84 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React, { useEffect, useCallback } from 'react';
2 import { useHistory } from 'react-router-dom';
3 import { __ } from '@wordpress/i18n';
4 import { useStateValue } from '../utils/StateProvider';
5 // import CartFlowsLogo from '@WizardImages/cartflows-logo.svg';
6 import { ArrowRightIcon } from '@heroicons/react/24/outline';
7
8 function WelcomeStep() {
9 const history = useHistory();
10 const [ { action_button }, dispatch ] = useStateValue();
11
12 const redirectNextStep = useCallback( () => {
13 history.push( {
14 pathname: 'index.php',
15 search: `?page=cartflow-setup&step=page-builder`,
16 } );
17 }, [] );
18
19 useEffect( () => {
20 dispatch( {
21 status: 'SET_NEXT_STEP',
22 action_button: {
23 button_text: __( "Let's Start", 'cartflows' ),
24 button_class: 'wcf-start-setup',
25 },
26 } );
27
28 const startOnboardingEvent = document.addEventListener(
29 'wcf-redirect-page-builder-step',
30 function () {
31 redirectNextStep();
32 },
33 false
34 );
35
36 return () => {
37 document.removeEventListener(
38 'wcf-redirect-page-builder-step',
39 startOnboardingEvent
40 );
41 };
42 }, [ redirectNextStep ] );
43
44 return (
45 <div className="wcf-container">
46 <div className="wcf-row mt-16">
47 <div className="bg-white rounded mx-auto px-11">
48 <span className="text-sm font-medium text-primary-600 mb-10 text-center block tracking-[.24em] uppercase">
49 { __( 'Step 1 of 6', 'cartflows' ) }
50 </span>
51 <h1 className="wcf-step-heading mb-4">
52 { __( 'Welcome to CartFlows', 'cartflows' ) }
53 </h1>
54
55 <p className="text-center overflow-hidden max-w-2xl mb-10 mx-auto text-lg font-normal text-slate-500">
56 { __(
57 "You're only minutes away from having a more profitable WooCommerce store! This short setup wizard will help you get started with CartFlows.",
58 'cartflows'
59 ) }
60 </p>
61
62 <div className="flex justify-center">
63 <div
64 className={ `wcf-wizard--button ${
65 action_button.button_class
66 ? action_button.button_class
67 : ''
68 }` }
69 >
70 { action_button.button_text }
71 <ArrowRightIcon
72 className="w-5 mt-0.5 ml-1.5 stroke-2"
73 aria-hidden="true"
74 />
75 </div>
76 </div>
77 </div>
78 </div>
79 </div>
80 );
81 }
82
83 export default WelcomeStep;
84