Skip to content

Commit 76dccf8

Browse files
refactor: plan changes
1 parent 15d73ee commit 76dccf8

File tree

5 files changed

+136
-60
lines changed

5 files changed

+136
-60
lines changed

apps/OpenSign/src/components/Header.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import FullScreenButton from "./FullScreenButton";
44
import { useNavigate } from "react-router-dom";
55
import Parse from "parse";
66
import { useWindowSize } from "../hook/useWindowSize";
7-
import { checkIsSubscribed, getAppLogo, openInNewTab } from "../constant/Utils";
7+
import {
8+
checkIsSubscribed,
9+
checkIsSubscribedTeam,
10+
getAppLogo,
11+
openInNewTab
12+
} from "../constant/Utils";
813
import { isEnableSubscription, isStaging } from "../constant/const";
914

1015
const Header = ({ showSidebar }) => {
@@ -15,6 +20,7 @@ const Header = ({ showSidebar }) => {
1520
const [isOpen, setIsOpen] = useState(false);
1621
const [isSubscribe, setIsSubscribe] = useState(true);
1722
const [isPro, setIsPro] = useState(false);
23+
const [isTeam, setIsTeam] = useState(false);
1824
const [applogo, setAppLogo] = useState(
1925
localStorage.getItem("appLogo") || " "
2026
);
@@ -29,6 +35,7 @@ const Header = ({ showSidebar }) => {
2935
async function checkSubscription() {
3036
if (isEnableSubscription) {
3137
const getIsSubscribe = await checkIsSubscribed();
38+
const getIsTeam = await checkIsSubscribedTeam();
3239
if (getIsSubscribe) {
3340
const applogo = await getAppLogo();
3441
if (applogo?.logo) {
@@ -38,6 +45,7 @@ const Header = ({ showSidebar }) => {
3845
}
3946
}
4047
setIsPro(getIsSubscribe);
48+
setIsTeam(getIsTeam);
4149
setIsSubscribe(getIsSubscribe);
4250
}
4351
}
@@ -122,11 +130,16 @@ const Header = ({ showSidebar }) => {
122130
</button>
123131
</div>
124132
)}
125-
{isPro && (
133+
{!isTeam && isPro && (
126134
<div className="w-[35px] h-[35px] bg-white rounded-full ring-[1px] ring-offset-2 ring-[#002862] text-[#002862] overflow-hidden font-semibold flex items-center justify-center">
127135
PRO
128136
</div>
129137
)}
138+
{isTeam && (
139+
<div className="w-[35px] h-[35px] bg-white rounded-full ring-[1px] text-[13px] ring-offset-2 ring-[#002862] text-[#002862] overflow-hidden font-semibold flex items-center justify-center">
140+
TEAM
141+
</div>
142+
)}
130143
<div>
131144
<FullScreenButton />
132145
</div>

apps/OpenSign/src/constant/const.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export const documentCls = "contracts_Document";
44
export const themeColor = "#47a3ad";
55
export const iconColor = "#686968";
66
export const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
7-
export const isEnableSubscription = true;
8-
// process.env.REACT_APP_ENABLE_SUBSCRIPTION &&
9-
// process.env.REACT_APP_ENABLE_SUBSCRIPTION?.toLowerCase() === "true"
10-
// ? true
11-
// : false;
12-
export const isStaging = "http://localhost:3001";
13-
// window.location.origin === "https://staging-app.opensignlabs.com";
7+
export const isEnableSubscription =
8+
process.env.REACT_APP_ENABLE_SUBSCRIPTION &&
9+
process.env.REACT_APP_ENABLE_SUBSCRIPTION?.toLowerCase() === "true"
10+
? true
11+
: false;
12+
export const isStaging =
13+
window.location.origin === "https://staging-app.opensignlabs.com";

apps/OpenSign/src/json/plansArr.js

Lines changed: 88 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ const plans = [
2626
"Decline document support",
2727
"Email notifications",
2828
"Recipient authentication using OTP",
29+
"Bulk send (upto 5 docs)",
30+
"Public profiles",
31+
"And much more"
32+
],
33+
yearlyBenefits: [
34+
"Unlimited envelopes",
35+
"Sign documents yourself",
36+
"Request signatures from others",
37+
"14 field types",
38+
"Automatic e-signatures",
39+
"Completion certificates",
40+
"Send in order",
41+
"Document templates",
42+
"Import from Dropbox",
43+
"Contact book",
44+
"Document expiry support",
45+
"Decline document support",
46+
"Email notifications",
47+
"Recipient authentication using OTP",
48+
"Bulk send (upto 5 docs)",
49+
"Public profiles",
2950
"And much more"
3051
]
3152
},
@@ -34,7 +55,7 @@ const plans = [
3455
img: "professional.png",
3556
currency: "$",
3657
monthlyPrice: "29.99",
37-
yearlyPrice: `10 <sup style="font-size: 17px;">/month/user</sup>`,
58+
yearlyPrice: "9.99",
3859
subtitle: "Exclusive Access to advanced features.",
3960
btn: { text: "Subscribe", color: "op-btn-primary" },
4061
url: isStaging
@@ -53,9 +74,64 @@ const plans = [
5374
"Zapier integration",
5475
"API Access",
5576
"100 API signatures included",
56-
"DocumentId removal from signed docs",
5777
"Custom email templates",
58-
"Auto reminders"
78+
"Auto reminders",
79+
"Bulk send (upto 20 docs)",
80+
"Premium Public profile usernames",
81+
"Embedding (coming soon)"
82+
],
83+
yearlyBenefits: [
84+
"Everything in OpenSign™ free",
85+
"Field validations",
86+
"Regular expression validations",
87+
"Organize docs in OpenSign™ Drive",
88+
"Webhooks",
89+
"Zapier integration",
90+
"API Access",
91+
"240 API signatures included",
92+
"Custom email templates",
93+
"Auto reminders",
94+
"Bulk send (upto 20 docs)",
95+
"Premium Public profile usernames",
96+
"Embedding (coming soon)"
97+
]
98+
},
99+
{
100+
planName: "OPENSIGN™ TEAMS",
101+
img: "teams.png",
102+
currency: "$",
103+
monthlyPrice: `39.99<sup style="font-size: 17px;">/user</sup>`,
104+
yearlyPrice: `19.99<sup style="font-size: 17px;">/user/month</sup>`,
105+
subtitle: "Exclusive Access to advanced features.",
106+
btn: { text: "Subscribe", color: "op-btn-accent" },
107+
url: isStaging
108+
? "https://billing.zoho.in/subscribe/ed8097273a82b6bf39892c11a3bb3c381eb2705736014cfbdbde1ccf1c7a189d/team-weekly"
109+
: "https://billing.opensignlabs.com/subscribe/ef798486e6a0a11ea65f2bae8f2af901237d0702bfaa959406306635d80f138c/teams-monthly",
110+
yearlyUrl: isStaging
111+
? "https://billing.zoho.in/subscribe/ed8097273a82b6bf39892c11a3bb3c381eb2705736014cfbdbde1ccf1c7a189d/team-weekly"
112+
: "https://billing.opensignlabs.com/subscribe/ef798486e6a0a11ea65f2bae8f2af9011a864994bbeeec71fcf106188630199d/teams-yearly",
113+
target: "_self",
114+
benefits: [
115+
"Everything in OpenSign™ professional",
116+
"100 API signatures included",
117+
"Teams and Organizations",
118+
"Share Templates with teams",
119+
"Share Templates with individuals",
120+
"DocumentId removal from signed docs",
121+
"Bulk send (upto 50 docs)",
122+
"Request Payments (coming soon)",
123+
"Mobile app (coming soon)"
124+
],
125+
yearlyBenefits: [
126+
"Everything in OpenSign™ professional",
127+
"500 API signatures included",
128+
"Teams and Organizations",
129+
"Share Templates with teams",
130+
"Share Templates with individuals",
131+
"DocumentId removal from signed docs",
132+
"Bulk send (upto 50 docs)",
133+
"Request Payments (coming soon)",
134+
"Mobile app (coming soon)"
59135
]
60136
},
61137
{
@@ -75,36 +151,16 @@ const plans = [
75151
"Uptime SLA",
76152
"SSO support",
77153
"Priority support"
154+
],
155+
yearlyBenefits: [
156+
"All features",
157+
"Custom domain",
158+
"Custom branding",
159+
"Uptime SLA",
160+
"SSO support",
161+
"Priority support"
78162
]
79163
}
80164
];
81-
export const stagingPlan = {
82-
planName: "OPENSIGN™ TEAMS",
83-
img: "teams.png",
84-
currency: "$",
85-
monthlyPrice: "40",
86-
yearlyPrice: `20 <sup style="font-size: 17px;">/month/user</sup>`,
87-
subtitle: "Exclusive Access to advanced features.",
88-
btn: { text: "Subscribe", color: "op-btn-accent" },
89-
url: isStaging
90-
? "https://billing.zoho.in/subscribe/ed8097273a82b6bf39892c11a3bb3c381eb2705736014cfbdbde1ccf1c7a189d/team-weekly"
91-
: "https://billing.opensignlabs.com/subscribe/ef798486e6a0a11ea65f2bae8f2af901d1a09dfa8085585cdd4ec4d7f32137f3/professional-monthly",
92-
yearlyUrl: isStaging
93-
? "https://billing.zoho.in/subscribe/ed8097273a82b6bf39892c11a3bb3c381eb2705736014cfbdbde1ccf1c7a189d/team-weekly"
94-
: "https://billing.opensignlabs.com/subscribe/ef798486e6a0a11ea65f2bae8f2af901d8ad1135190dff951330360e47585a71/professional-yearly",
95-
target: "_self",
96-
benefits: [
97-
"Everything in OpenSign™ free, professional",
98-
"Field validations",
99-
"Regular expression validations",
100-
"Organize docs in OpenSign™ Drive",
101-
"Webhooks",
102-
"Zapier integration",
103-
"API Access",
104-
"100 API signatures included",
105-
"DocumentId removal from signed docs",
106-
"Custom email templates",
107-
"Auto reminders"
108-
]
109-
};
165+
110166
export default plans;

apps/OpenSign/src/pages/PlanSubscriptions.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import React, { useState, useEffect } from "react";
22
import { useNavigate } from "react-router-dom";
33
import checkmark from "../assets/images/checkmark.png";
4-
import plansArr, { stagingPlan } from "../json/plansArr";
4+
import plansArr from "../json/plansArr";
55
import Title from "../components/Title";
66
import Parse from "parse";
77
import { openInNewTab } from "../constant/Utils";
88
import Loader from "../primitives/Loader";
9-
import { isStaging } from "../constant/const";
109
const listItemStyle = {
1110
paddingLeft: "20px", // Add padding to create space for the image
1211
backgroundImage: `url(${checkmark})`, // Set your image as the list style image
@@ -17,7 +16,6 @@ const listItemStyle = {
1716

1817
const PlanSubscriptions = () => {
1918
const navigate = useNavigate();
20-
const isTeamPlan = plansArr.some((x) => x.planName === "OPENSIGN™ TEAMS");
2119
const [yearlyVisible, setYearlyVisible] = useState(true);
2220
const [isLoader, setIsLoader] = useState(true);
2321
const extUser =
@@ -61,9 +59,6 @@ const PlanSubscriptions = () => {
6159
phone;
6260
useEffect(() => {
6361
setIsLoader(false);
64-
if (!isTeamPlan && isStaging) {
65-
plansArr.splice(2, 0, stagingPlan);
66-
}
6762
// eslint-disable-next-line
6863
}, []);
6964

@@ -123,7 +118,7 @@ const PlanSubscriptions = () => {
123118
role="tab"
124119
className={`${yearlyVisible ? "op-tab-active" : ""} op-tab`}
125120
>
126-
Yearly (10% off)
121+
Yearly (upto 66% off)
127122
</a>
128123
</div>
129124
<ul className="op-card flex flex-col md:flex-row h-full bg-base-100 justify-center shadow-lg">
@@ -209,11 +204,18 @@ const PlanSubscriptions = () => {
209204
</div>
210205
<hr className="w-full bg-gray-300 h-[0.5px]" />
211206
<ul className="mx-1 p-3 text-left break-words text-sm list-none">
212-
{item.benefits.map((subitem, index) => (
213-
<li style={listItemStyle} key={index} className="m-1">
214-
<span className="relative">{subitem}</span>
215-
</li>
216-
))}
207+
{!yearlyVisible &&
208+
item.benefits.map((subitem, index) => (
209+
<li style={listItemStyle} key={index} className="m-1">
210+
<span className="relative">{subitem}</span>
211+
</li>
212+
))}
213+
{yearlyVisible &&
214+
item?.yearlyBenefits?.map((subitem, index) => (
215+
<li style={listItemStyle} key={index} className="m-1">
216+
<span className="relative">{subitem}</span>
217+
</li>
218+
))}
217219
</ul>
218220
</li>
219221
))}

apps/OpenSign/src/pages/UserProfile.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import sanitizeFileName from "../primitives/sanitizeFileName";
88
import axios from "axios";
99
import Tooltip from "../primitives/Tooltip";
1010
import { isEnableSubscription } from "../constant/const";
11-
import { checkIsSubscribed, handleSendOTP } from "../constant/Utils";
11+
import {
12+
checkIsSubscribed,
13+
checkIsSubscribedTeam,
14+
handleSendOTP
15+
} from "../constant/Utils";
1216
import Upgrade from "../primitives/Upgrade";
1317
import ModalUi from "../primitives/ModalUi";
1418
import Loader from "../primitives/Loader";
@@ -46,6 +50,7 @@ function UserProfile() {
4650
const [tagLine, setTagLine] = useState(
4751
extendUser && extendUser?.[0]?.Tagline
4852
);
53+
const [isTeam, setIsTeam] = useState(false);
4954
useEffect(() => {
5055
getUserDetail();
5156
}, []);
@@ -57,7 +62,9 @@ function UserProfile() {
5762
const HeaderDocId = jsonSender[0]?.HeaderDocId;
5863
if (isEnableSubscription) {
5964
const getIsSubscribe = await checkIsSubscribed();
65+
const getIsTeam = await checkIsSubscribedTeam();
6066
setIsSubscribe(getIsSubscribe);
67+
setIsTeam(getIsTeam);
6168
}
6269
if (HeaderDocId) {
6370
setIsDisableDocId(HeaderDocId);
@@ -511,9 +518,7 @@ function UserProfile() {
511518
<div className="flex justify-between items-center py-2">
512519
<span
513520
className={
514-
isSubscribe
515-
? "font-semibold"
516-
: "font-semibold text-gray-300"
521+
isTeam ? "font-semibold" : "font-semibold text-gray-300"
517522
}
518523
>
519524
Disable DocumentId :{" "}
@@ -522,17 +527,17 @@ function UserProfile() {
522527
"https://docs.opensignlabs.com/docs/help/Settings/disabledocumentid"
523528
}
524529
/>
525-
{!isSubscribe && isEnableSubscription && <Upgrade />}
530+
{!isTeam && isEnableSubscription && <Upgrade />}
526531
</span>
527532
<label
528533
className={`${
529-
isSubscribe
534+
isTeam
530535
? `${editmode ? "cursor-pointer" : ""}`
531536
: "pointer-events-none opacity-50"
532537
} relative block items-center mb-0`}
533538
>
534539
<input
535-
disabled={editmode ? false : true}
540+
disabled={isTeam ? false : true}
536541
type="checkbox"
537542
className="op-toggle transition-all checked:[--tglbg:#3368ff] checked:bg-white"
538543
checked={isDisableDocId}

0 commit comments

Comments
 (0)