@drawbridge/components 0.1.35 → 0.1.36
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.
|
@@ -112,8 +112,6 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
112
112
|
}) => {
|
|
113
113
|
var _a, _b, _c, _d;
|
|
114
114
|
const { document: standard, types, values = {} } = agreement || {};
|
|
115
|
-
const queryClient = (0, import_react_query.useQueryClient)();
|
|
116
|
-
const scope = (0, import_react.useContext)(import_form.FormScope);
|
|
117
115
|
const tabs = TABS.filter((tab) => (types || TABS).includes(tab));
|
|
118
116
|
const saved = values.type || (values.link ? "link" : "document");
|
|
119
117
|
const { control, formState, handleSubmit, setValue } = (0, import_form.useForm)({
|
|
@@ -144,16 +142,6 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
144
142
|
[signature]
|
|
145
143
|
);
|
|
146
144
|
const editing = (current == null ? void 0 : current.type) === "document";
|
|
147
|
-
(0, import_react.useEffect)(
|
|
148
|
-
() => {
|
|
149
|
-
if (scope !== "modal") return;
|
|
150
|
-
queryClient.setQueryData(["modal"], (modal) => (modal == null ? void 0 : modal.active) ? {
|
|
151
|
-
...modal,
|
|
152
|
-
wide: editing
|
|
153
|
-
} : modal);
|
|
154
|
-
},
|
|
155
|
-
[editing, queryClient, scope]
|
|
156
|
-
);
|
|
157
145
|
const claim = (0, import_react.useRef)();
|
|
158
146
|
claim.current = (days) => setValue("claimWindow", days, { shouldDirty: true });
|
|
159
147
|
const blocks = (0, import_react.useRef)(null);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
3
|
import { useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { request } from "@drawbridge/drawbridge-utils/fetch";
|
|
5
5
|
import { regex } from "@drawbridge/drawbridge-utils";
|
|
6
|
-
import {
|
|
6
|
+
import { useForm, Controller, useWatch } from "../shared/lib/form.mjs";
|
|
7
7
|
import yup, { resolver } from "../shared/lib/yup.mjs";
|
|
8
8
|
import Form from "../shared/form.mjs";
|
|
9
9
|
import Fieldset from "../shared/fieldset.mjs";
|
|
@@ -78,8 +78,6 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
78
78
|
}) => {
|
|
79
79
|
var _a, _b, _c, _d;
|
|
80
80
|
const { document: standard, types, values = {} } = agreement || {};
|
|
81
|
-
const queryClient = useQueryClient();
|
|
82
|
-
const scope = useContext(FormScope);
|
|
83
81
|
const tabs = TABS.filter((tab) => (types || TABS).includes(tab));
|
|
84
82
|
const saved = values.type || (values.link ? "link" : "document");
|
|
85
83
|
const { control, formState, handleSubmit, setValue } = useForm({
|
|
@@ -110,16 +108,6 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
110
108
|
[signature]
|
|
111
109
|
);
|
|
112
110
|
const editing = (current == null ? void 0 : current.type) === "document";
|
|
113
|
-
useEffect(
|
|
114
|
-
() => {
|
|
115
|
-
if (scope !== "modal") return;
|
|
116
|
-
queryClient.setQueryData(["modal"], (modal) => (modal == null ? void 0 : modal.active) ? {
|
|
117
|
-
...modal,
|
|
118
|
-
wide: editing
|
|
119
|
-
} : modal);
|
|
120
|
-
},
|
|
121
|
-
[editing, queryClient, scope]
|
|
122
|
-
);
|
|
123
111
|
const claim = useRef();
|
|
124
112
|
claim.current = (days) => setValue("claimWindow", days, { shouldDirty: true });
|
|
125
113
|
const blocks = useRef(null);
|