diff --git a/package.json b/package.json index 61237633c0..05066b363a 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "react-dnd": "16.0.1", "react-dnd-html5-backend": "16.0.1", "react-dom": "18.2.0", - "react-hook-form": "7.43.2", + "react-hook-form": "7.53.0", "react-query": "3.39.3", "react-redux": "8.1.3", "react-router-dom": "6.21.1", diff --git a/static/js/publisher/listing/components/AdditionalInformation/AdditionalInformation.tsx b/static/js/publisher/listing/components/AdditionalInformation/AdditionalInformation.tsx new file mode 100644 index 0000000000..40a3ae3f01 --- /dev/null +++ b/static/js/publisher/listing/components/AdditionalInformation/AdditionalInformation.tsx @@ -0,0 +1,106 @@ +import { + UseFormRegister, + UseFormGetValues, + UseFormSetValue, + UseFormWatch, + FieldValues, +} from "react-hook-form"; +import { Row, Col } from "@canonical/react-components"; + +import LicenseInputs from "./LicenseInputs"; + +import type { Data } from "../../types"; + +type Props = { + data: Data; + register: UseFormRegister; + getValues: UseFormGetValues; + setValue: UseFormSetValue; + watch: UseFormWatch; +}; + +function AdditionalInformation({ + data, + register, + getValues, + setValue, + watch, +}: Props): JSX.Element { + return ( + <> +

Additional information

+ + + + + + + + +

+ +

+
+

+ + + Displays where your snap is being used by country + +

+

+ + + Displays where your snap is being used by distro + +

+
+ +
+ + ); +} + +export default AdditionalInformation; diff --git a/static/js/publisher/listing/components/LicenseInputs/LicenseInputs.tsx b/static/js/publisher/listing/components/AdditionalInformation/LicenseInputs.tsx similarity index 92% rename from static/js/publisher/listing/components/LicenseInputs/LicenseInputs.tsx rename to static/js/publisher/listing/components/AdditionalInformation/LicenseInputs.tsx index 0b543c0169..05dd78c853 100644 --- a/static/js/publisher/listing/components/LicenseInputs/LicenseInputs.tsx +++ b/static/js/publisher/listing/components/AdditionalInformation/LicenseInputs.tsx @@ -1,4 +1,10 @@ import { useState, useEffect } from "react"; +import { + UseFormRegister, + UseFormSetValue, + UseFormWatch, + FieldValues, +} from "react-hook-form"; import { nanoid } from "nanoid"; import { Row, Col } from "@canonical/react-components"; @@ -10,9 +16,9 @@ type Props = { license_type: string; licenses: Array<{ key: string; name: string }>; }; - register: Function; - setValue: Function; - watch: Function; + register: UseFormRegister; + setValue: UseFormSetValue; + watch: UseFormWatch; }; function LicenseInputs({ listingData, register, setValue, watch }: Props) { @@ -98,7 +104,7 @@ function LicenseInputs({ listingData, register, setValue, watch }: Props) { {licenseType === "custom" && ( <> -