From 420396787c33aa2ac4e946e8bfd90a86c42ad5fa Mon Sep 17 00:00:00 2001 From: aelassas Date: Sun, 7 Apr 2024 05:21:02 +0000 Subject: [PATCH] General cleanup --- backend/src/components/Accordion.tsx | 8 +++--- backend/src/components/AvailabilityFilter.tsx | 2 +- backend/src/components/Avatar.tsx | 28 +++++++++---------- backend/src/components/BookingFilter.tsx | 6 ++-- backend/src/components/Header.tsx | 4 +-- backend/src/components/ImageViewer.tsx | 10 +++---- backend/src/components/MultipleSelect.tsx | 4 +-- backend/src/components/Pager.tsx | 10 +++---- backend/src/components/PropertyInfo.tsx | 2 +- backend/src/components/PropertyTypeList.tsx | 4 +-- backend/src/components/RentalTermList.tsx | 4 +-- backend/src/components/Search.tsx | 2 +- backend/src/components/UserTypeFilter.tsx | 2 +- frontend/src/components/Accordion.tsx | 8 +++--- frontend/src/components/AgencySelectList.tsx | 10 +++---- frontend/src/components/BookingFilter.tsx | 6 ++-- frontend/src/components/Header.tsx | 6 ++-- frontend/src/components/ImageViewer.tsx | 22 +++++++-------- frontend/src/components/MultipleSelect.tsx | 4 +-- frontend/src/components/Pager.tsx | 10 +++---- mobile/components/Header.tsx | 10 +++---- mobile/components/Master.tsx | 2 +- mobile/components/NotificationList.tsx | 6 ++-- mobile/components/Property.tsx | 12 ++++---- 24 files changed, 91 insertions(+), 91 deletions(-) diff --git a/backend/src/components/Accordion.tsx b/backend/src/components/Accordion.tsx index bc83315e..e2b9c050 100644 --- a/backend/src/components/Accordion.tsx +++ b/backend/src/components/Accordion.tsx @@ -3,10 +3,10 @@ import React, { ReactNode, useEffect, useRef } from 'react' import '../assets/css/accordion.css' interface AccordionProps { - title?: string, - className?: string, - collapse?: boolean, - offsetHeight?: number, + title?: string + className?: string + collapse?: boolean + offsetHeight?: number children: ReactNode } diff --git a/backend/src/components/AvailabilityFilter.tsx b/backend/src/components/AvailabilityFilter.tsx index 770248cc..5e3d1970 100644 --- a/backend/src/components/AvailabilityFilter.tsx +++ b/backend/src/components/AvailabilityFilter.tsx @@ -9,7 +9,7 @@ import * as helper from '../common/helper' import '../assets/css/availability-filter.css' interface AvailabilityFilterProps { - className?: string, + className?: string onChange?: (values: movininTypes.Availablity[]) => void } diff --git a/backend/src/components/Avatar.tsx b/backend/src/components/Avatar.tsx index 39c56912..e1654ed1 100644 --- a/backend/src/components/Avatar.tsx +++ b/backend/src/components/Avatar.tsx @@ -27,20 +27,20 @@ import * as UserService from '../services/UserService' import * as PropertyService from '../services/PropertyService' interface AvatarProps { - width?: number, - height?: number, - mode?: 'create' | 'update', - type?: string, - record?: movininTypes.User | movininTypes.Property | null, - size: 'small' | 'medium' | 'large', - readonly?: boolean, - color?: 'disabled' | 'action' | 'inherit' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning', - className?: string, - verified?: boolean, - hideDelete?: boolean, - onValidate?: (valid: boolean) => void, - onBeforeUpload?: () => void, - onChange?: (param: string) => void, + width?: number + height?: number + mode?: 'create' | 'update' + type?: string + record?: movininTypes.User | movininTypes.Property | null + size: 'small' | 'medium' | 'large' + readonly?: boolean + color?: 'disabled' | 'action' | 'inherit' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning' + className?: string + verified?: boolean + hideDelete?: boolean + onValidate?: (valid: boolean) => void + onBeforeUpload?: () => void + onChange?: (param: string) => void } const Avatar = ({ diff --git a/backend/src/components/BookingFilter.tsx b/backend/src/components/BookingFilter.tsx index eb72c96c..f93bce6a 100644 --- a/backend/src/components/BookingFilter.tsx +++ b/backend/src/components/BookingFilter.tsx @@ -20,9 +20,9 @@ import Accordion from '../components/Accordion' import '../assets/css/booking-filter.css' interface BookingFilterProps { - collapse?: boolean, - className?: string, - language?: string, + collapse?: boolean + className?: string + language?: string onSubmit?: (filter: movininTypes.Filter | null) => void } diff --git a/backend/src/components/Header.tsx b/backend/src/components/Header.tsx index 58fd91fb..a741c91c 100644 --- a/backend/src/components/Header.tsx +++ b/backend/src/components/Header.tsx @@ -46,8 +46,8 @@ import { useGlobalContext, GlobalContextType } from '../context/GlobalContext' import '../assets/css/header.css' interface HeaderProps { - user?: movininTypes.User, - hidden?: boolean, + user?: movininTypes.User + hidden?: boolean } const ListItemLink = (props: any) => diff --git a/backend/src/components/ImageViewer.tsx b/backend/src/components/ImageViewer.tsx index 0a1a6fe2..a76dd5a3 100644 --- a/backend/src/components/ImageViewer.tsx +++ b/backend/src/components/ImageViewer.tsx @@ -3,11 +3,11 @@ import React, { KeyboardEvent, useCallback, useEffect, useMemo, useRef, useState import '../assets/css/image-viewer.css' interface ImageViewerProps { - title?: string, - currentIndex?: number, - src: string[], - closeOnClickOutside?: boolean, - disableScroll?: boolean, + title?: string + currentIndex?: number + src: string[] + closeOnClickOutside?: boolean + disableScroll?: boolean backgroundStyle?: React.CSSProperties closeComponent?: React.ReactNode leftArrowComponent?: React.ReactNode diff --git a/backend/src/components/MultipleSelect.tsx b/backend/src/components/MultipleSelect.tsx index f99131c8..9fe04578 100644 --- a/backend/src/components/MultipleSelect.tsx +++ b/backend/src/components/MultipleSelect.tsx @@ -34,9 +34,9 @@ interface MultipleSelectProps { readOnly?: boolean callbackFromMultipleSelect?: (newValue: any, _key: string, _reference: any) => void onFocus?: React.FocusEventHandler - onInputChange?: ((event: React.SyntheticEvent, value?: string, reason?: AutocompleteInputChangeReason) => void) | undefined + onInputChange?: (event: React.SyntheticEvent, value?: string, reason?: AutocompleteInputChangeReason) => void onClear?: () => void - onOpen?: ((event: React.SyntheticEvent) => void) | undefined + onOpen?: (event: React.SyntheticEvent) => void } const ListBox: React.ComponentType> = forwardRef((props, ref) => { diff --git a/backend/src/components/Pager.tsx b/backend/src/components/Pager.tsx index 1409fb92..07e2d275 100644 --- a/backend/src/components/Pager.tsx +++ b/backend/src/components/Pager.tsx @@ -6,11 +6,11 @@ import { strings as commonStrings } from '../lang/common' import '../assets/css/pager.css' interface PagerProps { - page: number, - pageSize: number, - totalRecords: number, - rowCount: number, - onNext: () => void, + page: number + pageSize: number + totalRecords: number + rowCount: number + onNext: () => void onPrevious: () => void } diff --git a/backend/src/components/PropertyInfo.tsx b/backend/src/components/PropertyInfo.tsx index 78cdd2fe..2be66f05 100644 --- a/backend/src/components/PropertyInfo.tsx +++ b/backend/src/components/PropertyInfo.tsx @@ -32,7 +32,7 @@ import '../assets/css/property-info.css' interface PropertyInfoProps { property: movininTypes.Property - user?: movininTypes.User, + user?: movininTypes.User booking?: movininTypes.Booking description?: boolean className?: string diff --git a/backend/src/components/PropertyTypeList.tsx b/backend/src/components/PropertyTypeList.tsx index 02c41545..080946dc 100644 --- a/backend/src/components/PropertyTypeList.tsx +++ b/backend/src/components/PropertyTypeList.tsx @@ -9,8 +9,8 @@ import * as movininTypes from 'movinin-types' import { strings } from '../lang/properties' interface PropertyTypeListProps { - value?: string, - required?: boolean, + value?: string + required?: boolean label?: string variant?: 'filled' | 'standard' | 'outlined' onChange?: (value: string) => void diff --git a/backend/src/components/RentalTermList.tsx b/backend/src/components/RentalTermList.tsx index 40a48a9c..9848b31c 100644 --- a/backend/src/components/RentalTermList.tsx +++ b/backend/src/components/RentalTermList.tsx @@ -9,8 +9,8 @@ import * as movininTypes from 'movinin-types' import { strings } from '../lang/rental-term' interface RentalTermListProps { - value?: string, - required?: boolean, + value?: string + required?: boolean label?: string variant?: 'filled' | 'standard' | 'outlined' onChange?: (value: string) => void diff --git a/backend/src/components/Search.tsx b/backend/src/components/Search.tsx index 2c86b749..d4236a9b 100644 --- a/backend/src/components/Search.tsx +++ b/backend/src/components/Search.tsx @@ -6,7 +6,7 @@ import { strings as commonStrings } from '../lang/common' import '../assets/css/search.css' interface SearchProps { - className?: string, + className?: string onSubmit?: (value: string) => void } diff --git a/backend/src/components/UserTypeFilter.tsx b/backend/src/components/UserTypeFilter.tsx index f4766485..e968949c 100644 --- a/backend/src/components/UserTypeFilter.tsx +++ b/backend/src/components/UserTypeFilter.tsx @@ -7,7 +7,7 @@ import * as helper from '../common/helper' import '../assets/css/user-type-filter.css' interface UserTypeFilterProps { - className?: string, + className?: string onChange?: (types: movininTypes.UserType[]) => void } diff --git a/frontend/src/components/Accordion.tsx b/frontend/src/components/Accordion.tsx index bc83315e..e2b9c050 100644 --- a/frontend/src/components/Accordion.tsx +++ b/frontend/src/components/Accordion.tsx @@ -3,10 +3,10 @@ import React, { ReactNode, useEffect, useRef } from 'react' import '../assets/css/accordion.css' interface AccordionProps { - title?: string, - className?: string, - collapse?: boolean, - offsetHeight?: number, + title?: string + className?: string + collapse?: boolean + offsetHeight?: number children: ReactNode } diff --git a/frontend/src/components/AgencySelectList.tsx b/frontend/src/components/AgencySelectList.tsx index 826fef0d..a025a2a6 100644 --- a/frontend/src/components/AgencySelectList.tsx +++ b/frontend/src/components/AgencySelectList.tsx @@ -9,11 +9,11 @@ import MultipleSelect from './MultipleSelect' interface AgencySelectListProps { value?: movininTypes.Option | movininTypes.Option[] - multiple?: boolean, - label?: string, - required?: boolean, - readOnly?: boolean, - variant?: TextFieldVariants, + multiple?: boolean + label?: string + required?: boolean + readOnly?: boolean + variant?: TextFieldVariants onChange?: (values: movininTypes.Option[]) => void } diff --git a/frontend/src/components/BookingFilter.tsx b/frontend/src/components/BookingFilter.tsx index eb72c96c..f93bce6a 100644 --- a/frontend/src/components/BookingFilter.tsx +++ b/frontend/src/components/BookingFilter.tsx @@ -20,9 +20,9 @@ import Accordion from '../components/Accordion' import '../assets/css/booking-filter.css' interface BookingFilterProps { - collapse?: boolean, - className?: string, - language?: string, + collapse?: boolean + className?: string + language?: string onSubmit?: (filter: movininTypes.Filter | null) => void } diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index eb662fd4..266e0f6e 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -44,9 +44,9 @@ import { useGlobalContext, GlobalContextType } from '../context/GlobalContext' import '../assets/css/header.css' interface HeaderProps { - user?: movininTypes.User, - hidden?: boolean, - hideSignin?: boolean, + user?: movininTypes.User + hidden?: boolean + hideSignin?: boolean } const ListItemLink = (props: any) => diff --git a/frontend/src/components/ImageViewer.tsx b/frontend/src/components/ImageViewer.tsx index f07b6907..6e2849a4 100644 --- a/frontend/src/components/ImageViewer.tsx +++ b/frontend/src/components/ImageViewer.tsx @@ -3,17 +3,17 @@ import React, { KeyboardEvent, useCallback, useEffect, useMemo, useRef, useState import '../assets/css/image-viewer.css' interface ImageViewerProps { - title?: string, - currentIndex?: number, - src: string[], - closeOnClickOutside?: boolean, - disableScroll?: boolean, - backgroundStyle?: React.CSSProperties, - closeComponent?: React.ReactNode, - leftArrowComponent?: React.ReactNode, - rightArrowComponent?: React.ReactNode, - imageStyle?: React.CSSProperties, - onClose: () => void, + title?: string + currentIndex?: number + src: string[] + closeOnClickOutside?: boolean + disableScroll?: boolean + backgroundStyle?: React.CSSProperties + closeComponent?: React.ReactNode + leftArrowComponent?: React.ReactNode + rightArrowComponent?: React.ReactNode + imageStyle?: React.CSSProperties + onClose: () => void } const ImageViewer = ({ diff --git a/frontend/src/components/MultipleSelect.tsx b/frontend/src/components/MultipleSelect.tsx index 5beab403..1483d468 100644 --- a/frontend/src/components/MultipleSelect.tsx +++ b/frontend/src/components/MultipleSelect.tsx @@ -37,9 +37,9 @@ interface MultipleSelectProps { freeSolo?: boolean callbackFromMultipleSelect?: (newValue: any, _key: string, _reference: any) => void onFocus?: React.FocusEventHandler - onInputChange?: ((event: React.SyntheticEvent, value?: string, reason?: AutocompleteInputChangeReason) => void) | undefined + onInputChange?: (event: React.SyntheticEvent, value?: string, reason?: AutocompleteInputChangeReason) => void onClear?: () => void - onOpen?: ((event: React.SyntheticEvent) => void) | undefined + onOpen?: (event: React.SyntheticEvent) => void } const ListBox: React.ComponentType> = forwardRef((props, ref) => { diff --git a/frontend/src/components/Pager.tsx b/frontend/src/components/Pager.tsx index 840f6c79..54f41eed 100644 --- a/frontend/src/components/Pager.tsx +++ b/frontend/src/components/Pager.tsx @@ -9,11 +9,11 @@ import { strings as commonStrings } from '../lang/common' import '../assets/css/pager.css' interface PagerProps { - page: number, - pageSize: number, - totalRecords: number, - rowCount: number, - onNext: () => void, + page: number + pageSize: number + totalRecords: number + rowCount: number + onNext: () => void onPrevious: () => void } diff --git a/mobile/components/Header.tsx b/mobile/components/Header.tsx index 51d925ac..de16678d 100644 --- a/mobile/components/Header.tsx +++ b/mobile/components/Header.tsx @@ -12,11 +12,11 @@ import { useGlobalContext, GlobalContextType } from '../context/GlobalContext' import * as NotificationService from '../services/NotificationService' interface HeaderProps { - title?: string, - hideTitle?: boolean, - loggedIn?: boolean, - reload?: boolean, - _avatar?: string | null, + title?: string + hideTitle?: boolean + loggedIn?: boolean + reload?: boolean + _avatar?: string | null } const Header = ({ title, diff --git a/mobile/components/Master.tsx b/mobile/components/Master.tsx index 8d693095..6f68d0f0 100644 --- a/mobile/components/Master.tsx +++ b/mobile/components/Master.tsx @@ -13,7 +13,7 @@ import * as movininTypes from '../miscellaneous/movininTypes' interface MasterProps { navigation: NativeStackNavigationProp strict?: boolean - route?: RouteProp, + route?: RouteProp reload?: boolean style?: object title?: string diff --git a/mobile/components/NotificationList.tsx b/mobile/components/NotificationList.tsx index 04420e32..9a5cf513 100644 --- a/mobile/components/NotificationList.tsx +++ b/mobile/components/NotificationList.tsx @@ -16,9 +16,9 @@ import Checkbox from '../components/Checkbox' import { useGlobalContext, GlobalContextType } from '../context/GlobalContext' interface NotificationListProps { - navigation: NativeStackNavigationProp, - user?: movininTypes.User, - locale: Locale, + navigation: NativeStackNavigationProp + user?: movininTypes.User + locale: Locale } const NotificationList = ({ user, locale, navigation }: NotificationListProps) => { diff --git a/mobile/components/Property.tsx b/mobile/components/Property.tsx index ab3eab2d..f016582b 100644 --- a/mobile/components/Property.tsx +++ b/mobile/components/Property.tsx @@ -17,12 +17,12 @@ import * as env from '../config/env.config' import i18n from '../lang/i18n' interface PropertyProps { - navigation: NativeStackNavigationProp, - fr: boolean, - property: movininTypes.Property, - from: Date, - to: Date, - location: string, + navigation: NativeStackNavigationProp + fr: boolean + property: movininTypes.Property + from: Date + to: Date + location: string } const iconSize = 24