Skip to content

Commit e1945cb

Browse files
committed
remove terms conditon - important update
1 parent 52d07a0 commit e1945cb

File tree

4 files changed

+9
-89
lines changed

4 files changed

+9
-89
lines changed

inc/admin/dashboard/src/components/wizards/WizFooter.jsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { useEffect, useState } from "react";
22
import { Button } from "../ui/button";
3-
import { useExtensions, useSkip, useWidgets } from "@/hooks/app.hooks";
3+
import { useExtensions, useWidgets } from "@/hooks/app.hooks";
44
import { WizNavList } from "@/config/nav/wiz-nav";
55

66
const WizFooter = ({ NavigateComponent }) => {
77
const [currentPath, setCurrentPath] = useState("");
88

99
const { allExtensions } = useExtensions();
1010
const { allWidgets } = useWidgets();
11-
const { setIsSkipTerms } = useSkip();
1211

1312
const urlParams = new URLSearchParams(window.location.search);
1413

@@ -17,7 +16,7 @@ const WizFooter = ({ NavigateComponent }) => {
1716
if (tabValue) {
1817
setCurrentPath(tabValue);
1918
} else {
20-
setCurrentPath("terms");
19+
setCurrentPath("getting-started");
2120
}
2221
}, [urlParams]);
2322

@@ -133,16 +132,7 @@ const WizFooter = ({ NavigateComponent }) => {
133132
Go back
134133
</Button>
135134
) : (
136-
<Button
137-
variant="link"
138-
className="text-gray-500"
139-
onClick={() => {
140-
setIsSkipTerms(true);
141-
goToContinue(currentPath);
142-
}}
143-
>
144-
Skip
145-
</Button>
135+
""
146136
)}
147137

148138
<Button

inc/admin/dashboard/src/config/nav/wiz-nav.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
11
export const WizNavList = [
22
{
33
serial: 1,
4-
title: "Terms",
5-
path: "terms",
6-
},
7-
{
8-
serial: 2,
94
title: "Getting Started",
105
path: "getting-started",
116
},
127
{
13-
serial: 3,
8+
serial: 2,
149
title: "Widgets",
1510
path: "widgets",
1611
},
1712
{
18-
serial: 4,
13+
serial: 3,
1914
title: "Extensions",
2015
path: "extensions",
2116
},
2217
{
23-
serial: 5,
18+
serial: 4,
2419
title: "Templates",
2520
path: "templates",
2621
},
2722
{
28-
serial: 6,
23+
serial: 5,
2924
title: "Go Pro",
3025
path: "go-pro",
3126
},
3227
{
33-
serial: 7,
28+
serial: 6,
3429
title: "Congratulations",
3530
path: "congratulations",
3631
},

inc/admin/dashboard/src/layouts/WizardLayout.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ScrollArea } from "@/components/ui/scroll-area";
22
import WizFooter from "@/components/wizards/WizFooter";
33
import { WizHeader } from "@/components/wizards/WizHeader";
4-
import WizardTerms from "@/pages/wizards/WizardTerms";
54
import WizCongratulation from "@/pages/wizards/WizCongratulation";
65
import { useEffect, useState, lazy, Suspense } from "react";
76

@@ -25,8 +24,6 @@ const WizardLayout = () => {
2524

2625
const showContent = (tabKey) => {
2726
switch (tabKey) {
28-
case "terms":
29-
return <WizardTerms />;
3027
case "getting-started":
3128
return <WizardStart />;
3229
case "widgets":
@@ -40,7 +37,7 @@ const WizardLayout = () => {
4037
case "congratulations":
4138
return <WizCongratulation />;
4239
default:
43-
return <WizardTerms />;
40+
return <WizardStart />;
4441
}
4542
};
4643

inc/admin/dashboard/src/pages/wizards/WizWidget.jsx

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,7 @@
11
import ShowWizWidgets from "@/components/wizards/ShowWizWidgets";
22
import WidgetTopBg from "../../../public/images/wizard/widget-top-bg.png";
3-
import { useEffect } from "react";
4-
import { useSkip } from "@/hooks/app.hooks";
53

64
const WizWidget = () => {
7-
const { isSkipTerms } = useSkip();
8-
9-
const API_ENDPOINT =
10-
"https://themecrowdy.com/wp-json/fluent-crm/v2/subscribers";
11-
const AUTH_USERNAME = "rayhan";
12-
const AUTH_PASSWORD = "f1R7mK7WnjK17x7XbcxVH6b5";
13-
const authHeader = btoa(`${AUTH_USERNAME}:${AUTH_PASSWORD}`);
14-
const extract_name = extractNameFromEmail(WCF_ADDONS_ADMIN.user.email);
15-
const subscriberData = {
16-
first_name:
17-
WCF_ADDONS_ADMIN.user.f_name == ""
18-
? extract_name
19-
: WCF_ADDONS_ADMIN.user.f_name,
20-
last_name: "",
21-
email: WCF_ADDONS_ADMIN.user.email,
22-
tags: ["animation-addon"],
23-
lists: [1, 4],
24-
status: "subscribed",
25-
};
26-
27-
function extractNameFromEmail(email) {
28-
const nameParts = email.split("@")[0].split(".");
29-
const name = nameParts
30-
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
31-
.join(" ");
32-
return name;
33-
}
34-
35-
// Make the POST request
36-
async function addSubscriber() {
37-
try {
38-
const response = await fetch(API_ENDPOINT, {
39-
method: "POST",
40-
headers: {
41-
Authorization: `Basic ${authHeader}`,
42-
"Content-Type": "application/json",
43-
},
44-
body: JSON.stringify(subscriberData),
45-
});
46-
47-
if (!response.ok) {
48-
throw new Error(`HTTP error! Status: ${response.status}`);
49-
}
50-
51-
await response.json();
52-
localStorage.setItem("wcfanim_addon_subscribe", "yes");
53-
} catch (error) {
54-
localStorage.setItem("wcfanim_addon_subscribe", "yes");
55-
}
56-
}
57-
58-
useEffect(() => {
59-
if (
60-
!isSkipTerms &&
61-
localStorage.getItem("wcfanim_addon_subscribe") != "yes"
62-
) {
63-
addSubscriber();
64-
}
65-
}, []);
66-
675
return (
686
<div className="rounded-lg overflow-hidden mx-2.5">
697
<div className="bg-[linear-gradient(0deg,rgba(245,246,248,0.50)_0%,rgba(245,246,248,0.50)_100%)] rounded-lg">

0 commit comments

Comments
 (0)