1
0
Fork 0
forked from OpenNeo/impress

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!
This commit is contained in:
Emi Matchu 2024-05-02 12:18:51 -07:00
parent 4d3b19b23b
commit 460235e7cf
4 changed files with 40 additions and 44 deletions

View file

@ -14,7 +14,6 @@ import { ApolloProvider } from "@apollo/client";
import { BrowserRouter } from "react-router-dom"; import { BrowserRouter } from "react-router-dom";
import { css, Global } from "@emotion/react"; import { css, Global } from "@emotion/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import produce from "immer";
import apolloClient from "./apolloClient"; import apolloClient from "./apolloClient";

View file

@ -31,7 +31,6 @@ import getVisibleLayers from "../components/getVisibleLayers";
import { OutfitLayers } from "../components/OutfitPreview"; import { OutfitLayers } from "../components/OutfitPreview";
import SupportOnly from "./support/SupportOnly"; import SupportOnly from "./support/SupportOnly";
import { useAltStylesForSpecies } from "../loaders/alt-styles"; import { useAltStylesForSpecies } from "../loaders/alt-styles";
import useSupport from "./support/useSupport";
import { useLocalStorage } from "../util"; import { useLocalStorage } from "../util";
// From https://twemoji.twitter.com/, thank you! // From https://twemoji.twitter.com/, thank you!
@ -81,7 +80,6 @@ function PosePicker({
"DTIPosePickerIsInSupportMode", "DTIPosePickerIsInSupportMode",
false, false,
); );
const { isSupportUser } = useSupport();
const toast = useToast(); const toast = useToast();
const loading = posesQuery.loading || altStylesQuery.isLoading; const loading = posesQuery.loading || altStylesQuery.isLoading;
@ -280,30 +278,31 @@ function PosePicker({
); );
} }
function PosePickerButton({ pose, altStyle, isOpen, loading, ...props }, ref) { const PosePickerButton = React.forwardRef(
const theme = useTheme(); ({ pose, altStyle, isOpen, loading, ...props }, ref) => {
const theme = useTheme();
const icon = altStyle != null ? twemojiSunglasses : getIcon(pose); const icon = altStyle != null ? twemojiSunglasses : getIcon(pose);
const label = altStyle != null ? altStyle.seriesName : getLabel(pose); const label = altStyle != null ? altStyle.seriesName : getLabel(pose);
return ( return (
<ClassNames> <ClassNames>
{({ css, cx }) => ( {({ css, cx }) => (
<Button <Button
variant="unstyled" variant="unstyled"
textShadow={`${theme.colors.blackAlpha["700"]} 0 1px 2px`} textShadow={`${theme.colors.blackAlpha["700"]} 0 1px 2px`}
d="flex" d="flex"
alignItems="center" alignItems="center"
justifyContent="center" justifyContent="center"
_focus={{ borderColor: "gray.50" }} _focus={{ borderColor: "gray.50" }}
_hover={{ borderColor: "gray.50" }} _hover={{ borderColor: "gray.50" }}
outline="initial" outline="initial"
fontSize="sm" fontSize="sm"
fontWeight="normal" fontWeight="normal"
minWidth="12ch" minWidth="12ch"
disabled={loading} disabled={loading}
className={cx( className={cx(
css` css`
border: 1px solid transparent !important; border: 1px solid transparent !important;
color: ${theme.colors.gray["100"]}; color: ${theme.colors.gray["100"]};
cursor: ${loading ? "wait" : "pointer"} !important; cursor: ${loading ? "wait" : "pointer"} !important;
@ -331,22 +330,22 @@ function PosePickerButton({ pose, altStyle, isOpen, loading, ...props }, ref) {
border-width: 2px !important; border-width: 2px !important;
} }
`, `,
isOpen && "is-open", isOpen && "is-open",
)} )}
{...props} {...props}
ref={ref} ref={ref}
> >
<EmojiImage src={icon} alt="Style" /> <EmojiImage src={icon} alt="Style" />
<Box width=".5em" /> <Box width=".5em" />
{label} {label}
<Box width=".5em" /> <Box width=".5em" />
<ChevronDownIcon /> <ChevronDownIcon />
</Button> </Button>
)} )}
</ClassNames> </ClassNames>
); );
} },
PosePickerButton = React.forwardRef(PosePickerButton); );
function PosePickerTable({ poseInfos, onChange, initialFocusRef }) { function PosePickerTable({ poseInfos, onChange, initialFocusRef }) {
return ( return (

View file

@ -1,5 +1,3 @@
import * as React from "react";
import { getSupportSecret } from "../../impress-2020-config"; import { getSupportSecret } from "../../impress-2020-config";
/** /**

View file

@ -700,7 +700,7 @@ function getZonesAndItems(itemsById, wornItemIds, closetedItemIds) {
// used. Then, loop over them again, appending the ID number if count > 1. // used. Then, loop over them again, appending the ID number if count > 1.
const labelCounts = new Map(); const labelCounts = new Map();
for (const itemZoneGroup of zonesAndItems) { for (const itemZoneGroup of zonesAndItems) {
const { zoneId, zoneLabel } = itemZoneGroup; const { zoneLabel } = itemZoneGroup;
const count = labelCounts.get(zoneLabel) ?? 0; const count = labelCounts.get(zoneLabel) ?? 0;
labelCounts.set(zoneLabel, count + 1); labelCounts.set(zoneLabel, count + 1);