diff --git a/packages/@uppy/provider-views/src/Item/components/GridLi.tsx b/packages/@uppy/provider-views/src/Item/components/GridItem.tsx similarity index 90% rename from packages/@uppy/provider-views/src/Item/components/GridLi.tsx rename to packages/@uppy/provider-views/src/Item/components/GridItem.tsx index 5fc1a6514f..766e4d5508 100644 --- a/packages/@uppy/provider-views/src/Item/components/GridLi.tsx +++ b/packages/@uppy/provider-views/src/Item/components/GridItem.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames' import type { RestrictionError } from '@uppy/core/lib/Restricter' import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -type GridListItemProps = { +type GridItemProps = { className: string isDisabled: boolean restrictionError?: RestrictionError | null @@ -18,8 +18,8 @@ type GridListItemProps = { children?: ComponentChildren } -function GridListItem( - props: GridListItemProps, +function GridItem( + props: GridItemProps, ): h.JSX.Element { const { className, @@ -73,4 +73,4 @@ function GridListItem( ) } -export default GridListItem +export default GridItem diff --git a/packages/@uppy/provider-views/src/Item/components/ItemIcon.tsx b/packages/@uppy/provider-views/src/Item/components/ItemIcon.tsx index 0058871904..f6461b8059 100644 --- a/packages/@uppy/provider-views/src/Item/components/ItemIcon.tsx +++ b/packages/@uppy/provider-views/src/Item/components/ItemIcon.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/require-default-props */ import { h } from 'preact' function FileIcon() { @@ -44,11 +43,15 @@ function VideoIcon() { ) } -export default function ItemIcon(props: { +type ItemIconProps = { itemIconString: string alt?: string -}): h.JSX.Element | null { - const { itemIconString } = props +} + +export default function ItemIcon({ + itemIconString, + alt = undefined, +}: ItemIconProps): h.JSX.Element | null { if (itemIconString === null) return null switch (itemIconString) { @@ -59,7 +62,6 @@ export default function ItemIcon(props: { case 'video': return default: { - const { alt } = props return ( = { showTitles: boolean @@ -46,7 +46,7 @@ export default function Item( switch (viewType) { case 'grid': return ( - + // eslint-disable-next-line react/jsx-props-no-spreading {...props} className={className} @@ -64,7 +64,7 @@ export default function Item( ) case 'unsplash': return ( - + // eslint-disable-next-line react/jsx-props-no-spreading {...props} className={className} @@ -79,7 +79,7 @@ export default function Item( > {author!.name} - + ) default: throw new Error(`There is no such type ${viewType}`) diff --git a/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx b/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx index 5b07df30ce..099e46a82c 100644 --- a/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/require-default-props */ import { h } from 'preact' import { useCallback } from 'preact/hooks' import type { Body, Meta } from '@uppy/utils/lib/UppyFile' @@ -105,18 +104,14 @@ const defaultRenderForm = ({ onAuth: AuthViewProps['handleAuth'] }) => -export default function AuthView( - props: AuthViewProps, -) { - const { - loading, - pluginName, - pluginIcon, - i18n, - handleAuth, - renderForm = defaultRenderForm, - } = props - +export default function AuthView({ + loading, + pluginName, + pluginIcon, + i18n, + handleAuth, + renderForm = defaultRenderForm, +}: AuthViewProps) { return (
{pluginIcon()}