From 460235e7cf9381b03b2fe1a56a17c6476ce8ef71 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 2 May 2024 12:18:51 -0700 Subject: [PATCH] Fix some eslint errors Huh, I guess my desktop workstation doesn't have this commit hook set up. Now that I'm using my Mac again, it's catching some things I missed! --- app/javascript/wardrobe-2020/AppProvider.js | 1 - .../wardrobe-2020/WardrobePage/PosePicker.js | 79 +++++++++---------- .../WardrobePage/support/useSupport.js | 2 - .../WardrobePage/useOutfitState.js | 2 +- 4 files changed, 40 insertions(+), 44 deletions(-) diff --git a/app/javascript/wardrobe-2020/AppProvider.js b/app/javascript/wardrobe-2020/AppProvider.js index 23bf08f5..f51a487d 100644 --- a/app/javascript/wardrobe-2020/AppProvider.js +++ b/app/javascript/wardrobe-2020/AppProvider.js @@ -14,7 +14,6 @@ import { ApolloProvider } from "@apollo/client"; import { BrowserRouter } from "react-router-dom"; import { css, Global } from "@emotion/react"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import produce from "immer"; import apolloClient from "./apolloClient"; diff --git a/app/javascript/wardrobe-2020/WardrobePage/PosePicker.js b/app/javascript/wardrobe-2020/WardrobePage/PosePicker.js index 73d05fba..ce020796 100644 --- a/app/javascript/wardrobe-2020/WardrobePage/PosePicker.js +++ b/app/javascript/wardrobe-2020/WardrobePage/PosePicker.js @@ -31,7 +31,6 @@ import getVisibleLayers from "../components/getVisibleLayers"; import { OutfitLayers } from "../components/OutfitPreview"; import SupportOnly from "./support/SupportOnly"; import { useAltStylesForSpecies } from "../loaders/alt-styles"; -import useSupport from "./support/useSupport"; import { useLocalStorage } from "../util"; // From https://twemoji.twitter.com/, thank you! @@ -81,7 +80,6 @@ function PosePicker({ "DTIPosePickerIsInSupportMode", false, ); - const { isSupportUser } = useSupport(); const toast = useToast(); const loading = posesQuery.loading || altStylesQuery.isLoading; @@ -280,30 +278,31 @@ function PosePicker({ ); } -function PosePickerButton({ pose, altStyle, isOpen, loading, ...props }, ref) { - const theme = useTheme(); +const PosePickerButton = React.forwardRef( + ({ pose, altStyle, isOpen, loading, ...props }, ref) => { + const theme = useTheme(); - const icon = altStyle != null ? twemojiSunglasses : getIcon(pose); - const label = altStyle != null ? altStyle.seriesName : getLabel(pose); + const icon = altStyle != null ? twemojiSunglasses : getIcon(pose); + const label = altStyle != null ? altStyle.seriesName : getLabel(pose); - return ( - - {({ css, cx }) => ( - - )} - - ); -} -PosePickerButton = React.forwardRef(PosePickerButton); + isOpen && "is-open", + )} + {...props} + ref={ref} + > + + + {label} + + + + )} + + ); + }, +); function PosePickerTable({ poseInfos, onChange, initialFocusRef }) { return ( diff --git a/app/javascript/wardrobe-2020/WardrobePage/support/useSupport.js b/app/javascript/wardrobe-2020/WardrobePage/support/useSupport.js index 6e3bce11..ef4a076b 100644 --- a/app/javascript/wardrobe-2020/WardrobePage/support/useSupport.js +++ b/app/javascript/wardrobe-2020/WardrobePage/support/useSupport.js @@ -1,5 +1,3 @@ -import * as React from "react"; - import { getSupportSecret } from "../../impress-2020-config"; /** diff --git a/app/javascript/wardrobe-2020/WardrobePage/useOutfitState.js b/app/javascript/wardrobe-2020/WardrobePage/useOutfitState.js index 4d956ede..972927bb 100644 --- a/app/javascript/wardrobe-2020/WardrobePage/useOutfitState.js +++ b/app/javascript/wardrobe-2020/WardrobePage/useOutfitState.js @@ -700,7 +700,7 @@ function getZonesAndItems(itemsById, wornItemIds, closetedItemIds) { // used. Then, loop over them again, appending the ID number if count > 1. const labelCounts = new Map(); for (const itemZoneGroup of zonesAndItems) { - const { zoneId, zoneLabel } = itemZoneGroup; + const { zoneLabel } = itemZoneGroup; const count = labelCounts.get(zoneLabel) ?? 0; labelCounts.set(zoneLabel, count + 1);