diff --git a/apps/dashboard/src/components/contract-components/contract-publish-form/external-links-fieldset.tsx b/apps/dashboard/src/components/contract-components/contract-publish-form/external-links-fieldset.tsx index 0ab9343d530..8d3df4685ba 100644 --- a/apps/dashboard/src/components/contract-components/contract-publish-form/external-links-fieldset.tsx +++ b/apps/dashboard/src/components/contract-components/contract-publish-form/external-links-fieldset.tsx @@ -1,7 +1,7 @@ +import { Button } from "@/components/ui/button"; import { PlusIcon } from "lucide-react"; import { useEffect } from "react"; import { useFieldArray, useFormContext } from "react-hook-form"; -import { Button, Heading, Text } from "tw-components"; import { ExternalLinksInput } from "./external-links-input"; export const ExternalLinksFieldset = () => { @@ -29,8 +29,10 @@ export const ExternalLinksFieldset = () => { return (
- Resources - Provide links to docs, usage guides etc. for the contract. +

Resources

+

+ Provide links to docs, usage guides etc. for the contract. +

{fields.map((item, index) => ( @@ -40,9 +42,8 @@ export const ExternalLinksFieldset = () => {
diff --git a/apps/dashboard/src/components/contract-components/contract-publish-form/external-links-input.tsx b/apps/dashboard/src/components/contract-components/contract-publish-form/external-links-input.tsx index a102b23ab79..1bed8c27734 100644 --- a/apps/dashboard/src/components/contract-components/contract-publish-form/external-links-input.tsx +++ b/apps/dashboard/src/components/contract-components/contract-publish-form/external-links-input.tsx @@ -1,13 +1,9 @@ -import { - Divider, - Flex, - FormControl, - IconButton, - Input, -} from "@chakra-ui/react"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Separator } from "@/components/ui/separator"; import { TrashIcon } from "lucide-react"; import { useFormContext } from "react-hook-form"; -import { FormErrorMessage, FormLabel } from "tw-components"; interface ExternalLinksInputProps { index: number; @@ -21,38 +17,35 @@ export const ExternalLinksInput: React.FC = ({ const form = useFormContext(); return ( - - - - Resource Name +
+
+
+ - - - Link + {form.getFieldState(`externalLinks.${index}.name`, form.formState) + .error?.message && ( +

+ { + form.getFieldState( + `externalLinks.${index}.name`, + form.formState, + ).error?.message + } +

+ )} +
+
+ = ({ }, })} /> - - { - form.getFieldState(`externalLinks.${index}.url`, form.formState) - .error?.message - } - - - } + {form.getFieldState(`externalLinks.${index}.url`, form.formState) + .error?.message && ( +

+ { + form.getFieldState(`externalLinks.${index}.url`, form.formState) + .error?.message + } +

+ )} +
+ +
+ +
); };