diff --git a/static/js/publisher/components/AppPagination/AppPagination.tsx b/static/js/publisher/components/AppPagination/AppPagination.tsx index f8042949bc..a876535e49 100644 --- a/static/js/publisher/components/AppPagination/AppPagination.tsx +++ b/static/js/publisher/components/AppPagination/AppPagination.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, ReactNode } from "react"; +import { useState, useEffect } from "react"; import { Button, Icon, Input, Select } from "@canonical/react-components"; import type { @@ -19,7 +19,7 @@ function AppPagination({ keyword, items, setItemsToShow, -}: Props): ReactNode { +}: Props): React.JSX.Element { const paginationOptions = [ { label: "25/page", diff --git a/static/js/publisher/components/Filter/Filter.tsx b/static/js/publisher/components/Filter/Filter.tsx index 9a5861ab98..77a2b5c284 100644 --- a/static/js/publisher/components/Filter/Filter.tsx +++ b/static/js/publisher/components/Filter/Filter.tsx @@ -1,15 +1,13 @@ import { useSearchParams } from "react-router-dom"; import { RecoilState, useSetRecoilState } from "recoil"; import { Button, Icon } from "@canonical/react-components"; -import { ReactNode } from "react"; - type Props = { state: RecoilState; label: string; placeholder: string; }; -function Filter({ state, label, placeholder }: Props): ReactNode { +function Filter({ state, label, placeholder }: Props): React.JSX.Element { const [searchParams, setSearchParams] = useSearchParams(); const setFilter = useSetRecoilState(state); diff --git a/static/js/publisher/components/Logo/Logo.tsx b/static/js/publisher/components/Logo/Logo.tsx index 0b961e4f7e..a38889d2c7 100644 --- a/static/js/publisher/components/Logo/Logo.tsx +++ b/static/js/publisher/components/Logo/Logo.tsx @@ -1,4 +1,4 @@ -function Logo(): JSX.Element { +function Logo(): React.JSX.Element { return ( void; -}): JSX.Element { +}): React.JSX.Element { const location = useLocation(); const { data: publisherData } = usePublisher(); const { data: validationSetsData } = useValidationSets(); diff --git a/static/js/publisher/components/StoreSelector/StoreSelector.tsx b/static/js/publisher/components/StoreSelector/StoreSelector.tsx index e827af5363..abadcac0fd 100644 --- a/static/js/publisher/components/StoreSelector/StoreSelector.tsx +++ b/static/js/publisher/components/StoreSelector/StoreSelector.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, ReactNode } from "react"; +import { useState, useEffect } from "react"; import { useRecoilValue } from "recoil"; import { useParams, NavLink } from "react-router-dom"; @@ -10,7 +10,7 @@ type Props = { nativeNavLink?: boolean; }; -function StoreSelector({ nativeNavLink }: Props): ReactNode { +function StoreSelector({ nativeNavLink }: Props): React.JSX.Element { const { id } = useParams(); const brandStoresList = useRecoilValue(brandStoresState); const [showStoreSelector, setShowStoreSelector] = useState(false); diff --git a/static/js/publisher/components/Tour/Tour.tsx b/static/js/publisher/components/Tour/Tour.tsx index 843345b08a..46e482d39c 100644 --- a/static/js/publisher/components/Tour/Tour.tsx +++ b/static/js/publisher/components/Tour/Tour.tsx @@ -8,7 +8,7 @@ type Props = { steps: { target: string; title: string; - content: JSX.Element; + content: React.JSX.Element; disableBeacon?: boolean; }[]; }; diff --git a/static/js/publisher/pages/AccountDetails/AccountDetails.tsx b/static/js/publisher/pages/AccountDetails/AccountDetails.tsx index 8381365e66..a86870e48a 100644 --- a/static/js/publisher/pages/AccountDetails/AccountDetails.tsx +++ b/static/js/publisher/pages/AccountDetails/AccountDetails.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, SyntheticEvent, ReactNode } from "react"; +import { useState, useEffect, SyntheticEvent } from "react"; import { useRecoilValue } from "recoil"; import { Row, @@ -13,7 +13,7 @@ import Navigation from "../../components/Navigation"; import { publisherState } from "../../state/publisherState"; -function AccountDetails(): ReactNode { +function AccountDetails(): React.JSX.Element { const [subscriptionPreferencesChanged, setSubscriptionPreferencesChanged] = useState(false); const [subscribeToNewsletter, setSubscribeToNewsletter] = useState(false); diff --git a/static/js/publisher/pages/Build/Build.tsx b/static/js/publisher/pages/Build/Build.tsx index f2e0d2d514..aaf8ea8791 100644 --- a/static/js/publisher/pages/Build/Build.tsx +++ b/static/js/publisher/pages/Build/Build.tsx @@ -7,7 +7,7 @@ import SectionNav from "../../components/SectionNav"; import { setPageTitle } from "../../utils"; -function Build(): JSX.Element { +function Build(): React.JSX.Element { const { buildId, snapId } = useParams(); const { data, isFetched, isLoading, isFetching } = useQuery({ queryKey: ["build", snapId, buildId], diff --git a/static/js/publisher/pages/Builds/Builds.tsx b/static/js/publisher/pages/Builds/Builds.tsx index 09838cef85..135da47ea8 100644 --- a/static/js/publisher/pages/Builds/Builds.tsx +++ b/static/js/publisher/pages/Builds/Builds.tsx @@ -17,7 +17,7 @@ import { import { setPageTitle } from "../../utils"; -function Builds(): JSX.Element { +function Builds(): React.JSX.Element { const { snapId } = useParams(); const [githubData, setGithubData] = useRecoilState(githubDataState); const [loggedIn, setLoggedIn] = useRecoilState(buildLoggedInState); diff --git a/static/js/publisher/pages/Builds/DisconnectRepoActions.tsx b/static/js/publisher/pages/Builds/DisconnectRepoActions.tsx index 5f0a5b9aa6..3b9bb4a4cc 100644 --- a/static/js/publisher/pages/Builds/DisconnectRepoActions.tsx +++ b/static/js/publisher/pages/Builds/DisconnectRepoActions.tsx @@ -15,7 +15,7 @@ type Props = { function DisconnectRepoActions({ setDisconnectModalOpen, githubData, -}: Props): JSX.Element { +}: Props): React.JSX.Element { const { snapId } = useParams(); const setRepoConnected = useSetRecoilState(buildRepoConnectedState); const [disconnecting, setDisconnecting] = useState(false); diff --git a/static/js/publisher/pages/Builds/RepoConnected.tsx b/static/js/publisher/pages/Builds/RepoConnected.tsx index 721825dd58..cf849a3d2d 100644 --- a/static/js/publisher/pages/Builds/RepoConnected.tsx +++ b/static/js/publisher/pages/Builds/RepoConnected.tsx @@ -22,7 +22,7 @@ function RepoConnected({ }: { autoTriggerBuild: boolean; setAutoTriggerBuild: Dispatch>; -}): JSX.Element { +}): React.JSX.Element { const { snapId } = useParams(); const githubData = useRecoilValue(githubDataState); const [disconnectModalOpen, setDisconnectModalOpen] = @@ -54,7 +54,7 @@ function RepoConnected({ }); }; - const formatStatus = (status: string): JSX.Element => { + const formatStatus = (status: string): React.JSX.Element => { switch (status) { case "never_built": return <>Never built; diff --git a/static/js/publisher/pages/Builds/RepoNotConnected.tsx b/static/js/publisher/pages/Builds/RepoNotConnected.tsx index 8210b1c656..b7dbc83e5a 100644 --- a/static/js/publisher/pages/Builds/RepoNotConnected.tsx +++ b/static/js/publisher/pages/Builds/RepoNotConnected.tsx @@ -12,7 +12,7 @@ function RepoNotConnected({ setAutoTriggerBuild, }: { setAutoTriggerBuild: Dispatch>; -}): JSX.Element { +}): React.JSX.Element { const githubData = useRecoilValue(githubDataState); return ( diff --git a/static/js/publisher/pages/Listing/AdditionalInformation/AdditionalInformation.tsx b/static/js/publisher/pages/Listing/AdditionalInformation/AdditionalInformation.tsx index a8a708a276..cb27c3987a 100644 --- a/static/js/publisher/pages/Listing/AdditionalInformation/AdditionalInformation.tsx +++ b/static/js/publisher/pages/Listing/AdditionalInformation/AdditionalInformation.tsx @@ -25,7 +25,7 @@ function AdditionalInformation({ getValues, setValue, watch, -}: Props): JSX.Element { +}: Props): React.JSX.Element { return ( <>

Additional information

diff --git a/static/js/publisher/pages/Listing/ContactInformation/ContactFields.tsx b/static/js/publisher/pages/Listing/ContactInformation/ContactFields.tsx index 2d9a235cc5..2e1d7a5f76 100644 --- a/static/js/publisher/pages/Listing/ContactInformation/ContactFields.tsx +++ b/static/js/publisher/pages/Listing/ContactInformation/ContactFields.tsx @@ -21,7 +21,7 @@ function ContactFields({ labelName, fieldName, getValues, -}: Props): JSX.Element { +}: Props): React.JSX.Element { const { fields, append, remove } = useFieldArray({ control, name: fieldName, diff --git a/static/js/publisher/pages/Listing/ContactInformation/ContactInformation.tsx b/static/js/publisher/pages/Listing/ContactInformation/ContactInformation.tsx index 0da4c0bc5f..165b22def7 100644 --- a/static/js/publisher/pages/Listing/ContactInformation/ContactInformation.tsx +++ b/static/js/publisher/pages/Listing/ContactInformation/ContactInformation.tsx @@ -25,7 +25,7 @@ function ContactInformation({ control, getFieldState, getValues, -}: Props): JSX.Element { +}: Props): React.JSX.Element { return ( <>

Contact information

diff --git a/static/js/publisher/pages/Listing/Listing.tsx b/static/js/publisher/pages/Listing/Listing.tsx index b4785061d2..9d63922ab4 100644 --- a/static/js/publisher/pages/Listing/Listing.tsx +++ b/static/js/publisher/pages/Listing/Listing.tsx @@ -7,7 +7,7 @@ import ListingForm from "./ListingForm"; import { setPageTitle } from "../../utils"; -function Listing(): JSX.Element { +function Listing(): React.JSX.Element { const { snapId } = useParams(); const { data, isLoading, refetch, status } = useQuery({ queryKey: ["listing"], diff --git a/static/js/publisher/pages/Listing/ListingDetails/ListingDetails.tsx b/static/js/publisher/pages/Listing/ListingDetails/ListingDetails.tsx index 540e0cdd38..afd8487797 100644 --- a/static/js/publisher/pages/Listing/ListingDetails/ListingDetails.tsx +++ b/static/js/publisher/pages/Listing/ListingDetails/ListingDetails.tsx @@ -27,7 +27,7 @@ function ListingDetails({ getValues, setValue, control, -}: Props): JSX.Element { +}: Props): React.JSX.Element { const [showSupportedMarkdownSyntax, setShowSupportedMarkdownSyntax] = useState(false); diff --git a/static/js/publisher/pages/Listing/ListingForm/ListingForm.tsx b/static/js/publisher/pages/Listing/ListingForm/ListingForm.tsx index f9fab9a223..87dc6e6627 100644 --- a/static/js/publisher/pages/Listing/ListingForm/ListingForm.tsx +++ b/static/js/publisher/pages/Listing/ListingForm/ListingForm.tsx @@ -26,7 +26,7 @@ type Props = { refetch: () => void; }; -function ListingForm({ data, refetch }: Props): JSX.Element { +function ListingForm({ data, refetch }: Props): React.JSX.Element { const { snapId } = useParams(); const { diff --git a/static/js/publisher/pages/Members/InviteModal.tsx b/static/js/publisher/pages/Members/InviteModal.tsx index 919e599005..96fff142b7 100644 --- a/static/js/publisher/pages/Members/InviteModal.tsx +++ b/static/js/publisher/pages/Members/InviteModal.tsx @@ -1,4 +1,4 @@ -import { Dispatch, ReactNode, SetStateAction } from "react"; +import { Dispatch, SetStateAction } from "react"; import { Modal, Button } from "@canonical/react-components"; import type { InviteActionData } from "../../types/shared"; @@ -16,7 +16,7 @@ function InviteModal({ setInviteModalOpen, updateInvite, inviteModalIsSaving, -}: Props): ReactNode { +}: Props): React.JSX.Element | null { if (!inviteModalOpen || !inviteActionData) { return null; } diff --git a/static/js/publisher/pages/Members/InvitesTable.tsx b/static/js/publisher/pages/Members/InvitesTable.tsx index 11681771e9..21487f04af 100644 --- a/static/js/publisher/pages/Members/InvitesTable.tsx +++ b/static/js/publisher/pages/Members/InvitesTable.tsx @@ -1,10 +1,4 @@ -import { - useState, - useEffect, - ReactNode, - Dispatch, - SetStateAction, -} from "react"; +import { useState, useEffect, Dispatch, SetStateAction } from "react"; import { useParams } from "react-router-dom"; import { format } from "date-fns"; import { MainTable, Button } from "@canonical/react-components"; @@ -34,7 +28,7 @@ function InvitesTable({ setShowSuccessNotification, setNotificationText, setShowErrorNotification, -}: Props): ReactNode { +}: Props): React.JSX.Element { const [pendingInvites, setPendingInvites] = useState([]); const [expiredInvites, setExpiredInvites] = useState([]); const [revokedInvites, setRevokedInvites] = useState([]); diff --git a/static/js/publisher/pages/Members/Members.tsx b/static/js/publisher/pages/Members/Members.tsx index d0f432040a..7134402475 100644 --- a/static/js/publisher/pages/Members/Members.tsx +++ b/static/js/publisher/pages/Members/Members.tsx @@ -1,4 +1,4 @@ -import { ChangeEvent, ReactNode, useEffect, useState } from "react"; +import { ChangeEvent, useEffect, useState } from "react"; import { useParams, Navigate } from "react-router-dom"; import { useRecoilValue } from "recoil"; import { @@ -41,7 +41,7 @@ type Member = { current_user: boolean; }; -function Members(): ReactNode { +function Members(): React.JSX.Element { const brandStoresList = useRecoilValue(brandStoresState); const { id } = useParams(); const { diff --git a/static/js/publisher/pages/Members/MembersTable.tsx b/static/js/publisher/pages/Members/MembersTable.tsx index 1634c4629d..5c81f2bb40 100644 --- a/static/js/publisher/pages/Members/MembersTable.tsx +++ b/static/js/publisher/pages/Members/MembersTable.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, ReactNode } from "react"; +import { useState, useEffect } from "react"; import { MainTable, CheckboxInput } from "@canonical/react-components"; import ROLES from "./memberRoles"; @@ -14,7 +14,7 @@ function MembersTable({ filteredMembers, changedMembers, setChangedMembers, -}: Props): ReactNode { +}: Props): React.JSX.Element { const [members, setMembers] = useState(filteredMembers); const checkArrayEqual = (array1: Array, array2: Array) => { diff --git a/static/js/publisher/pages/Metrics/ActiveDeviceAnnotation.tsx b/static/js/publisher/pages/Metrics/ActiveDeviceAnnotation.tsx index f21169df87..f893a8a36e 100644 --- a/static/js/publisher/pages/Metrics/ActiveDeviceAnnotation.tsx +++ b/static/js/publisher/pages/Metrics/ActiveDeviceAnnotation.tsx @@ -13,7 +13,11 @@ interface IActiveDeviceAnnotation { }>; } -function ActiveDeviceAnnotation({ snapId }: { snapId?: string }): JSX.Element { +function ActiveDeviceAnnotation({ + snapId, +}: { + snapId?: string; +}): React.JSX.Element { const { data: annotation }: { data: IActiveDeviceAnnotation | undefined } = useMetricsAnnotation(snapId); diff --git a/static/js/publisher/pages/Metrics/ActiveDeviceMetrics.tsx b/static/js/publisher/pages/Metrics/ActiveDeviceMetrics.tsx index e799d7261d..adbca3b409 100644 --- a/static/js/publisher/pages/Metrics/ActiveDeviceMetrics.tsx +++ b/static/js/publisher/pages/Metrics/ActiveDeviceMetrics.tsx @@ -15,7 +15,7 @@ function ActiveDeviceMetrics({ }: { isEmpty: boolean; onDataLoad: (dataLength: number | undefined) => void; -}): JSX.Element { +}): React.JSX.Element { const { snapId } = useParams(); const [searchParams, setSearchParams] = useSearchParams(); const { data: latestActiveDevices } = useLatestActiveDevicesMetric(snapId); diff --git a/static/js/publisher/pages/Metrics/Metrics.tsx b/static/js/publisher/pages/Metrics/Metrics.tsx index df719b6303..4512f6100a 100644 --- a/static/js/publisher/pages/Metrics/Metrics.tsx +++ b/static/js/publisher/pages/Metrics/Metrics.tsx @@ -28,7 +28,7 @@ const EmptyData = () => { ); }; -function Metrics(): JSX.Element { +function Metrics(): React.JSX.Element { const { snapId } = useParams(); const [isActiveDeviceMetricEmpty, setIsActiveDeviceMetricEmpty] = useState< diff --git a/static/js/publisher/pages/Metrics/TerritoryMetrics.tsx b/static/js/publisher/pages/Metrics/TerritoryMetrics.tsx index 6e11f59b74..28106106fe 100644 --- a/static/js/publisher/pages/Metrics/TerritoryMetrics.tsx +++ b/static/js/publisher/pages/Metrics/TerritoryMetrics.tsx @@ -11,7 +11,7 @@ export const TerritoryMetrics = ({ }: { isEmpty: boolean; onDataLoad: (dataLength: number | undefined) => void; -}): JSX.Element => { +}): React.JSX.Element => { const { snapId } = useParams(); const { status, diff --git a/static/js/publisher/pages/Model/CreatePolicyForm.tsx b/static/js/publisher/pages/Model/CreatePolicyForm.tsx index bbdecfcb5d..5732d6bc1b 100644 --- a/static/js/publisher/pages/Model/CreatePolicyForm.tsx +++ b/static/js/publisher/pages/Model/CreatePolicyForm.tsx @@ -1,10 +1,4 @@ -import { - useState, - useEffect, - ReactNode, - Dispatch, - SetStateAction, -} from "react"; +import { useState, useEffect, Dispatch, SetStateAction } from "react"; import { useRecoilState, useRecoilValue } from "recoil"; import { useParams, Link, useNavigate, useLocation } from "react-router-dom"; import { useMutation, useQueryClient } from "react-query"; @@ -29,7 +23,7 @@ function CreatePolicyForm({ setShowNotification, setShowErrorNotification, refetchPolicies, -}: Props): ReactNode { +}: Props): React.JSX.Element { const { id, model_id } = useParams(); const brandId = useRecoilValue(brandIdState); const navigate = useNavigate(); diff --git a/static/js/publisher/pages/Model/ModelBreadcrumb.tsx b/static/js/publisher/pages/Model/ModelBreadcrumb.tsx index ac4e06e8d0..8be4d1b7c3 100644 --- a/static/js/publisher/pages/Model/ModelBreadcrumb.tsx +++ b/static/js/publisher/pages/Model/ModelBreadcrumb.tsx @@ -4,7 +4,7 @@ interface RouteParams { id?: string; model_id?: string; } -function ModelBreadcrumb(): JSX.Element { +function ModelBreadcrumb(): React.JSX.Element { const { id, model_id } = useParams() as RouteParams; return ( diff --git a/static/js/publisher/pages/Model/ModelNav.tsx b/static/js/publisher/pages/Model/ModelNav.tsx index b9ad67ac39..c941ebe035 100644 --- a/static/js/publisher/pages/Model/ModelNav.tsx +++ b/static/js/publisher/pages/Model/ModelNav.tsx @@ -1,7 +1,6 @@ -import { ReactNode } from "react"; import { Link, useParams } from "react-router-dom"; -function ModelNav({ sectionName }: { sectionName: string }): ReactNode { +function ModelNav({ sectionName }: { sectionName: string }): React.JSX.Element { const { id, model_id } = useParams(); return ( diff --git a/static/js/publisher/pages/Model/Policies.tsx b/static/js/publisher/pages/Model/Policies.tsx index d61e1af02d..29a7f484e1 100644 --- a/static/js/publisher/pages/Model/Policies.tsx +++ b/static/js/publisher/pages/Model/Policies.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, ReactNode } from "react"; +import { useState, useEffect } from "react"; import { Link, useParams, @@ -32,7 +32,7 @@ import { isClosedPanel, setPageTitle } from "../../utils"; import type { Policy, SigningKey } from "../../types/shared"; -function Policies(): ReactNode { +function Policies(): React.JSX.Element { const { id, model_id } = useParams(); const brandId = useRecoilValue(brandIdState); const location = useLocation(); diff --git a/static/js/publisher/pages/Model/PoliciesTable.tsx b/static/js/publisher/pages/Model/PoliciesTable.tsx index 27b2253049..ed3a9b3007 100644 --- a/static/js/publisher/pages/Model/PoliciesTable.tsx +++ b/static/js/publisher/pages/Model/PoliciesTable.tsx @@ -1,4 +1,4 @@ -import { ReactNode, SetStateAction, useState, Dispatch } from "react"; +import { SetStateAction, useState, Dispatch } from "react"; import { useRecoilState, useRecoilValue } from "recoil"; import { useParams } from "react-router-dom"; import { format } from "date-fns"; @@ -21,7 +21,7 @@ type Props = { function ModelsTable({ setShowDeletePolicyNotification, setShowDeletePolicyErrorNotification, -}: Props): ReactNode { +}: Props): React.JSX.Element { const { model_id } = useParams(); const brandId = useRecoilValue(brandIdState); const [policiesList, setPoliciesList] = useRecoilState( diff --git a/static/js/publisher/pages/Models/CreateModelForm.tsx b/static/js/publisher/pages/Models/CreateModelForm.tsx index 54b906ee15..62a1da0855 100644 --- a/static/js/publisher/pages/Models/CreateModelForm.tsx +++ b/static/js/publisher/pages/Models/CreateModelForm.tsx @@ -1,4 +1,4 @@ -import { Dispatch, ReactNode, SetStateAction, useState } from "react"; +import { Dispatch, SetStateAction, useState } from "react"; import { useNavigate, useParams, useLocation, Link } from "react-router-dom"; import { useRecoilState, useRecoilValue, useSetRecoilState } from "recoil"; import { useMutation, useQueryClient } from "react-query"; @@ -28,7 +28,7 @@ type Props = { function CreateModelForm({ setShowNotification, setShowErrorNotification, -}: Props): ReactNode { +}: Props): React.JSX.Element { const navigate = useNavigate(); const location = useLocation(); const { id } = useParams(); diff --git a/static/js/publisher/pages/Models/Models.tsx b/static/js/publisher/pages/Models/Models.tsx index 38760d8849..eb4fc9c7bf 100644 --- a/static/js/publisher/pages/Models/Models.tsx +++ b/static/js/publisher/pages/Models/Models.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, ReactNode } from "react"; +import { useState, useEffect } from "react"; import { useSetRecoilState, useRecoilValue } from "recoil"; import { Link, @@ -28,7 +28,7 @@ import { isClosedPanel, setPageTitle, getPolicies } from "../../utils"; import type { Model as ModelType, Policy } from "../../types/shared"; -function Models(): ReactNode { +function Models(): React.JSX.Element { const { id } = useParams(); const brandId = useRecoilValue(brandIdState); diff --git a/static/js/publisher/pages/Models/ModelsTable.tsx b/static/js/publisher/pages/Models/ModelsTable.tsx index 998a069266..74ea4d77cd 100644 --- a/static/js/publisher/pages/Models/ModelsTable.tsx +++ b/static/js/publisher/pages/Models/ModelsTable.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useState } from "react"; +import { useState } from "react"; import { Link, useParams } from "react-router-dom"; import { useRecoilValue } from "recoil"; import { format } from "date-fns"; @@ -12,7 +12,7 @@ import { filteredModelsListState } from "../../state/modelsState"; import type { Model as ModelType } from "../../types/shared"; -function ModelsTable(): ReactNode { +function ModelsTable(): React.JSX.Element { const { id } = useParams(); const modelsList = useRecoilValue>(filteredModelsListState); const [itemsToShow, setItemsToShow] = useState>(modelsList); diff --git a/static/js/publisher/pages/Publicise/Publicise.tsx b/static/js/publisher/pages/Publicise/Publicise.tsx index 5b3037307a..d9fd49ca88 100644 --- a/static/js/publisher/pages/Publicise/Publicise.tsx +++ b/static/js/publisher/pages/Publicise/Publicise.tsx @@ -20,7 +20,7 @@ type Props = { view?: undefined | "badges" | "cards"; }; -function Publicise({ view }: Props): JSX.Element { +function Publicise({ view }: Props): React.JSX.Element { const { snapId } = useParams(); const { data, isLoading, isFetched } = useQuery({ diff --git a/static/js/publisher/pages/Publicise/PubliciseBadges.tsx b/static/js/publisher/pages/Publicise/PubliciseBadges.tsx index ddb40bb1c6..579b7a2c2a 100644 --- a/static/js/publisher/pages/Publicise/PubliciseBadges.tsx +++ b/static/js/publisher/pages/Publicise/PubliciseBadges.tsx @@ -11,7 +11,7 @@ type Props = { trending: boolean; }; -function PubliciseBadges({ trending }: Props): JSX.Element { +function PubliciseBadges({ trending }: Props): React.JSX.Element { const { snapId } = useParams(); const [showStableChannelBadge, setShowStableChannelBadge] = useState(true); diff --git a/static/js/publisher/pages/Publicise/PubliciseButtons.tsx b/static/js/publisher/pages/Publicise/PubliciseButtons.tsx index 1a0742a3c8..d0abb96a42 100644 --- a/static/js/publisher/pages/Publicise/PubliciseButtons.tsx +++ b/static/js/publisher/pages/Publicise/PubliciseButtons.tsx @@ -21,7 +21,7 @@ const LANGUAGES = { type LanguageKey = keyof typeof LANGUAGES; -function PubliciseButtons(): JSX.Element { +function PubliciseButtons(): React.JSX.Element { const { snapId } = useParams(); const [selectedLanguage, setSelectedLanguage] = useState("en"); diff --git a/static/js/publisher/pages/Publicise/PubliciseCards.tsx b/static/js/publisher/pages/Publicise/PubliciseCards.tsx index 2906d4d9e2..2c43ed191d 100644 --- a/static/js/publisher/pages/Publicise/PubliciseCards.tsx +++ b/static/js/publisher/pages/Publicise/PubliciseCards.tsx @@ -7,7 +7,7 @@ import { CheckboxInput, } from "@canonical/react-components"; -function PubliciseCards(): JSX.Element { +function PubliciseCards(): React.JSX.Element { const { snapId } = useParams(); const [buttonType, setButtonType] = useState<"black" | "white" | "hidden">( "black", diff --git a/static/js/publisher/pages/Publisher/Publisher.tsx b/static/js/publisher/pages/Publisher/Publisher.tsx index a6aa6332c6..5ff7f88aa6 100644 --- a/static/js/publisher/pages/Publisher/Publisher.tsx +++ b/static/js/publisher/pages/Publisher/Publisher.tsx @@ -1,6 +1,4 @@ -import { ReactNode } from "react"; - -function Publisher(): ReactNode { +function Publisher(): React.JSX.Element { return (

Publisher

diff --git a/static/js/publisher/pages/RegisterNameDispute/RegisterNameDispute.tsx b/static/js/publisher/pages/RegisterNameDispute/RegisterNameDispute.tsx index 7e70704f52..29e56f8439 100644 --- a/static/js/publisher/pages/RegisterNameDispute/RegisterNameDispute.tsx +++ b/static/js/publisher/pages/RegisterNameDispute/RegisterNameDispute.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useState } from "react"; +import { useState } from "react"; import { useSearchParams } from "react-router-dom"; import RegisterNameDisputeForm from "./RegisterNameDisputeForm"; @@ -10,7 +10,7 @@ import { setPageTitle } from "../../utils"; import type { Store } from "../../types/shared"; -function RegisterNameDispute(): ReactNode { +function RegisterNameDispute(): React.JSX.Element { setPageTitle("Register name dispute"); const [searchParams] = useSearchParams(); diff --git a/static/js/publisher/pages/RegisterNameDispute/RegisterNameDisputeForm.tsx b/static/js/publisher/pages/RegisterNameDispute/RegisterNameDisputeForm.tsx index b619718e49..2fb3d43610 100644 --- a/static/js/publisher/pages/RegisterNameDispute/RegisterNameDisputeForm.tsx +++ b/static/js/publisher/pages/RegisterNameDispute/RegisterNameDisputeForm.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useState, Dispatch, SetStateAction } from "react"; +import { useState, Dispatch, SetStateAction } from "react"; import { Form, Input, @@ -18,7 +18,7 @@ function RegisterNameDisputeForm({ snapName, store, setClaimSubmitted, -}: Props): ReactNode { +}: Props): React.JSX.Element { const [claimComment, setClaimComment] = useState(); const [isSending, setIsSending] = useState(); diff --git a/static/js/publisher/pages/RegisterNameDispute/RegisterNameDisputeSuccess.tsx b/static/js/publisher/pages/RegisterNameDispute/RegisterNameDisputeSuccess.tsx index 9deb9bbb54..d7df5b44e1 100644 --- a/static/js/publisher/pages/RegisterNameDispute/RegisterNameDisputeSuccess.tsx +++ b/static/js/publisher/pages/RegisterNameDispute/RegisterNameDisputeSuccess.tsx @@ -1,11 +1,10 @@ -import { ReactNode } from "react"; import { Link } from "react-router-dom"; type Props = { snapName: string | null; }; -function RegisterNameDisputeSuccess({ snapName }: Props): ReactNode { +function RegisterNameDisputeSuccess({ snapName }: Props): React.JSX.Element { return ( <>

diff --git a/static/js/publisher/pages/RegisterSnap/RegisterSnap.tsx b/static/js/publisher/pages/RegisterSnap/RegisterSnap.tsx index ad126c2ac0..6c7c102a5a 100644 --- a/static/js/publisher/pages/RegisterSnap/RegisterSnap.tsx +++ b/static/js/publisher/pages/RegisterSnap/RegisterSnap.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useState } from "react"; +import { useState } from "react"; import { Link } from "react-router-dom"; import { Notification } from "@canonical/react-components"; @@ -11,7 +11,7 @@ import { useBrandStores } from "../../hooks"; import type { RegistrationResponse } from "./local-types"; -function RegisterSnap(): ReactNode { +function RegisterSnap(): React.JSX.Element { const [isSending, setIsSending] = useState(false); const [registrationResponse, setRegistrationResponse] = useState(); diff --git a/static/js/publisher/pages/RegisterSnap/RegisterSnapForm.tsx b/static/js/publisher/pages/RegisterSnap/RegisterSnapForm.tsx index 9fd0bc7508..7c223a44cd 100644 --- a/static/js/publisher/pages/RegisterSnap/RegisterSnapForm.tsx +++ b/static/js/publisher/pages/RegisterSnap/RegisterSnapForm.tsx @@ -1,10 +1,4 @@ -import { - ReactNode, - useState, - Dispatch, - SetStateAction, - FormEvent, -} from "react"; +import { useState, Dispatch, SetStateAction, FormEvent } from "react"; import { Link, useNavigate } from "react-router-dom"; import { Form, @@ -36,7 +30,7 @@ function RegisterSnapForm({ availableStores, selectedStore, setSelectedStore, -}: Props): ReactNode { +}: Props): React.JSX.Element { const [snapName, setSnapName] = useState(); const [privacy, setPrivacy] = useState("private"); diff --git a/static/js/publisher/pages/Releases/Release.tsx b/static/js/publisher/pages/Releases/Release.tsx index 9d7a61b3d8..13e9ae6202 100644 --- a/static/js/publisher/pages/Releases/Release.tsx +++ b/static/js/publisher/pages/Releases/Release.tsx @@ -30,7 +30,7 @@ function Release({ channelMap, tracks, options, -}: Props): JSX.Element { +}: Props): React.JSX.Element { const store = createStore( releases, { diff --git a/static/js/publisher/pages/Releases/Releases.tsx b/static/js/publisher/pages/Releases/Releases.tsx index acfcaa06f4..55843e224c 100644 --- a/static/js/publisher/pages/Releases/Releases.tsx +++ b/static/js/publisher/pages/Releases/Releases.tsx @@ -7,7 +7,7 @@ import Release from "./Release"; import { setPageTitle } from "../../utils"; -function Releases(): JSX.Element { +function Releases(): React.JSX.Element { const { snapId } = useParams(); const { isLoading, isFetched, data } = useQuery({ queryKey: ["releases"], diff --git a/static/js/publisher/pages/RequestReservedName/RequestReservedName.tsx b/static/js/publisher/pages/RequestReservedName/RequestReservedName.tsx index 8b8c61aced..56950444e4 100644 --- a/static/js/publisher/pages/RequestReservedName/RequestReservedName.tsx +++ b/static/js/publisher/pages/RequestReservedName/RequestReservedName.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useState } from "react"; +import { useState } from "react"; import { Link } from "react-router-dom"; import { useRecoilValue } from "recoil"; import { @@ -14,7 +14,7 @@ import { import { brandStoresState } from "../../state/brandStoreState"; -function RequestReservedName(): ReactNode { +function RequestReservedName(): React.JSX.Element { const [claimComment, setClaimComment] = useState(); const [isSubmitting, setIsSubmitting] = useState(); const [showSuccessNotification, setShowSuccessNotification] = diff --git a/static/js/publisher/pages/Reviewer/Reviewer.tsx b/static/js/publisher/pages/Reviewer/Reviewer.tsx index ea545fa6c1..82b2cda58a 100644 --- a/static/js/publisher/pages/Reviewer/Reviewer.tsx +++ b/static/js/publisher/pages/Reviewer/Reviewer.tsx @@ -1,9 +1,8 @@ -import { ReactNode } from "react"; import { useParams } from "react-router-dom"; import type { RouteParams } from "../../types/shared"; -function Reviewer(): ReactNode { +function Reviewer(): React.JSX.Element { const { id } = useParams(); return ( diff --git a/static/js/publisher/pages/ReviewerAndPublisher/ReviewerAndPublisher.tsx b/static/js/publisher/pages/ReviewerAndPublisher/ReviewerAndPublisher.tsx index a80988ff20..931960fdfe 100644 --- a/static/js/publisher/pages/ReviewerAndPublisher/ReviewerAndPublisher.tsx +++ b/static/js/publisher/pages/ReviewerAndPublisher/ReviewerAndPublisher.tsx @@ -1,9 +1,8 @@ -import { ReactNode } from "react"; import { useParams } from "react-router-dom"; import type { RouteParams } from "../../types/shared"; -function ReviewerAndPublisher(): ReactNode { +function ReviewerAndPublisher(): React.JSX.Element { const { id } = useParams(); return ( diff --git a/static/js/publisher/pages/SigningKeys/CreateSigningKeyForm.tsx b/static/js/publisher/pages/SigningKeys/CreateSigningKeyForm.tsx index d79d7251e5..be1b126f88 100644 --- a/static/js/publisher/pages/SigningKeys/CreateSigningKeyForm.tsx +++ b/static/js/publisher/pages/SigningKeys/CreateSigningKeyForm.tsx @@ -1,4 +1,4 @@ -import { Dispatch, ReactNode, useState, SetStateAction } from "react"; +import { Dispatch, useState, SetStateAction } from "react"; import { useNavigate, useParams, useLocation, Link } from "react-router-dom"; import { useRecoilState, useRecoilValue, useSetRecoilState } from "recoil"; import { useMutation, useQueryClient } from "react-query"; @@ -25,7 +25,7 @@ function CreateSigningKeyForm({ setShowNotification, setErrorMessage, refetch, -}: Props): ReactNode { +}: Props): React.JSX.Element { const navigate = useNavigate(); const location = useLocation(); const { id } = useParams(); diff --git a/static/js/publisher/pages/SigningKeys/DeactivateSigningKeyModal.tsx b/static/js/publisher/pages/SigningKeys/DeactivateSigningKeyModal.tsx index e289758237..fced47860c 100644 --- a/static/js/publisher/pages/SigningKeys/DeactivateSigningKeyModal.tsx +++ b/static/js/publisher/pages/SigningKeys/DeactivateSigningKeyModal.tsx @@ -2,7 +2,7 @@ import { Link, useParams } from "react-router-dom"; import { Modal, Button, Icon } from "@canonical/react-components"; import type { SigningKey } from "../../types/shared"; -import { Dispatch, ReactNode, SetStateAction } from "react"; +import { Dispatch, SetStateAction } from "react"; type Props = { setModalOpen: Dispatch>; @@ -16,7 +16,7 @@ function DeactivateSigningKeyModal({ handleDisable, isDeleting, signingKey, -}: Props): ReactNode { +}: Props): React.JSX.Element { const { id } = useParams(); return signingKey.models && signingKey.models.length > 0 ? ( diff --git a/static/js/publisher/pages/SigningKeys/SigningKeys.tsx b/static/js/publisher/pages/SigningKeys/SigningKeys.tsx index 2e913c726e..15dfae6b95 100644 --- a/static/js/publisher/pages/SigningKeys/SigningKeys.tsx +++ b/static/js/publisher/pages/SigningKeys/SigningKeys.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, ReactNode } from "react"; +import { useState, useEffect } from "react"; import { useSetRecoilState, useRecoilValue } from "recoil"; import { Link, @@ -33,7 +33,7 @@ import { import type { SigningKey, Policy, Model } from "../../types/shared"; -function SigningKeys(): ReactNode { +function SigningKeys(): React.JSX.Element { const { id } = useParams(); const brandId = useRecoilValue(brandIdState); const location = useLocation(); diff --git a/static/js/publisher/pages/SigningKeys/SigningKeysTable.tsx b/static/js/publisher/pages/SigningKeys/SigningKeysTable.tsx index e0f5048aca..af06c85f38 100644 --- a/static/js/publisher/pages/SigningKeys/SigningKeysTable.tsx +++ b/static/js/publisher/pages/SigningKeys/SigningKeysTable.tsx @@ -1,4 +1,4 @@ -import { ReactNode, SetStateAction, useState, Dispatch } from "react"; +import { SetStateAction, useState, Dispatch } from "react"; import { useParams } from "react-router-dom"; import { useRecoilValue, useSetRecoilState } from "recoil"; import { format } from "date-fns"; @@ -26,7 +26,7 @@ type Props = { function SigningKeysTable({ setShowDisableSuccessNotification, enableTableActions, -}: Props): ReactNode { +}: Props): React.JSX.Element { useParams(); const brandId = useRecoilValue(brandIdState); const signingKeysList = useRecoilValue>( diff --git a/static/js/publisher/pages/Snaps/PublishedSnapsTable.tsx b/static/js/publisher/pages/Snaps/PublishedSnapsTable.tsx index 0f057f8750..316d50f874 100644 --- a/static/js/publisher/pages/Snaps/PublishedSnapsTable.tsx +++ b/static/js/publisher/pages/Snaps/PublishedSnapsTable.tsx @@ -2,13 +2,11 @@ import { format, parseISO } from "date-fns"; import type { Snap } from "../../types/shared"; import { MainTable } from "@canonical/react-components"; -import { ReactNode } from "react"; - type Props = { snapsInStore: Array; }; -function PublishedSnapsTable({ snapsInStore }: Props): ReactNode { +function PublishedSnapsTable({ snapsInStore }: Props): React.JSX.Element { return ( <> {snapsInStore.length > 0 ? ( diff --git a/static/js/publisher/pages/Snaps/SnapsFilter.tsx b/static/js/publisher/pages/Snaps/SnapsFilter.tsx index 8c498c9628..f610d88e3a 100644 --- a/static/js/publisher/pages/Snaps/SnapsFilter.tsx +++ b/static/js/publisher/pages/Snaps/SnapsFilter.tsx @@ -1,4 +1,4 @@ -import { KeyboardEvent, ReactNode } from "react"; +import { KeyboardEvent } from "react"; import type { SnapsList } from "../../types/shared"; @@ -26,7 +26,7 @@ function SnapsFilter({ getStoreName, snaps, id, -}: Props): ReactNode { +}: Props): React.JSX.Element { return (