feat: disbale validation feature, documentId,webhook,API token for free users and add upgrade button to subscribe

This commit is contained in:
RaktimaNXG
2024-03-29 17:06:09 +05:30
parent 46159b7214
commit 1932dda6d6
10 changed files with 232 additions and 51 deletions
+30
View File
@@ -3,6 +3,7 @@ import moment from "moment";
import { themeColor } from "./const";
import React from "react";
import { rgb } from "pdf-lib";
import Parse from "parse";
export const isMobile = window.innerWidth < 767;
export const textInputWidget = "text input";
@@ -12,6 +13,35 @@ export const openInNewTab = (url) => {
window.open(url, "_blank", "noopener,noreferrer");
};
//function to get subcripition details from Extand user class
export async function checkIsSubscribed() {
// const tenantId = localStorage.getItem("TenantId");
// const users = new Parse.Query("partners_Tenant");
// users.equalTo("objectId", tenantId);
// const res = await users.first();
// const jsonRes = JSON.parse(JSON.stringify(res));
const extClass = localStorage.getItem("Extand_Class");
const jsonSender = JSON.parse(extClass);
const user = await Parse.Cloud.run("getUserDetails", {
email: jsonSender[0].Email
});
const freeplan = user?.get("Plan") && user?.get("Plan").plan_code;
const billingDate =
user?.get("Next_billing_date") && user?.get("Next_billing_date");
if (freeplan === "freeplan") {
return false;
} else if (billingDate) {
if (billingDate > new Date()) {
return true;
} else {
return false;
}
} else {
return false;
}
}
export const color = [
"#93a3db",
"#e6c3db",