From d832185ee36f81538b85a67625f853246fe216b2 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 29 Oct 2024 11:55:07 +0100 Subject: [PATCH] lint fixes --- src/Components/AppShell/ContextWrapper.tsx | 3 +++ src/Components/AppShell/NavBar.tsx | 1 + src/Components/AppShell/SetAssetsApi.tsx | 1 + src/Components/AppShell/SideBar.tsx | 1 + src/Components/AppShell/SidebarSubmenu.tsx | 2 ++ src/Components/AppShell/Sitemap.tsx | 1 + src/Components/AppShell/hooks/useAssets.tsx | 1 + src/Components/Auth/LoginPage.tsx | 1 + src/Components/Auth/RequestPasswordPage.tsx | 1 + src/Components/Auth/SignupPage.tsx | 1 + src/Components/Auth/useAuth.tsx | 9 ++++++- src/Components/Gaming/Modal.tsx | 1 + src/Components/Gaming/Quests.tsx | 1 + src/Components/Gaming/hooks/useQuests.tsx | 1 + src/Components/Input/Autocomplete.tsx | 2 ++ src/Components/Input/ComboBoxInput.tsx | 2 ++ src/Components/Input/SelectBox.tsx | 1 + src/Components/Input/TextAreaInput.tsx | 2 ++ src/Components/Input/TextInput.tsx | 1 + src/Components/Map/ItemForm.tsx | 1 + src/Components/Map/Layer.tsx | 3 +++ src/Components/Map/Permissions.tsx | 1 + .../Subcomponents/Controls/FilterControl.tsx | 1 + .../Subcomponents/Controls/LocateControl.tsx | 2 +- .../Subcomponents/Controls/SearchControl.tsx | 3 +-- .../Map/Subcomponents/ItemFormPopup.tsx | 4 ++- .../ItemPopupComponents/HeaderView.tsx | 7 +---- .../PopupCheckboxInput.tsx | 2 -- .../PopupStartEndInput.tsx | 2 ++ .../ItemPopupComponents/TextView.tsx | 26 +++++++++++++++++-- .../Map/Subcomponents/ItemViewPopup.tsx | 3 ++- src/Components/Map/Tags.tsx | 2 ++ src/Components/Map/UtopiaMapInner.tsx | 3 +++ src/Components/Map/hooks/useClusterRef.tsx | 1 + src/Components/Map/hooks/useDebounce.tsx | 1 + src/Components/Map/hooks/useFilter.tsx | 14 +++++++++- src/Components/Map/hooks/useItems.tsx | 9 +++++++ src/Components/Map/hooks/useLayers.tsx | 2 ++ src/Components/Map/hooks/useLeafletRefs.tsx | 4 ++- src/Components/Map/hooks/usePermissions.tsx | 6 +++++ .../Map/hooks/useSelectPosition.tsx | 4 ++- src/Components/Map/hooks/useTags.tsx | 3 +++ src/Components/Map/setItemLocation.tsx | 1 + src/Components/Profile/ProfileForm.tsx | 4 +++ src/Components/Profile/ProfileView.tsx | 6 ++++- .../Profile/Subcomponents/ActionsButton.tsx | 2 +- .../Profile/Subcomponents/AvatarWidget.tsx | 1 + .../Profile/Subcomponents/ColorPicker.tsx | 1 + .../Profile/Subcomponents/ContactInfo.tsx | 1 + .../Profile/Subcomponents/FormHeader.tsx | 1 + .../Subcomponents/ProfileSubHeader.tsx | 5 ++-- .../Profile/Subcomponents/RelationCard.tsx | 1 + .../Profile/Subcomponents/SocialShareBar.tsx | 1 + .../Subcomponents/SocialShareButton.tsx | 1 + .../Profile/Subcomponents/TagsWidget.tsx | 6 +++++ .../Profile/Templates/OnepagerForm.tsx | 2 ++ .../Profile/Templates/OnepagerView.tsx | 1 + .../Profile/Templates/SimpleForm.tsx | 2 ++ src/Components/Profile/Templates/TabsForm.tsx | 4 +++ src/Components/Profile/Templates/TabsView.tsx | 6 +++-- src/Components/Profile/UserSettings.tsx | 14 +++------- src/Components/Profile/itemFunctions.ts | 3 ++- src/Components/Templates/AttestationForm.tsx | 5 ++-- src/Components/Templates/CircleLayout.tsx | 1 + src/Components/Templates/DialogModal.tsx | 1 + src/Components/Templates/EmojiPicker.tsx | 3 ++- src/Components/Templates/MapOverlayPage.tsx | 1 + src/Components/Templates/MarketView.tsx | 1 + .../Templates/OverlayItemsIndexPage.tsx | 10 +++---- src/Components/Templates/SelectUser.tsx | 2 +- src/Components/Templates/TagView.tsx | 2 +- src/Components/Typography/ErrorText.tsx | 1 + src/Utils/MarkerIconFactory.ts | 2 -- src/Utils/ReplaceURLs.ts | 2 ++ src/index.tsx | 1 + src/types.ts | 4 +++ 76 files changed, 186 insertions(+), 50 deletions(-) diff --git a/src/Components/AppShell/ContextWrapper.tsx b/src/Components/AppShell/ContextWrapper.tsx index c3fd20cd..01468225 100644 --- a/src/Components/AppShell/ContextWrapper.tsx +++ b/src/Components/AppShell/ContextWrapper.tsx @@ -17,12 +17,14 @@ import { BrowserRouter as Router, useLocation } from 'react-router-dom'; // Helper context to determine if the ContextWrapper is already present. const ContextCheckContext = createContext(false); +// eslint-disable-next-line react/prop-types export const ContextWrapper = ({ children }) => { const isWrapped = useContext(ContextCheckContext); // Check if we are already inside a Router let location; try { + // eslint-disable-next-line react-hooks/rules-of-hooks location = useLocation(); } catch (e) { location = null; @@ -63,6 +65,7 @@ export const ContextWrapper = ({ children }) => { return children; }; +// eslint-disable-next-line react/prop-types export const Wrappers = ({ children }) => { const queryClient = new QueryClient(); diff --git a/src/Components/AppShell/NavBar.tsx b/src/Components/AppShell/NavBar.tsx index 6b9b0e0d..e09be0ce 100644 --- a/src/Components/AppShell/NavBar.tsx +++ b/src/Components/AppShell/NavBar.tsx @@ -18,6 +18,7 @@ export default function NavBar({ appName, userType}: { appName: string, userType useEffect(() => { const profile = user && items.find(i => (i.user_created?.id === user.id) && i.layer?.itemType.name === userType); profile ? setUserProfile(profile) : setUserProfile({id: crypto.randomUUID(), name: user?.first_name, text: ""}); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [user, items]) useEffect(() => { diff --git a/src/Components/AppShell/SetAssetsApi.tsx b/src/Components/AppShell/SetAssetsApi.tsx index f0f17664..410d3063 100644 --- a/src/Components/AppShell/SetAssetsApi.tsx +++ b/src/Components/AppShell/SetAssetsApi.tsx @@ -7,6 +7,7 @@ export const SetAssetsApi = ({assetsApi}:{assetsApi: AssetsApi}) => { useEffect(() => { setAssetsApi(assetsApi) + // eslint-disable-next-line react-hooks/exhaustive-deps }, [assetsApi]) diff --git a/src/Components/AppShell/SideBar.tsx b/src/Components/AppShell/SideBar.tsx index 8a199c44..7b1754c5 100644 --- a/src/Components/AppShell/SideBar.tsx +++ b/src/Components/AppShell/SideBar.tsx @@ -11,6 +11,7 @@ import * as React from 'react'; type route = { path: string; + // eslint-disable-next-line no-undef icon: JSX.Element; name: string; submenu?: route; diff --git a/src/Components/AppShell/SidebarSubmenu.tsx b/src/Components/AppShell/SidebarSubmenu.tsx index c4d5e3df..0dbb9569 100644 --- a/src/Components/AppShell/SidebarSubmenu.tsx +++ b/src/Components/AppShell/SidebarSubmenu.tsx @@ -4,6 +4,7 @@ import { Link, useLocation } from 'react-router-dom' function SidebarSubmenu({submenu, name, icon} : { path: string; + // eslint-disable-next-line no-undef icon: JSX.Element; name: string; submenu?: any | undefined}){ @@ -14,6 +15,7 @@ function SidebarSubmenu({submenu, name, icon} : { path: string; /** Open Submenu list if path found in routes, this is for directly loading submenu routes first time */ useEffect(() => { if(submenu.filter(m => {return m.path === location.pathname})[0])setIsExpanded(true) + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) return ( diff --git a/src/Components/AppShell/Sitemap.tsx b/src/Components/AppShell/Sitemap.tsx index df461d21..e385ad91 100644 --- a/src/Components/AppShell/Sitemap.tsx +++ b/src/Components/AppShell/Sitemap.tsx @@ -24,6 +24,7 @@ export const Sitemap = ({url}:{url:string}) => { setSitemap(generateSitemap()); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [items]); return ( diff --git a/src/Components/AppShell/hooks/useAssets.tsx b/src/Components/AppShell/hooks/useAssets.tsx index 623a8681..1dd68d98 100644 --- a/src/Components/AppShell/hooks/useAssets.tsx +++ b/src/Components/AppShell/hooks/useAssets.tsx @@ -16,6 +16,7 @@ const AssetContext = createContext({ function useAssetsManager(): { api: AssetsApi; + // eslint-disable-next-line no-unused-vars setAssetsApi: (api: AssetsApi) => void; } { const [api, setApi] = useState({} as AssetsApi); diff --git a/src/Components/Auth/LoginPage.tsx b/src/Components/Auth/LoginPage.tsx index b46fbb22..7aa012fa 100644 --- a/src/Components/Auth/LoginPage.tsx +++ b/src/Components/Auth/LoginPage.tsx @@ -13,6 +13,7 @@ export function LoginPage() { const navigate = useNavigate(); + // eslint-disable-next-line react-hooks/exhaustive-deps const onLogin = async () => { await toast.promise( login({ email: email, password: password }), diff --git a/src/Components/Auth/RequestPasswordPage.tsx b/src/Components/Auth/RequestPasswordPage.tsx index 6c1a0846..6fb4786b 100644 --- a/src/Components/Auth/RequestPasswordPage.tsx +++ b/src/Components/Auth/RequestPasswordPage.tsx @@ -4,6 +4,7 @@ import { toast } from 'react-toastify' import { useAuth } from './useAuth' import { MapOverlayPage} from '../Templates' +// eslint-disable-next-line react/prop-types export function RequestPasswordPage({reset_url}) { const [email, setEmail] = useState(""); diff --git a/src/Components/Auth/SignupPage.tsx b/src/Components/Auth/SignupPage.tsx index 053c1a35..810afcef 100644 --- a/src/Components/Auth/SignupPage.tsx +++ b/src/Components/Auth/SignupPage.tsx @@ -16,6 +16,7 @@ export function SignupPage() { const navigate = useNavigate(); + // eslint-disable-next-line react-hooks/exhaustive-deps const onRegister = async () => { await toast.promise( register({ email: email, password: password }, userName), diff --git a/src/Components/Auth/useAuth.tsx b/src/Components/Auth/useAuth.tsx index d51a9473..b1817373 100644 --- a/src/Components/Auth/useAuth.tsx +++ b/src/Components/Auth/useAuth.tsx @@ -19,13 +19,18 @@ type AuthCredentials = { type AuthContextProps = { isAuthenticated: boolean, user: UserItem | null; + // eslint-disable-next-line no-unused-vars login: (credentials: AuthCredentials) => Promise, + // eslint-disable-next-line no-unused-vars register: (credentials: AuthCredentials, userName: string) => Promise, loading: boolean, logout: () => Promise, + // eslint-disable-next-line no-unused-vars updateUser: (user: UserItem) => any, token: string | null, + // eslint-disable-next-line no-unused-vars requestPasswordReset: (email:string, reset_url: string) => Promise, + // eslint-disable-next-line no-unused-vars passwordReset: (token:string, new_password:string) => Promise } @@ -52,6 +57,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => { setLoading(true); loadUser(); setLoading(false) + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); async function loadUser(): Promise { @@ -88,7 +94,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => { const register = async (credentials: AuthCredentials, userName): Promise => { setLoading(true); try { - const res = await userApi.register(credentials.email, credentials.password, userName) + /* const res = */ await userApi.register(credentials.email, credentials.password, userName) return (await login(credentials)); } catch (error: any) { setLoading(false); @@ -109,6 +115,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => { const updateUser = async (user: UserItem) => { setLoading(true); + // eslint-disable-next-line no-unused-vars const { id, ...userRest } = user; try { diff --git a/src/Components/Gaming/Modal.tsx b/src/Components/Gaming/Modal.tsx index 943eb060..db08634d 100644 --- a/src/Components/Gaming/Modal.tsx +++ b/src/Components/Gaming/Modal.tsx @@ -6,6 +6,7 @@ export function Modal({children, showOnStartup}:{children : React.ReactNode, sho useEffect(() => { if(showOnStartup) window.my_modal_3.showModal() + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) diff --git a/src/Components/Gaming/Quests.tsx b/src/Components/Gaming/Quests.tsx index 22b57586..1486385d 100644 --- a/src/Components/Gaming/Quests.tsx +++ b/src/Components/Gaming/Quests.tsx @@ -12,6 +12,7 @@ export function Quests() { useEffect(() => { setQuestsOpen(false); + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) const [profile, setProfie] = useState() diff --git a/src/Components/Gaming/hooks/useQuests.tsx b/src/Components/Gaming/hooks/useQuests.tsx index e9f0f01d..475960c2 100644 --- a/src/Components/Gaming/hooks/useQuests.tsx +++ b/src/Components/Gaming/hooks/useQuests.tsx @@ -13,6 +13,7 @@ const QuestContext = createContext({ function useQuestsManager(initialOpen: boolean): { open: boolean; + // eslint-disable-next-line no-unused-vars setQuestsOpen: (open: boolean) => void; } { const [open, setOpen] = useState(initialOpen); diff --git a/src/Components/Input/Autocomplete.tsx b/src/Components/Input/Autocomplete.tsx index 1be8e51c..6209c58c 100644 --- a/src/Components/Input/Autocomplete.tsx +++ b/src/Components/Input/Autocomplete.tsx @@ -2,6 +2,7 @@ import * as React from 'react' import { useEffect } from 'react'; import { TagView } from '../Templates/TagView'; +// eslint-disable-next-line no-unused-vars export const Autocomplete = ({ inputProps, suggestions, onSelected, pushFilteredSuggestions, setFocus }: { inputProps: any, suggestions: Array, onSelected: (suggestion) => void, pushFilteredSuggestions?: Array, setFocus?: boolean }) => { const [filteredSuggestions, setFilteredSuggestions] = React.useState>([]); @@ -19,6 +20,7 @@ export const Autocomplete = ({ inputProps, suggestions, onSelected, pushFiltered const inputRef = React.useRef(); + // eslint-disable-next-line no-unused-vars const getSuggestionValue = suggestion => suggestion.name; const getSuggestions = value => { diff --git a/src/Components/Input/ComboBoxInput.tsx b/src/Components/Input/ComboBoxInput.tsx index 14fe96e4..159fe197 100644 --- a/src/Components/Input/ComboBoxInput.tsx +++ b/src/Components/Input/ComboBoxInput.tsx @@ -5,11 +5,13 @@ interface ComboBoxProps { id?: string; options: { value: string, label: string }[]; value: string; + // eslint-disable-next-line no-unused-vars onValueChange: (newValue: string) => void; } const ComboBoxInput = ({ id, options, value, onValueChange }: ComboBoxProps) => { + // eslint-disable-next-line no-unused-vars const [selectedValue, setSelectedValue] = useState(value); const handleChange = (e: React.ChangeEvent) => { diff --git a/src/Components/Input/SelectBox.tsx b/src/Components/Input/SelectBox.tsx index 31354cfc..cd2ce0cd 100644 --- a/src/Components/Input/SelectBox.tsx +++ b/src/Components/Input/SelectBox.tsx @@ -10,6 +10,7 @@ type SelectBoxProps = { containerStyle?: string; defaultValue: string; placeholder?: string; + // eslint-disable-next-line no-unused-vars updateFormValue: (value: string ) => void; options: {name: string, value: string}[]; diff --git a/src/Components/Input/TextAreaInput.tsx b/src/Components/Input/TextAreaInput.tsx index fd09e222..528b883b 100644 --- a/src/Components/Input/TextAreaInput.tsx +++ b/src/Components/Input/TextAreaInput.tsx @@ -11,6 +11,7 @@ type TextAreaProps = { inputStyle?: string; defaultValue: string; placeholder?: string; + // eslint-disable-next-line no-unused-vars updateFormValue?: (value: string) => void; } @@ -54,6 +55,7 @@ export function TextAreaInput({ labelTitle, dataField, labelStyle, containerStyl } init.current = true; } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [ref]); useEffect(() => { diff --git a/src/Components/Input/TextInput.tsx b/src/Components/Input/TextInput.tsx index 85caa770..3ac0a21f 100644 --- a/src/Components/Input/TextInput.tsx +++ b/src/Components/Input/TextInput.tsx @@ -11,6 +11,7 @@ type InputTextProps = { defaultValue?: string; placeholder?: string; autocomplete?: string + // eslint-disable-next-line no-unused-vars updateFormValue?: (value: string ) => void; } diff --git a/src/Components/Map/ItemForm.tsx b/src/Components/Map/ItemForm.tsx index af650c45..2ec519c4 100644 --- a/src/Components/Map/ItemForm.tsx +++ b/src/Components/Map/ItemForm.tsx @@ -8,6 +8,7 @@ export const ItemForm = ({ children, item, title, setPopupTitle }: { children?: useEffect(() => { setPopupTitle&& title && setPopupTitle(title); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [title]) return ( diff --git a/src/Components/Map/Layer.tsx b/src/Components/Map/Layer.tsx index e5f9f99b..4afb915b 100644 --- a/src/Components/Map/Layer.tsx +++ b/src/Components/Map/Layer.tsx @@ -88,6 +88,7 @@ export const Layer = ({ useEffect(() => { data && setItemsData({ data, children, name, menuIcon, menuText, menuColor, markerIcon, markerShape, markerDefaultColor, markerDefaultColor2, api, itemType, itemNameField, itemSubnameField, itemTextField, itemAvatarField, itemColorField, itemOwnerField, itemTagsField, itemOffersField, itemNeedsField, onlyOnePerOwner, customEditLink, customEditParameter, public_edit_items, listed, setItemFormPopup, itemFormPopup, clusterRef }); api && setItemsApi({ data, children, name, menuIcon, menuText, menuColor, markerIcon, markerShape, markerDefaultColor, markerDefaultColor2, api, itemType, itemNameField, itemSubnameField, itemTextField, itemAvatarField, itemColorField, itemOwnerField, itemTagsField, itemOffersField, itemNeedsField, onlyOnePerOwner, customEditLink, customEditParameter, public_edit_items, listed, setItemFormPopup, itemFormPopup, clusterRef }); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [data, api]) useMapEvents({ @@ -131,6 +132,7 @@ export const Layer = ({ useEffect(() => { openPopup(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [leafletRefs, location]) useEffect(() => { @@ -143,6 +145,7 @@ export const Layer = ({ } }) } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [tagsReady]) return ( diff --git a/src/Components/Map/Permissions.tsx b/src/Components/Map/Permissions.tsx index 687ef43d..bd60026a 100644 --- a/src/Components/Map/Permissions.tsx +++ b/src/Components/Map/Permissions.tsx @@ -14,6 +14,7 @@ useEffect(() => { adminRole && setAdminRole(adminRole); data && setPermissionData(data); api && setPermissionApi(api); +// eslint-disable-next-line react-hooks/exhaustive-deps }, [api, data, adminRole, user]) return ( diff --git a/src/Components/Map/Subcomponents/Controls/FilterControl.tsx b/src/Components/Map/Subcomponents/Controls/FilterControl.tsx index ce5e0d08..4281df01 100644 --- a/src/Components/Map/Subcomponents/Controls/FilterControl.tsx +++ b/src/Components/Map/Subcomponents/Controls/FilterControl.tsx @@ -13,6 +13,7 @@ export function FilterControl() { groupTypes.map(layer => addVisibleGroupType(layer.value) ) + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) diff --git a/src/Components/Map/Subcomponents/Controls/LocateControl.tsx b/src/Components/Map/Subcomponents/Controls/LocateControl.tsx index 3be0c6d8..16cc2f14 100644 --- a/src/Components/Map/Subcomponents/Controls/LocateControl.tsx +++ b/src/Components/Map/Subcomponents/Controls/LocateControl.tsx @@ -1,4 +1,3 @@ -import * as React from 'react' import * as L from 'leaflet' import { useMap, useMapEvents } from 'react-leaflet' import 'leaflet.locatecontrol' @@ -26,6 +25,7 @@ export const LocateControl = () => { setLc(L.control.locate().addTo(map)); init.current = true; } + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) useMapEvents({ diff --git a/src/Components/Map/Subcomponents/Controls/SearchControl.tsx b/src/Components/Map/Subcomponents/Controls/SearchControl.tsx index 8362de66..56159758 100644 --- a/src/Components/Map/Subcomponents/Controls/SearchControl.tsx +++ b/src/Components/Map/Subcomponents/Controls/SearchControl.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { useAddFilterTag, useFilterTags, useResetFilterTags } from '../../hooks/useFilter' +import { useAddFilterTag } from '../../hooks/useFilter' import useWindowDimensions from '../../hooks/useWindowDimension'; import axios from 'axios'; import { useEffect, useRef, useState } from 'react'; @@ -15,7 +15,6 @@ import * as L from 'leaflet'; import MarkerIconFactory from '../../../../Utils/MarkerIconFactory'; import { decodeTag } from '../../../../Utils/FormatTags'; import { useLocation, useNavigate } from 'react-router-dom'; -import { useClusterRef } from '../../hooks/useClusterRef'; import { Item } from '../../../../types'; import { SidebarControl } from './SidebarControl'; diff --git a/src/Components/Map/Subcomponents/ItemFormPopup.tsx b/src/Components/Map/Subcomponents/ItemFormPopup.tsx index 1e86440a..bde1a8cb 100644 --- a/src/Components/Map/Subcomponents/ItemFormPopup.tsx +++ b/src/Components/Map/Subcomponents/ItemFormPopup.tsx @@ -3,7 +3,7 @@ import { LatLng } from 'leaflet' import { Popup as LeafletPopup, useMap } from 'react-leaflet' import { useEffect, useRef, useState } from 'react' import { useAddItem, useItems, useRemoveItem, useUpdateItem } from '../hooks/useItems' -import { Geometry, LayerProps, Item, ItemsApi } from '../../../types' +import { Geometry, LayerProps, Item } from '../../../types' import { TextAreaInput } from '../../Input/TextAreaInput' import { TextInput } from '../../Input/TextInput' import { toast } from 'react-toastify' @@ -25,6 +25,7 @@ export function ItemFormPopup(props: ItemFormPopupProps) { const [spinner, setSpinner] = useState(false); + // eslint-disable-next-line no-unused-vars const [popupTitle, setPopupTitle] = useState(""); const formRef = useRef(null); @@ -34,6 +35,7 @@ export function ItemFormPopup(props: ItemFormPopupProps) { const addItem = useAddItem(); const updateItem = useUpdateItem(); const items = useItems(); + // eslint-disable-next-line no-unused-vars const removeItem = useRemoveItem(); diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx index 48ede4ce..e38d1919 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/HeaderView.tsx @@ -5,11 +5,6 @@ import { getValue } from "../../../../Utils/GetValue"; import { useAssetApi } from '../../../AppShell/hooks/useAssets' import DialogModal from "../../../Templates/DialogModal"; import { useNavigate } from "react-router-dom"; -import { useMap } from "react-leaflet"; -import { useEffect } from "react"; - - - export function HeaderView({ item, api, editCallback, deleteCallback, setPositionCallback, itemNameField, itemSubnameField, itemAvatarField, loading, hideMenu = false, big = false, truncateSubname = true, hideSubname = false, showAddress = false }: { item: Item, @@ -39,7 +34,7 @@ export function HeaderView({ item, api, editCallback, deleteCallback, setPositio const title = itemNameField ? getValue(item, itemNameField) : item.layer?.itemNameField && item && getValue(item, item.layer?.itemNameField); const subtitle = itemSubnameField ? getValue(item, itemSubnameField) : item.layer?.itemSubnameField && item && getValue(item, item.layer?.itemSubnameField); - const [address, setAdress] = React.useState(""); + const [address, /* setAdress*/] = React.useState(""); const params = new URLSearchParams(window.location.search); diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupCheckboxInput.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupCheckboxInput.tsx index 119dd804..c38f55ad 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupCheckboxInput.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupCheckboxInput.tsx @@ -1,5 +1,3 @@ -import * as React from 'react' -import { TextInput } from '../../../Input' import { Item } from '../../../../types' export const PopupCheckboxInput = ({ dataField, label, item }: diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx index 13b3bf18..17290448 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/PopupStartEndInput.tsx @@ -5,7 +5,9 @@ import { Item } from '../../../../types' type StartEndInputProps = { item?:Item, showLabels?: boolean + // eslint-disable-next-line no-unused-vars updateStartValue?: (value: string ) => void; + // eslint-disable-next-line no-unused-vars updateEndValue?: (value: string ) => void; } diff --git a/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx b/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx index d6aad8b6..89a5363f 100644 --- a/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx +++ b/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx @@ -28,11 +28,14 @@ export const TextView = ({ item, truncate = false, itemTextField, rawText }: { i item && text ? replacedText = fixUrls(text) : ""; + // eslint-disable-next-line no-useless-escape replacedText ? replacedText = replacedText.replace(/(? { let shortUrl = url; + // eslint-disable-next-line no-useless-escape if (url.match('^https:\/\/')) { shortUrl = url.split('https://')[1]; } + // eslint-disable-next-line no-useless-escape if (url.match('^http:\/\/')) { shortUrl = url.split('http://')[1]; } @@ -47,36 +50,47 @@ export const TextView = ({ item, truncate = false, itemTextField, rawText }: { i return `[${match}](${match})`; }) : ""; + // eslint-disable-next-line react/prop-types const CustomH1 = ({ children }) => (

{children}

); + // eslint-disable-next-line react/prop-types const CustomH2 = ({ children }) => (

{children}

); + // eslint-disable-next-line react/prop-types const CustomH3 = ({ children }) => (

{children}

); + // eslint-disable-next-line react/prop-types const CustomH4 = ({ children }) => (

{children}

); + // eslint-disable-next-line react/prop-types const CustomH5 = ({ children }) => (
{children}
); + // eslint-disable-next-line react/prop-types const CustomH6 = ({ children }) => (
{children}
); + // eslint-disable-next-line react/prop-types const CustomParagraph = ({ children }) => (

{children}

); + // eslint-disable-next-line react/prop-types const CustomUnorderdList = ({ children }) => (
    {children}
); + // eslint-disable-next-line react/prop-types const CustomOrderdList = ({ children }) => (
    {children}
); + // eslint-disable-next-line react/prop-types const CustomHorizontalRow = ({ children }) => (
{children} ); + // eslint-disable-next-line react/prop-types const CustomImage = ({ alt, src, title }) => ( ); + // eslint-disable-next-line react/prop-types const CustomExternalLink = ({ href, children }) => ( {children} ); + /* eslint-disable react/prop-types */ const CustomHashTagLink = ({ children, tag, item }) => { return ( {decodeTag(children)} ) }; + /* eslint-enable react/prop-types */ + // eslint-disable-next-line react/display-name const MemoizedVideoEmbed = memo(({ url }: { url: string }) => (