From 5cbb48fc0940b1c6e880db91d0fbd6a11e5eb62e Mon Sep 17 00:00:00 2001 From: Bartosz Dokurno Date: Sat, 21 Sep 2024 12:22:00 +0200 Subject: [PATCH] Run linter --- src/GifPickerReact.tsx | 15 +++- src/components/Button.tsx | 6 +- src/components/ErrorBoundary.tsx | 4 +- src/components/PickerMain.tsx | 9 +- src/components/body/Body.tsx | 42 +++++---- src/components/body/Category.tsx | 19 ++-- src/components/body/CategoryList.tsx | 23 +++-- src/components/body/FeaturedCategory.tsx | 8 +- src/components/body/GifList.tsx | 27 +++--- src/components/body/GifListPlaceholder.tsx | 22 +++-- src/components/body/ResultImage.tsx | 13 ++- src/components/body/SearchResult.tsx | 13 ++- src/components/body/TrendingCategory.tsx | 18 ++-- src/components/body/TrendingResult.tsx | 13 +-- src/components/header/ClearButton.tsx | 7 +- src/components/header/Header.tsx | 10 +-- src/components/header/Search.tsx | 8 +- src/components/header/Title.tsx | 13 +-- .../placeholders/CategoryPlaceholder.tsx | 6 +- src/components/placeholders/Placeholder.tsx | 7 +- .../placeholders/ResultPlaceholder.tsx | 9 +- src/context/PickerContext.ts | 4 +- src/hooks/usePickerContext.ts | 14 +-- src/hooks/useSettings.ts | 19 ++-- src/index.tsx | 6 +- src/managers/TenorManager.ts | 89 +++++++++---------- src/stories/GifPicker.stories.tsx | 55 ++++++------ src/types/exposedTypes.ts | 38 ++++---- 28 files changed, 294 insertions(+), 223 deletions(-) diff --git a/src/GifPickerReact.tsx b/src/GifPickerReact.tsx index fd85348..ebeabe8 100644 --- a/src/GifPickerReact.tsx +++ b/src/GifPickerReact.tsx @@ -29,10 +29,17 @@ export interface GifPickerReactProps { function GifPickerReact(props: GifPickerReactProps): JSX.Element { const settings = useSettings(props); const pickerContext = usePickerContext(settings.initialSearchTerm); - const tenorManager: TenorManager = useMemo(() => ( - new TenorManager(settings.tenorApiKey, settings.clientKey, - settings.country, settings.locale, settings.contentFilter) - ), [ ]); + const tenorManager: TenorManager = useMemo( + () => + new TenorManager( + settings.tenorApiKey, + settings.clientKey, + settings.country, + settings.locale, + settings.contentFilter, + ), + [], + ); return ( diff --git a/src/components/Button.tsx b/src/components/Button.tsx index f6ce154..e8ef148 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -1,6 +1,10 @@ import * as React from 'react'; -interface PropsProps extends React.DetailedHTMLProps, HTMLButtonElement> {} +interface PropsProps + extends React.DetailedHTMLProps< + React.ButtonHTMLAttributes, + HTMLButtonElement + > {} function Button(props: PropsProps): JSX.Element { return ( diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index 51de0f1..aa2c958 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -1,11 +1,11 @@ import * as React from 'react'; export interface ErrorBoundaryProps { - children: React.ReactNode; + children: React.ReactNode; } export interface ErrorBoundaryState { - hasError: boolean; + hasError: boolean; } export default class ErrorBoundary extends React.Component { diff --git a/src/components/PickerMain.tsx b/src/components/PickerMain.tsx index 77ffbbd..fed61b6 100644 --- a/src/components/PickerMain.tsx +++ b/src/components/PickerMain.tsx @@ -3,7 +3,7 @@ import SettingsContext from '../context/SettingsContext'; import { Theme } from '../types/exposedTypes'; export interface PickerMainProps { - children: React.ReactNode; + children: React.ReactNode; } function PickerMain({ children }: PickerMainProps): JSX.Element { @@ -11,11 +11,14 @@ function PickerMain({ children }: PickerMainProps): JSX.Element { const style: React.CSSProperties = { height: settings.height, - width: settings.width + width: settings.width, }; return ( -