@trustless-work/blocks 1.1.5 → 1.1.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustless-work/blocks",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "author": "Trustless Work",
5
5
  "keywords": [
6
6
  "react",
@@ -36,7 +36,9 @@ export const LoadEscrowButton = ({ contractId }: LoadEscrowButtonProps) => {
36
36
 
37
37
  setSelectedEscrow(escrowData);
38
38
 
39
- toast.success("Escrow data fetched successfully");
39
+ toast.success(
40
+ "Escrow data fetched successfully. Now you can use the selectedEscrow state"
41
+ );
40
42
  } catch (error) {
41
43
  toast.error(handleError(error as ErrorResponse).message);
42
44
  } finally {
@@ -0,0 +1,48 @@
1
+ "use client";
2
+
3
+ import { Button } from "__UI_BASE__/button";
4
+ import { Input } from "__UI_BASE__/input";
5
+ import {
6
+ Form,
7
+ FormField,
8
+ FormItem,
9
+ FormLabel,
10
+ FormControl,
11
+ FormMessage,
12
+ } from "__UI_BASE__/form";
13
+ import { useLoadEscrow } from "./useLoadEscrow";
14
+
15
+ export function LoadEscrowForm() {
16
+ const { form, isSubmitting, onSubmit } = useLoadEscrow();
17
+
18
+ return (
19
+ <Form {...form}>
20
+ <form
21
+ onSubmit={form.handleSubmit(onSubmit)}
22
+ className="flex flex-col space-y-6 w-full"
23
+ >
24
+ <FormField
25
+ control={form.control}
26
+ name="contractIds.0.value"
27
+ render={({ field }) => (
28
+ <FormItem>
29
+ <FormLabel>Contract / Escrow ID</FormLabel>
30
+ <FormControl>
31
+ <Input placeholder="CAZ6UQX7..." {...field} />
32
+ </FormControl>
33
+ <FormMessage />
34
+ </FormItem>
35
+ )}
36
+ />
37
+
38
+ <Button
39
+ type="submit"
40
+ className="w-full cursor-pointer"
41
+ disabled={isSubmitting}
42
+ >
43
+ {isSubmitting ? "Loading..." : "Load Escrow"}
44
+ </Button>
45
+ </form>
46
+ </Form>
47
+ );
48
+ }
@@ -1,47 +0,0 @@
1
- "use client";
2
-
3
- import { Button } from "__UI_BASE__/button";
4
- import { Input } from "__UI_BASE__/input";
5
- import {
6
- Form,
7
- FormField,
8
- FormItem,
9
- FormLabel,
10
- FormControl,
11
- FormMessage,
12
- } from "__UI_BASE__/form";
13
- import { useLoadEscrow } from "./useLoadEscrow";
14
-
15
- export function LoadEscrowForm() {
16
- const { form, isSubmitting, onSubmit } = useLoadEscrow();
17
-
18
- return (
19
- <div className="space-y-6">
20
- <Form {...form}>
21
- <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
22
- <FormField
23
- control={form.control}
24
- name="contractIds.0.value"
25
- render={({ field }) => (
26
- <FormItem>
27
- <FormLabel>Contract / Escrow ID</FormLabel>
28
- <FormControl>
29
- <Input placeholder="CAZ6UQX7..." {...field} />
30
- </FormControl>
31
- <FormMessage />
32
- </FormItem>
33
- )}
34
- />
35
-
36
- <Button
37
- type="submit"
38
- className="w-full cursor-pointer"
39
- disabled={isSubmitting}
40
- >
41
- {isSubmitting ? "Loading..." : "Load Escrow"}
42
- </Button>
43
- </form>
44
- </Form>
45
- </div>
46
- );
47
- }