@ludo.ninja/components 2.3.55 → 2.3.56

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,2 +1,5 @@
1
- declare const SubmitNewProjectForm: () => import("react/jsx-runtime").JSX.Element;
1
+ declare const SubmitNewProjectForm: ({ blockchain, contractAddress }: {
2
+ blockchain?: string;
3
+ contractAddress?: string;
4
+ }) => import("react/jsx-runtime").JSX.Element;
2
5
  export default SubmitNewProjectForm;
@@ -105,9 +105,13 @@ const StyledCreateForm = styled_components_1.default.div `
105
105
  }
106
106
  }
107
107
  `;
108
- const SubmitNewProjectForm = () => {
108
+ const SubmitNewProjectForm = ({ blockchain, contractAddress }) => {
109
109
  const { control, register, handleSubmit, formState: { errors }, setError, setFocus, watch, } = (0, react_hook_form_1.useForm)({
110
110
  mode: 'all',
111
+ defaultValues: {
112
+ blockchain: blockchain || '',
113
+ contract: contractAddress || '',
114
+ },
111
115
  });
112
116
  (0, react_1.useEffect)(() => {
113
117
  setTimeout(() => {
@@ -127,10 +131,10 @@ const SubmitNewProjectForm = () => {
127
131
  name: 'contract',
128
132
  placeHolder: 'Project contract ID',
129
133
  };
130
- const blockchain = watch('blockchain');
134
+ const blockchainValue = watch('blockchain');
131
135
  const registerContract = register('contract', {
132
136
  required: { message: 'Project contract ID is required', value: true },
133
- validate: (value) => (0, validateTokenAddress_1.validateTokenAddress)(value, blockchain),
137
+ validate: (value) => (0, validateTokenAddress_1.validateTokenAddress)(value, blockchainValue),
134
138
  setValueAs: (value) => value.trim(),
135
139
  });
136
140
  const errorContract = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.3.55",
3
+ "version": "2.3.56",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",