@stokr/components-library 3.0.45 → 3.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useState, useContext, useEffect, useCallback } from "react";
2
+ import { useState, useContext, useCallback, useEffect } from "react";
3
3
  import { AuthContext } from "../context/AuthContext.js";
4
4
  import fetchDataPublic from "../api/fetchDataPublic.js";
5
5
  import parse from "html-react-parser";
@@ -81,38 +81,6 @@ const useNewVentureForm = ({ project, user, salesChannel, customSuccessMessage }
81
81
  const { checkboxes, isLoading: isLoadingCheckboxes } = useCheckboxes("newVentureModal", {
82
82
  group: "newVentureModal"
83
83
  });
84
- useEffect(() => {
85
- let formValuesCopy = { ...formValues };
86
- if (checkboxes) {
87
- Object.values(checkboxes).forEach((checkbox) => {
88
- if (checkbox.label === "createPrivateInvestor" && !formValuesCopy.privateInvestorListDisabled) {
89
- formValuesCopy.privateInvestorListText = parse(checkbox.agreementText);
90
- } else if (checkbox.label === "subscribeToProject" && !formValuesCopy.mailingListDisabled) {
91
- formValuesCopy.mailingListText = parse(checkbox.agreementText);
92
- }
93
- });
94
- }
95
- if (user?._id) {
96
- formValuesCopy.email = user.email;
97
- formValuesCopy.name = user.username;
98
- const projectSubscription = getProjectSubscription(user, project);
99
- if (projectSubscription.isPrivateInvestor) {
100
- formValuesCopy.privateInvestorListText = "You are already registered on the whitelist.";
101
- formValuesCopy.privateInvestorList = true;
102
- formValuesCopy.privateInvestorListDisabled = true;
103
- } else if (projectSubscription.privateInvestorStatus && projectSubscription.privateInvestorStatus !== "Admitted") {
104
- formValuesCopy.privateInvestorListText = "Your profile is under review. An account manager will reach out to you to confirm your eligibility.";
105
- formValuesCopy.privateInvestorList = true;
106
- formValuesCopy.privateInvestorListDisabled = true;
107
- }
108
- if (projectSubscription.isSubscribed) {
109
- formValuesCopy.mailingList = true;
110
- formValuesCopy.mailingListText = "You already subscribed to the email notification list.";
111
- formValuesCopy.mailingListDisabled = true;
112
- }
113
- }
114
- setFormValues(formValuesCopy);
115
- }, [user, checkboxes, project, formValues]);
116
84
  const handleSubmit = useCallback(
117
85
  async (values) => {
118
86
  setFormValues((prev) => ({ ...prev, isSubmitting: true }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "3.0.45",
3
+ "version": "3.0.46",
4
4
  "description": "STOKR - Components Library",
5
5
  "author": "Bilal Hodzic <bilal@stokr.io>",
6
6
  "license": "MIT",