Fix Eslint errors

This commit is contained in:
Kalle (Sendou) 2021-06-21 00:17:06 +03:00
parent c02e9228bf
commit 0defb03260
13 changed files with 43 additions and 27 deletions

View File

@ -24,7 +24,7 @@ import { abilities, isMainAbility } from "utils/lists/abilities";
import { components } from "react-select";
import ModeImage from "components/common/ModeImage";
import MySelect from "components/common/MySelect";
import defaultStyles from "utils/selectStyles";
import useSelectStyles from "hooks/useSelectStyles";
interface Props {
filters: UseBuildsByWeaponState["filters"];
@ -114,7 +114,7 @@ const BuildFilters: React.FC<Props> = ({ filters, dispatch }) => {
const { borderColor, themeColorOpaque, textColor, gray } = useMyTheme();
const selectDefaultStyles = defaultStyles();
const selectDefaultStyles = useSelectStyles();
const selectStyles = {
...selectDefaultStyles,
singleValue: (base: any) => ({

View File

@ -11,7 +11,7 @@ import ReactSelect, {
import { SelectComponents } from "react-select/src/components";
import { Box, Flex } from "@chakra-ui/react";
import ModeImage from "./ModeImage";
import defaultStyles from "utils/selectStyles";
import useSelectStyles from "hooks/useSelectStyles";
interface SelectProps {
options?:
@ -73,7 +73,7 @@ const MultipleModeSelector: React.FC<SelectProps> = ({
const { themeColorHex, bgColor } = useMyTheme();
const [inputValue, setInputValue] = useState("");
const [selectedModes, setSelectedModes] = useState(defaultValue);
const selectDefaultStyles = defaultStyles();
const selectDefaultStyles = useSelectStyles();
const handleChange = (selectedOption: any) => {
if (!selectedOption) {

View File

@ -9,7 +9,7 @@ import ReactSelect, {
ValueType,
} from "react-select";
import { SelectComponents } from "react-select/src/components";
import defaultStyles from "utils/selectStyles";
import useSelectStyles from "hooks/useSelectStyles";
interface SelectProps {
options?:
@ -68,7 +68,7 @@ const MySelect: React.FC<SelectProps> = ({
}) => {
const { themeColorHex, bgColor } = useMyTheme();
const [inputValue, setInputValue] = useState("");
const selectDefaultStyles = defaultStyles();
const selectDefaultStyles = useSelectStyles();
const handleChange = (selectedOption: any) => {
if (!selectedOption) {

View File

@ -7,6 +7,16 @@ import { trpc } from "utils/trpc";
import { isFreeAgentPlaystyle, isFreeAgentRegion } from "utils/typeGuards";
import { useMyRouter } from "./useMyRouter";
const continentCodeToRegion = new Map<string, FreeAgentRegion>([
["AF", "EUROPE"],
["AN", "EUROPE"],
["AS", "ASIA"],
["EU", "EUROPE"],
["NA", "AMERICAS"],
["OC", "ASIA"],
["SA", "AMERICAS"],
]);
export type FreeAgentRegion = "EUROPE" | "AMERICAS" | "ASIA";
export interface UseFreeAgentsState {
@ -124,16 +134,6 @@ export function useFreeAgents() {
return result;
}
const continentCodeToRegion = new Map<string, FreeAgentRegion>([
["AF", "EUROPE"],
["AN", "EUROPE"],
["AS", "ASIA"],
["EU", "EUROPE"],
["NA", "AMERICAS"],
["OC", "ASIA"],
["SA", "AMERICAS"],
]);
const countryCodeToRegion = useMemo(() => {
return Object.entries(countries).reduce((acc, cur) => {
acc.set(cur[0], continentCodeToRegion.get(cur[1].continent)!);

View File

@ -1,6 +1,6 @@
import { useMyTheme } from "../hooks/common";
import { useMyTheme } from "./common";
const defaultStyles = () => {
const useSelectStyles = () => {
const { borderColor, themeColorHex, themeColorOpaque, textColor } =
useMyTheme();
@ -38,4 +38,4 @@ const defaultStyles = () => {
};
};
export default defaultStyles;
export default useSelectStyles;

View File

@ -98,9 +98,11 @@ const deleteEvent = async ({
return prisma.calendarEvent.delete({ where: { id: eventId } });
};
export default {
const calendarService = {
events,
addEvent,
editEvent,
deleteEvent,
};
export default calendarService;

View File

@ -122,7 +122,7 @@ const deleteLike = ({ userId, postId }: { userId: number; postId: number }) => {
});
};
export default {
const freeAgentsService = {
posts,
upsertPost,
deletePost,
@ -130,3 +130,5 @@ export default {
addLike,
deleteLike,
};
export default freeAgentsService;

View File

@ -138,9 +138,11 @@ const peakLeague = ({ region, type }: { region: Region; type: LeagueType }) => {
});
};
export default {
const leaderboardsService = {
peak,
peakWestern,
peakByWeapon,
peakLeague,
};
export default leaderboardsService;

View File

@ -136,7 +136,9 @@ const createResults = async (
await prisma.leagueSquadMember.createMany({ data: leagueMembersData });
};
export default {
const leagueService = {
latestResult,
createResults,
};
export default leagueService;

View File

@ -118,9 +118,11 @@ const previousLadderDay = async () => {
});
};
export default {
const playService = {
allRegisteredTeams,
allLadderRegisteredTeamsForMatches,
nextLadderDay,
previousLadderDay,
};
export default playService;

View File

@ -795,7 +795,7 @@ const endVoting = async (userId: number) => {
]);
};
export default {
const plusService = {
getPlusStatuses,
getSuggestions,
getVotingSummariesByMonthAndTier,
@ -810,3 +810,5 @@ export default {
votedUserScores,
endVoting,
};
export default plusService;

View File

@ -50,7 +50,9 @@ const getMostRecentResult = () => {
});
};
export default {
const xSearchService = {
getTop500PlacementsByMonth,
getMostRecentResult,
};
export default xSearchService;

View File

@ -88,6 +88,8 @@ const getXTrends = async (): Promise<XTrends> => {
);
};
export default {
const xTrendsService = {
getXTrends,
};
export default xTrendsService;