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 { css, Global } from "@emotion/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import produce from "immer";
import apolloClient from "./apolloClient";

View file

@ -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 (
<ClassNames>
{({ css, cx }) => (
<Button
variant="unstyled"
textShadow={`${theme.colors.blackAlpha["700"]} 0 1px 2px`}
d="flex"
alignItems="center"
justifyContent="center"
_focus={{ borderColor: "gray.50" }}
_hover={{ borderColor: "gray.50" }}
outline="initial"
fontSize="sm"
fontWeight="normal"
minWidth="12ch"
disabled={loading}
className={cx(
css`
return (
<ClassNames>
{({ css, cx }) => (
<Button
variant="unstyled"
textShadow={`${theme.colors.blackAlpha["700"]} 0 1px 2px`}
d="flex"
alignItems="center"
justifyContent="center"
_focus={{ borderColor: "gray.50" }}
_hover={{ borderColor: "gray.50" }}
outline="initial"
fontSize="sm"
fontWeight="normal"
minWidth="12ch"
disabled={loading}
className={cx(
css`
border: 1px solid transparent !important;
color: ${theme.colors.gray["100"]};
cursor: ${loading ? "wait" : "pointer"} !important;
@ -331,22 +330,22 @@ function PosePickerButton({ pose, altStyle, isOpen, loading, ...props }, ref) {
border-width: 2px !important;
}
`,
isOpen && "is-open",
)}
{...props}
ref={ref}
>
<EmojiImage src={icon} alt="Style" />
<Box width=".5em" />
{label}
<Box width=".5em" />
<ChevronDownIcon />
</Button>
)}
</ClassNames>
);
}
PosePickerButton = React.forwardRef(PosePickerButton);
isOpen && "is-open",
)}
{...props}
ref={ref}
>
<EmojiImage src={icon} alt="Style" />
<Box width=".5em" />
{label}
<Box width=".5em" />
<ChevronDownIcon />
</Button>
)}
</ClassNames>
);
},
);
function PosePickerTable({ poseInfos, onChange, initialFocusRef }) {
return (

View file

@ -1,5 +1,3 @@
import * as React from "react";
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.
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);