rename lib -> utils
@@ -13,9 +13,9 @@ import { ViewSlotsAbilities } from "components/builds/ViewSlots";
|
||||
import AbilityIcon from "components/common/AbilityIcon";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { Explanation } from "hooks/useAbilityEffects";
|
||||
import { isMainAbility } from "lib/lists/abilities";
|
||||
import { useState } from "react";
|
||||
import { FaChartLine, FaQuestion } from "react-icons/fa";
|
||||
import { isMainAbility } from "utils/lists/abilities";
|
||||
import StatChart from "./StatChart";
|
||||
|
||||
interface BuildStatsProps {
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Box, Button, Flex, IconButton } from "@chakra-ui/react";
|
||||
import { t } from "@lingui/macro";
|
||||
import ViewSlots, { ViewSlotsAbilities } from "components/builds/ViewSlots";
|
||||
import AbilitiesSelector from "components/u/AbilitiesSelector";
|
||||
import { AbilityOrUnknown } from "lib/types";
|
||||
import { FiCopy, FiEdit, FiSquare } from "react-icons/fi";
|
||||
import { AbilityOrUnknown } from "utils/types";
|
||||
import HeadOnlyToggle from "./HeadOnlyToggle";
|
||||
import LdeSlider from "./LdeSlider";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { t } from "@lingui/macro";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { abilityPoints } from "lib/lists/abilityPoints";
|
||||
import React from "react";
|
||||
import {
|
||||
CartesianGrid,
|
||||
@@ -12,6 +11,7 @@ import {
|
||||
XAxis,
|
||||
YAxis,
|
||||
} from "recharts";
|
||||
import { abilityPoints } from "utils/lists/abilityPoints";
|
||||
|
||||
interface StatChartProps {
|
||||
title: string;
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "components/common/Table";
|
||||
import { mainOnlyAbilities } from "lib/lists/abilities";
|
||||
import { mainOnlyAbilities } from "utils/lists/abilities";
|
||||
|
||||
interface Props {
|
||||
stats: {
|
||||
|
||||
@@ -16,11 +16,11 @@ import UserAvatar from "components/common/UserAvatar";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { getEmojiFlag } from "countries-list";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { PartialBy } from "lib/types";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
import { FiBarChart2, FiEdit, FiInfo, FiTarget } from "react-icons/fi";
|
||||
import { PartialBy } from "utils/types";
|
||||
import Gears from "./Gears";
|
||||
import ViewAP from "./ViewAP";
|
||||
import ViewSlots from "./ViewSlots";
|
||||
|
||||
@@ -19,9 +19,9 @@ import {
|
||||
UseBuildsByWeaponState,
|
||||
} from "hooks/builds";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { abilities, isMainAbility } from "lib/lists/abilities";
|
||||
import { Fragment, useState } from "react";
|
||||
import { FiTrash } from "react-icons/fi";
|
||||
import { abilities, isMainAbility } from "utils/lists/abilities";
|
||||
|
||||
interface Props {
|
||||
filters: UseBuildsByWeaponState["filters"];
|
||||
|
||||
@@ -3,7 +3,7 @@ import { t } from "@lingui/macro";
|
||||
import { Ability } from "@prisma/client";
|
||||
import AbilityIcon from "components/common/AbilityIcon";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { mainOnlyAbilities } from "lib/lists/abilities";
|
||||
import { mainOnlyAbilities } from "utils/lists/abilities";
|
||||
|
||||
interface ViewAPProps {
|
||||
aps: Record<Ability, number>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Box, BoxProps, Flex } from "@chakra-ui/react";
|
||||
import AbilityIcon from "components/common/AbilityIcon";
|
||||
import { AbilityOrUnknown } from "lib/types";
|
||||
import { AbilityOrUnknown } from "utils/types";
|
||||
|
||||
export type ViewSlotsAbilities = {
|
||||
headAbilities: AbilityOrUnknown[];
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import AbilityIcon from "components/common/AbilityIcon";
|
||||
import GearImage from "components/common/GearImage";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { abilityMarkdownCodes } from "lib/lists/abilityMarkdownCodes";
|
||||
import { gearMarkdownCodes } from "lib/lists/gearMarkdownCodes";
|
||||
import { codeToWeapon } from "lib/lists/weaponCodes";
|
||||
import Image from "next/image";
|
||||
import { abilityMarkdownCodes } from "utils/lists/abilityMarkdownCodes";
|
||||
import { gearMarkdownCodes } from "utils/lists/gearMarkdownCodes";
|
||||
import { codeToWeapon } from "utils/lists/weaponCodes";
|
||||
|
||||
const modeCodes: Record<string, string> = {
|
||||
turf_war: "TW",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useLingui } from "@lingui/react";
|
||||
import englishToInteral from "lib/data/englishToInternal.json";
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
import englishToInteral from "utils/data/englishToInternal.json";
|
||||
|
||||
interface GearImageProps {
|
||||
englishName: string;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Box, Flex } from "@chakra-ui/react";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { gear } from "lib/lists/gear";
|
||||
import { components } from "react-select";
|
||||
import { gear } from "utils/lists/gear";
|
||||
import GearImage from "./GearImage";
|
||||
import MySelect from "./MySelect";
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Box, Center, Flex } from "@chakra-ui/react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { components } from "react-select";
|
||||
import {
|
||||
salmonRunWeapons,
|
||||
weaponsWithHeroCategorized,
|
||||
} from "lib/lists/weaponsWithHero";
|
||||
import { components } from "react-select";
|
||||
} from "utils/lists/weaponsWithHero";
|
||||
import MySelect from "./MySelect";
|
||||
import WeaponImage from "./WeaponImage";
|
||||
|
||||
|
||||
@@ -23,18 +23,18 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import MarkdownTextarea from "components/common/MarkdownTextarea";
|
||||
import { getToastOptions } from "lib/getToastOptions";
|
||||
import { sendData } from "lib/postData";
|
||||
import { Unpacked } from "lib/types";
|
||||
import {
|
||||
FA_POST_CONTENT_LIMIT,
|
||||
freeAgentPostSchema,
|
||||
} from "lib/validators/fapost";
|
||||
import { GetAllFreeAgentPostsData } from "prisma/queries/getAllFreeAgentPosts";
|
||||
import { useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { FiTrash } from "react-icons/fi";
|
||||
import { mutate } from "swr";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { sendData } from "utils/postData";
|
||||
import { Unpacked } from "utils/types";
|
||||
import {
|
||||
FA_POST_CONTENT_LIMIT,
|
||||
freeAgentPostSchema,
|
||||
} from "utils/validators/fapost";
|
||||
import * as z from "zod";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Box, Flex } from "@chakra-ui/react";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { DiscordIcon } from "lib/assets/icons";
|
||||
import Link from "next/link";
|
||||
import { FaGithub, FaTwitter } from "react-icons/fa";
|
||||
import { FiInfo } from "react-icons/fi";
|
||||
import { DiscordIcon } from "utils/assets/icons";
|
||||
|
||||
const FooterContent: React.FC = () => {
|
||||
const { themeColorHex: themeColor } = useMyTheme();
|
||||
|
||||
@@ -15,10 +15,10 @@ import {
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { getVotingRange } from "lib/plus";
|
||||
import { useRouter } from "next/dist/client/router";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { getVotingRange } from "utils/plus";
|
||||
|
||||
export const navIcons: {
|
||||
code: string;
|
||||
|
||||
@@ -9,9 +9,9 @@ import {
|
||||
import { t } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { activateLocale } from "lib/i18n";
|
||||
import React from "react";
|
||||
import { FiGlobe } from "react-icons/fi";
|
||||
import { activateLocale } from "utils/i18n";
|
||||
|
||||
export const languages = [
|
||||
{ code: "de", name: "Deutsch" },
|
||||
|
||||
@@ -14,11 +14,11 @@ import {
|
||||
} from "@chakra-ui/react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { useUser } from "hooks/common";
|
||||
import { DiscordIcon } from "lib/assets/icons";
|
||||
import { signIn, signOut } from "next-auth/client";
|
||||
import Link from "next/link";
|
||||
import { FaHeart } from "react-icons/fa";
|
||||
import { FiMoon, FiSun } from "react-icons/fi";
|
||||
import { DiscordIcon } from "utils/assets/icons";
|
||||
import { LanguageSelector } from "./LanguageSelector";
|
||||
|
||||
const TopNav = () => {
|
||||
|
||||
@@ -2,10 +2,10 @@ import { Box, Flex } from "@chakra-ui/react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { weapons } from "lib/lists/weapons";
|
||||
import Image from "next/image";
|
||||
import { useState } from "react";
|
||||
import Draggable from "react-draggable";
|
||||
import { weapons } from "utils/lists/weapons";
|
||||
|
||||
interface DraggableImageAdderProps {
|
||||
addImageToSketch: (imgSrc: string) => void;
|
||||
|
||||
@@ -18,8 +18,8 @@ import salmonRunHighTide from "lib/assets/SalmonRunHighTide.svg";
|
||||
import salmonRunLowTide from "lib/assets/SalmonRunLowTide.svg";
|
||||
// @ts-ignore
|
||||
import salmonRunMidTide from "lib/assets/SalmonRunMidTide.svg";
|
||||
import { salmonRunStages, stages } from "lib/lists/stages";
|
||||
import { PlannerMapBg } from "pages/plans";
|
||||
import { salmonRunStages, stages } from "utils/lists/stages";
|
||||
|
||||
interface StageSelectorProps {
|
||||
handleChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
|
||||
|
||||
@@ -3,8 +3,8 @@ import SubText from "components/common/SubText";
|
||||
import TwitterAvatar from "components/common/TwitterAvatar";
|
||||
import UserAvatar from "components/common/UserAvatar";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { Unpacked } from "lib/types";
|
||||
import { GetAllLadderRegisteredTeamsData } from "prisma/queries/getAllLadderRegisteredTeams";
|
||||
import { Unpacked } from "utils/types";
|
||||
|
||||
interface Props {
|
||||
roster: Unpacked<GetAllLadderRegisteredTeamsData>["roster"];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Box } from "@chakra-ui/react";
|
||||
import { Unpacked } from "lib/types";
|
||||
import { GetLadderDayData } from "prisma/queries/getLadderDay";
|
||||
import { Unpacked } from "utils/types";
|
||||
import LadderTeam from "./LadderTeam";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -10,10 +10,10 @@ import {
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { useUser } from "hooks/common";
|
||||
import { useLadderTeams } from "hooks/play";
|
||||
import { getToastOptions } from "lib/getToastOptions";
|
||||
import { sendData } from "lib/postData";
|
||||
import { useEffect, useState } from "react";
|
||||
import { FiCheck, FiTrash } from "react-icons/fi";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { sendData } from "utils/postData";
|
||||
|
||||
interface Props {}
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
} from "components/common/Table";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { getRankingString } from "lib/strings";
|
||||
import { GetPlayerWithPlacementsData } from "prisma/queries/getPlayerWithPlacements";
|
||||
import { getRankingString } from "utils/strings";
|
||||
|
||||
interface Props {
|
||||
player: NonNullable<GetPlayerWithPlacementsData>;
|
||||
|
||||
@@ -14,8 +14,8 @@ import {
|
||||
import UserAvatar from "components/common/UserAvatar";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { getRankingString } from "lib/strings";
|
||||
import { GetPlayerWithPlacementsData } from "prisma/queries/getPlayerWithPlacements";
|
||||
import { getRankingString } from "utils/strings";
|
||||
|
||||
interface Props {
|
||||
player: NonNullable<GetPlayerWithPlacementsData>;
|
||||
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
} from "components/common/Table";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { getRankingString } from "lib/strings";
|
||||
import { GetPlayerWithPlacementsData } from "prisma/queries/getPlayerWithPlacements";
|
||||
import { getRankingString } from "utils/strings";
|
||||
|
||||
interface Props {
|
||||
player: NonNullable<GetPlayerWithPlacementsData>;
|
||||
|
||||
@@ -11,9 +11,9 @@ import MyHead from "components/common/MyHead";
|
||||
import SubText from "components/common/SubText";
|
||||
import { useUser } from "hooks/common";
|
||||
import { usePlus } from "hooks/plus";
|
||||
import { getFullUsername } from "lib/strings";
|
||||
import { Fragment } from "react";
|
||||
import { PlusStatuses, Suggestions } from "services/plus";
|
||||
import { getFullUsername } from "utils/strings";
|
||||
import Suggestion from "./Suggestion";
|
||||
import SuggestionModal from "./SuggestionModal";
|
||||
import VotingInfoHeader from "./VotingInfoHeader";
|
||||
|
||||
@@ -13,9 +13,9 @@ import {
|
||||
TableRow,
|
||||
} from "components/common/Table";
|
||||
import UserAvatar from "components/common/UserAvatar";
|
||||
import { getFullUsername, getLocalizedMonthYearString } from "lib/strings";
|
||||
import { useRouter } from "next/router";
|
||||
import { FiCheck } from "react-icons/fi";
|
||||
import { getFullUsername, getLocalizedMonthYearString } from "utils/strings";
|
||||
import {
|
||||
DistinctSummaryMonths,
|
||||
VotingSummariesByMonthAndTier,
|
||||
|
||||
@@ -14,15 +14,15 @@ import SubText from "components/common/SubText";
|
||||
import UserAvatar from "components/common/UserAvatar";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import useMutation from "hooks/useMutation";
|
||||
import { getFullUsername } from "lib/strings";
|
||||
import { Unpacked } from "lib/types";
|
||||
import {
|
||||
resuggestionSchema,
|
||||
SUGGESTION_DESCRIPTION_LIMIT,
|
||||
} from "lib/validators/suggestion";
|
||||
import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { Suggestions } from "services/plus";
|
||||
import { getFullUsername } from "utils/strings";
|
||||
import { Unpacked } from "utils/types";
|
||||
import {
|
||||
resuggestionSchema,
|
||||
SUGGESTION_DESCRIPTION_LIMIT,
|
||||
} from "utils/validators/suggestion";
|
||||
import * as z from "zod";
|
||||
|
||||
type FormData = z.infer<typeof resuggestionSchema>;
|
||||
|
||||
@@ -17,12 +17,12 @@ import {
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import UserSelector from "components/common/UserSelector";
|
||||
import useMutation from "hooks/useMutation";
|
||||
import { useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import {
|
||||
suggestionFullSchema,
|
||||
SUGGESTION_DESCRIPTION_LIMIT,
|
||||
} from "lib/validators/suggestion";
|
||||
import { useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
} from "utils/validators/suggestion";
|
||||
import * as z from "zod";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import MyLink from "components/common/MyLink";
|
||||
import { getVotingRange } from "lib/plus";
|
||||
import { getVotingRange } from "utils/plus";
|
||||
|
||||
const VotingInfoHeader = ({ isMember }: { isMember: boolean }) => {
|
||||
const { isHappening, endDate, nextVotingDate } = getVotingRange();
|
||||
|
||||
@@ -16,9 +16,9 @@ import {
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import UserSelector from "components/common/UserSelector";
|
||||
import useMutation from "hooks/useMutation";
|
||||
import { vouchSchema } from "lib/validators/vouch";
|
||||
import { useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { vouchSchema } from "utils/validators/vouch";
|
||||
import * as z from "zod";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -5,10 +5,10 @@ import SubText from "components/common/SubText";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import WeaponSelector from "components/common/WeaponSelector";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { salmonRunStages } from "lib/lists/stages";
|
||||
import { GetAllSalmonRunRotationsData } from "prisma/queries/getAllSalmonRunRotations";
|
||||
import { useState } from "react";
|
||||
import useSWR from "swr";
|
||||
import { salmonRunStages } from "utils/lists/stages";
|
||||
|
||||
export const randomToNaturalName = {
|
||||
RANDOM: t`Random`,
|
||||
|
||||
@@ -14,10 +14,10 @@ import {
|
||||
ModalOverlay,
|
||||
} from "@chakra-ui/react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { makeNameUrlFriendly } from "lib/makeNameUrlFriendly";
|
||||
import { sendData } from "lib/postData";
|
||||
import { useRouter } from "next/router";
|
||||
import { useState } from "react";
|
||||
import { makeNameUrlFriendly } from "utils/makeNameUrlFriendly";
|
||||
import { sendData } from "utils/postData";
|
||||
|
||||
const CreateNewTeamModal = () => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -4,8 +4,8 @@ import UserAvatar from "components/common/UserAvatar";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { getEmojiFlag } from "countries-list";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { Unpacked } from "lib/types";
|
||||
import { GetTeamData } from "prisma/queries/getTeam";
|
||||
import { Unpacked } from "utils/types";
|
||||
|
||||
interface Props {
|
||||
user: Unpacked<NonNullable<NonNullable<GetTeamData>["roster"]>>;
|
||||
|
||||
@@ -16,13 +16,13 @@ import {
|
||||
} from "@chakra-ui/react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import UserAvatar from "components/common/UserAvatar";
|
||||
import { getToastOptions } from "lib/getToastOptions";
|
||||
import { sendData } from "lib/postData";
|
||||
import { useRouter } from "next/router";
|
||||
import { GetTeamData } from "prisma/queries/getTeam";
|
||||
import { Fragment, useEffect, useState } from "react";
|
||||
import { FiCheck, FiTrash, FiUsers } from "react-icons/fi";
|
||||
import { mutate } from "swr";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { sendData } from "utils/postData";
|
||||
|
||||
interface Props {
|
||||
team: NonNullable<GetTeamData>;
|
||||
|
||||
@@ -21,18 +21,18 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import MarkdownTextarea from "components/common/MarkdownTextarea";
|
||||
import { getToastOptions } from "lib/getToastOptions";
|
||||
import { sendData } from "lib/postData";
|
||||
import {
|
||||
teamSchema,
|
||||
TEAM_BIO_CHARACTER_LIMIT,
|
||||
TEAM_RECRUITING_POST_CHARACTER_LIMIT,
|
||||
} from "lib/validators/team";
|
||||
import { GetTeamData } from "prisma/queries/getTeam";
|
||||
import { useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { FaTwitter } from "react-icons/fa";
|
||||
import { mutate } from "swr";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { sendData } from "utils/postData";
|
||||
import {
|
||||
teamSchema,
|
||||
TEAM_BIO_CHARACTER_LIMIT,
|
||||
TEAM_RECRUITING_POST_CHARACTER_LIMIT,
|
||||
} from "utils/validators/team";
|
||||
import * as z from "zod";
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -12,9 +12,9 @@ import {
|
||||
import UserAvatar from "components/common/UserAvatar";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { getProfilePath, getRankingString } from "lib/strings";
|
||||
import Link from "next/link";
|
||||
import { GetTop500PlacementsByMonthData } from "prisma/queries/getTop500PlacementsByMonth";
|
||||
import { getProfilePath, getRankingString } from "utils/strings";
|
||||
|
||||
interface Props {
|
||||
placements: GetTop500PlacementsByMonthData;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Box, Divider, Flex } from "@chakra-ui/react";
|
||||
import { ViewSlotsAbilities } from "components/builds/ViewSlots";
|
||||
import AbilityIcon from "components/common/AbilityIcon";
|
||||
import { abilities as allAbilities } from "lib/lists/abilities";
|
||||
import { abilities as allAbilities } from "utils/lists/abilities";
|
||||
|
||||
type ArrayElement<A> = A extends readonly (infer T)[] ? T : never;
|
||||
|
||||
|
||||
@@ -16,11 +16,11 @@ import UserAvatar from "components/common/UserAvatar";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { countries, getEmojiFlag } from "countries-list";
|
||||
import { useMyTheme, useUser } from "hooks/common";
|
||||
import { getFullUsername } from "lib/strings";
|
||||
import Image from "next/image";
|
||||
import { GetUserByIdentifierData } from "prisma/queries/getUserByIdentifier";
|
||||
import { FaGamepad, FaTwitch, FaTwitter, FaYoutube } from "react-icons/fa";
|
||||
import { FiInfo } from "react-icons/fi";
|
||||
import { getFullUsername } from "utils/strings";
|
||||
|
||||
interface AvatarWithInfoProps {
|
||||
user: NonNullable<GetUserByIdentifierData>;
|
||||
|
||||
@@ -26,20 +26,20 @@ import ViewSlots from "components/builds/ViewSlots";
|
||||
import GearSelector from "components/common/GearSelector";
|
||||
import WeaponSelector from "components/common/WeaponSelector";
|
||||
import { useUser } from "hooks/common";
|
||||
import { getToastOptions } from "lib/getToastOptions";
|
||||
import { weapons } from "lib/lists/weapons";
|
||||
import { sendData } from "lib/postData";
|
||||
import { Unpacked } from "lib/types";
|
||||
import {
|
||||
buildSchema,
|
||||
DESCRIPTION_CHARACTER_LIMIT,
|
||||
TITLE_CHARACTER_LIMIT,
|
||||
} from "lib/validators/build";
|
||||
import { GetBuildsByUserData } from "prisma/queries/getBuildsByUser";
|
||||
import { useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { FiTrash } from "react-icons/fi";
|
||||
import { mutate } from "swr";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { weapons } from "utils/lists/weapons";
|
||||
import { sendData } from "utils/postData";
|
||||
import { Unpacked } from "utils/types";
|
||||
import {
|
||||
buildSchema,
|
||||
DESCRIPTION_CHARACTER_LIMIT,
|
||||
TITLE_CHARACTER_LIMIT,
|
||||
} from "utils/validators/build";
|
||||
import * as z from "zod";
|
||||
import AbilitiesSelector from "./AbilitiesSelector";
|
||||
|
||||
|
||||
@@ -23,17 +23,17 @@ import ChakraSelect from "components/common/ChakraSelect";
|
||||
import MarkdownTextarea from "components/common/MarkdownTextarea";
|
||||
import WeaponSelector from "components/common/WeaponSelector";
|
||||
import { countries } from "countries-list";
|
||||
import { getToastOptions } from "lib/getToastOptions";
|
||||
import { sendData } from "lib/postData";
|
||||
import {
|
||||
profileSchemaFrontend,
|
||||
PROFILE_CHARACTER_LIMIT,
|
||||
} from "lib/validators/profile";
|
||||
import { GetUserByIdentifierData } from "prisma/queries/getUserByIdentifier";
|
||||
import { useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { FaGamepad, FaTwitch, FaTwitter, FaYoutube } from "react-icons/fa";
|
||||
import { mutate } from "swr";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { sendData } from "utils/postData";
|
||||
import {
|
||||
profileSchemaFrontend,
|
||||
PROFILE_CHARACTER_LIMIT,
|
||||
} from "utils/validators/profile";
|
||||
import * as z from "zod";
|
||||
|
||||
const sensOptions = [
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Ability, Mode } from "@prisma/client";
|
||||
import { abilities, isMainAbility } from "lib/lists/abilities";
|
||||
import { weaponToCode } from "lib/lists/weaponCodes";
|
||||
import { weapons } from "lib/lists/weapons";
|
||||
import { setSearchParams } from "lib/setSearchParams";
|
||||
import { useRouter } from "next/router";
|
||||
import { GetBuildsByWeaponData } from "prisma/queries/getBuildsByWeapon";
|
||||
import { Dispatch, useReducer } from "react";
|
||||
import useSWR from "swr";
|
||||
import { abilities, isMainAbility } from "utils/lists/abilities";
|
||||
import { weaponToCode } from "utils/lists/weaponCodes";
|
||||
import { weapons } from "utils/lists/weapons";
|
||||
import { setSearchParams } from "utils/setSearchParams";
|
||||
|
||||
export type BuildFilterType = "AT_LEAST" | "AT_MOST" | "HAS" | "DOES_NOT_HAVE";
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Playstyle } from "@prisma/client";
|
||||
import { useUser } from "hooks/common";
|
||||
import { setSearchParams } from "lib/setSearchParams";
|
||||
import { useRouter } from "next/router";
|
||||
import { FreeAgentLikeInfo } from "pages/api/freeagents/like";
|
||||
import { GetAllFreeAgentPostsData } from "prisma/queries/getAllFreeAgentPosts";
|
||||
import { useReducer } from "react";
|
||||
import useSWR from "swr";
|
||||
import { setSearchParams } from "utils/setSearchParams";
|
||||
|
||||
interface UseFreeAgentsState {
|
||||
playstyle?: Playstyle;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { SalmonRunRecordCategory } from "@prisma/client";
|
||||
import { salmonRunStages } from "lib/lists/stages";
|
||||
import { setSearchParams } from "lib/setSearchParams";
|
||||
import { useRouter } from "next/router";
|
||||
import { salmonRunCategoryToNatural } from "pages/sr/leaderboards/new";
|
||||
import { GetAllSalmonRunRecordsData } from "prisma/queries/getAllSalmonRunRecords";
|
||||
import { useReducer } from "react";
|
||||
import useSWR from "swr";
|
||||
import { salmonRunStages } from "utils/lists/stages";
|
||||
import { setSearchParams } from "utils/setSearchParams";
|
||||
|
||||
export type WeaponsFilter =
|
||||
| "NORMAL"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { weaponsWithHero } from "lib/lists/weaponsWithHero";
|
||||
import { GetBuildsByUserData } from "prisma/queries/getBuildsByUser";
|
||||
import { useState } from "react";
|
||||
import useSWR from "swr";
|
||||
import { weaponsWithHero } from "utils/lists/weaponsWithHero";
|
||||
|
||||
export function useBuildsByUser(userId?: number, weaponPool?: string[]) {
|
||||
const [weapon, setWeapon] = useState<string | null>(null);
|
||||
|
||||
@@ -2,10 +2,10 @@ import { t } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { Ability } from "@prisma/client";
|
||||
import { ViewSlotsAbilities } from "components/builds/ViewSlots";
|
||||
import abilityJson from "lib/data/abilityData.json";
|
||||
import weaponJson from "lib/data/weaponData.json";
|
||||
import { weapons } from "lib/lists/weapons";
|
||||
import { useEffect, useState } from "react";
|
||||
import abilityJson from "utils/data/abilityData.json";
|
||||
import weaponJson from "utils/data/weaponData.json";
|
||||
import { weapons } from "utils/lists/weapons";
|
||||
import { getEffect } from "./getAbilityEffect";
|
||||
|
||||
export interface Explanation {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useToast } from "@chakra-ui/react";
|
||||
import { getToastOptions } from "lib/getToastOptions";
|
||||
import { sendData } from "lib/postData";
|
||||
import { useState } from "react";
|
||||
import { mutate } from "swr";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { sendData } from "utils/postData";
|
||||
import { useUser } from "./common";
|
||||
|
||||
const useMutation = ({
|
||||
|
||||
@@ -3,8 +3,6 @@ import { mode } from "@chakra-ui/theme-tools";
|
||||
import { i18n } from "@lingui/core";
|
||||
import { I18nProvider } from "@lingui/react";
|
||||
import Layout from "components/layout";
|
||||
import { activateLocale } from "lib/i18n";
|
||||
import { locales } from "lib/lists/locales";
|
||||
import { Provider as NextAuthProvider } from "next-auth/client";
|
||||
import { DefaultSeo } from "next-seo";
|
||||
import type { AppProps } from "next/app";
|
||||
@@ -13,6 +11,8 @@ import { Router } from "next/router";
|
||||
import NProgress from "nprogress";
|
||||
import { useEffect } from "react";
|
||||
import { theme } from "theme";
|
||||
import { activateLocale } from "utils/i18n";
|
||||
import { locales } from "utils/lists/locales";
|
||||
import "./styles.css";
|
||||
|
||||
NProgress.configure({ showSpinner: false });
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Box, Button, Flex, Heading, Input, useToast } from "@chakra-ui/react";
|
||||
import SubText from "components/common/SubText";
|
||||
import { useUser } from "hooks/common";
|
||||
import { ADMIN_DISCORD_ID } from "lib/constants";
|
||||
import { getToastOptions } from "lib/getToastOptions";
|
||||
import { sendData } from "lib/postData";
|
||||
import { useState } from "react";
|
||||
import { ADMIN_DISCORD_ID } from "utils/constants";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { sendData } from "utils/postData";
|
||||
|
||||
const AdminPage = () => {
|
||||
const toast = useToast();
|
||||
|
||||
@@ -15,12 +15,12 @@ import WeaponSelector from "components/common/WeaponSelector";
|
||||
import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import useAbilityEffects from "hooks/useAbilityEffects";
|
||||
import { isAbilityArray } from "lib/lists/abilities";
|
||||
import { isWeapon } from "lib/lists/weapons";
|
||||
import { AbilityOrUnknown } from "lib/types";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { FiSettings } from "react-icons/fi";
|
||||
import { isAbilityArray } from "utils/lists/abilities";
|
||||
import { isWeapon } from "utils/lists/weapons";
|
||||
import { AbilityOrUnknown } from "utils/types";
|
||||
|
||||
const CURRENT_PATCH = "5.4.";
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { codeToWeapon } from "lib/lists/weaponCodes";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import {
|
||||
getBuildsByWeapon,
|
||||
GetBuildsByWeaponData,
|
||||
} from "prisma/queries/getBuildsByWeapon";
|
||||
import { codeToWeapon } from "utils/lists/weaponCodes";
|
||||
|
||||
const weaponHandler = async (
|
||||
req: NextApiRequest,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Ability } from "@prisma/client";
|
||||
import { getMySession } from "lib/api";
|
||||
import { GANBA_DISCORD_ID } from "lib/constants";
|
||||
import { getWeaponNormalized } from "lib/lists/weapons";
|
||||
import { buildSchema } from "lib/validators/build";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
import { GANBA_DISCORD_ID } from "utils/constants";
|
||||
import { getWeaponNormalized } from "utils/lists/weapons";
|
||||
import { buildSchema } from "utils/validators/build";
|
||||
|
||||
const modes = ["TW", "SZ", "TC", "RM", "CB"];
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { freeAgentPostSchema } from "lib/validators/fapost";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getAllFreeAgentPosts } from "prisma/queries/getAllFreeAgentPosts";
|
||||
import { getMySession } from "utils/api";
|
||||
import { freeAgentPostSchema } from "utils/validators/fapost";
|
||||
|
||||
const freeAgentsHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
switch (req.method) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
switch (req.method) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { profileSchemaBackend } from "lib/validators/profile";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
import { profileSchemaBackend } from "utils/validators/profile";
|
||||
|
||||
const profileHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method === "PUT") {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { detailedMapSchema } from "lib/validators/detailedMap";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { rate, Rating } from "ts-trueskill";
|
||||
import { detailedMapSchema } from "utils/validators/detailedMap";
|
||||
import * as z from "zod";
|
||||
|
||||
const matchesHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getAllLadderRegisteredTeams } from "prisma/queries/getAllLadderRegisteredTeams";
|
||||
import { getMySession } from "utils/api";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
const teamsHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { LADDER_ROSTER_LIMIT } from "lib/constants";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
import { LADDER_ROSTER_LIMIT } from "utils/constants";
|
||||
|
||||
const joinHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
switch (req.method) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
|
||||
const playLeaveHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
switch (req.method) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getWeaponNormalized } from "lib/lists/weapons";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getWeaponNormalized } from "utils/lists/weapons";
|
||||
|
||||
const connectHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method !== "POST") {
|
||||
@@ -25,12 +25,10 @@ const connectHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
return res
|
||||
.status(400)
|
||||
.json({
|
||||
message:
|
||||
"Please log-in to sendou.ink first. After logging in use the !sendoulink command.",
|
||||
});
|
||||
return res.status(400).json({
|
||||
message:
|
||||
"Please log-in to sendou.ink first. After logging in use the !sendoulink command.",
|
||||
});
|
||||
}
|
||||
|
||||
if (user.player) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import plusService from "services/plus";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { UserError } from "lib/errors";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import plusService from "services/plus";
|
||||
import { getMySession } from "utils/api";
|
||||
import { UserError } from "utils/errors";
|
||||
import { ZodError } from "zod";
|
||||
|
||||
const suggestionsHandler = async (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { UserError } from "lib/errors";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import plusService from "services/plus";
|
||||
import { getMySession } from "utils/api";
|
||||
import { UserError } from "utils/errors";
|
||||
import { ZodError } from "zod";
|
||||
|
||||
const vouchHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { SALMON_RUN_ADMIN_DISCORD_IDS } from "lib/constants";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
import { SALMON_RUN_ADMIN_DISCORD_IDS } from "utils/constants";
|
||||
|
||||
const salmonRunRecordIdHandler = async (
|
||||
req: NextApiRequest,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { SALMON_RUN_ADMIN_DISCORD_IDS } from "lib/constants";
|
||||
import { salmonRunRecordSchema } from "lib/validators/salmonRunRecord";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getAllSalmonRunRecords } from "prisma/queries/getAllSalmonRunRecords";
|
||||
import { getMySession } from "utils/api";
|
||||
import { SALMON_RUN_ADMIN_DISCORD_IDS } from "utils/constants";
|
||||
import { salmonRunRecordSchema } from "utils/validators/salmonRunRecord";
|
||||
|
||||
const getHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const user = await getMySession(req);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import { getTeam, GetTeamData } from "prisma/queries/getTeam";
|
||||
import { getMySession } from "utils/api";
|
||||
|
||||
const teamByIdHandler = async (
|
||||
req: NextApiRequest,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
const codeHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { makeNameUrlFriendly } from "lib/makeNameUrlFriendly";
|
||||
import { teamSchema } from "lib/validators/team";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
import { makeNameUrlFriendly } from "utils/makeNameUrlFriendly";
|
||||
import { teamSchema } from "utils/validators/team";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
const teamsHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { TEAM_ROSTER_LIMIT } from "lib/constants";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
import { TEAM_ROSTER_LIMIT } from "utils/constants";
|
||||
|
||||
const joinHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
switch (req.method) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
|
||||
const kickHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
switch (req.method) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
|
||||
const leaveHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
switch (req.method) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
|
||||
const ownerHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
switch (req.method) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { getMySession } from "lib/api";
|
||||
import { ADMIN_DISCORD_ID } from "lib/constants";
|
||||
import { getWeaponNormalized } from "lib/lists/weapons";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getMySession } from "utils/api";
|
||||
import { ADMIN_DISCORD_ID } from "utils/constants";
|
||||
import { getWeaponNormalized } from "utils/lists/weapons";
|
||||
|
||||
const userHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method !== "PATCH") {
|
||||
|
||||
@@ -28,8 +28,6 @@ import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import { countries, getEmojiFlag } from "countries-list";
|
||||
import { useMyTheme, useUser } from "hooks/common";
|
||||
import { useFreeAgents } from "hooks/freeagents";
|
||||
import { sendData } from "lib/postData";
|
||||
import { Unpacked } from "lib/types";
|
||||
import { useRouter } from "next/router";
|
||||
import { GetAllFreeAgentPostsData } from "prisma/queries/getAllFreeAgentPosts";
|
||||
import { RefObject, useEffect, useRef, useState } from "react";
|
||||
@@ -41,6 +39,8 @@ import {
|
||||
RiSwordLine,
|
||||
} from "react-icons/ri";
|
||||
import { mutate } from "swr";
|
||||
import { sendData } from "utils/postData";
|
||||
import { Unpacked } from "utils/types";
|
||||
|
||||
const FreeAgentsPage = () => {
|
||||
const {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { t, Trans } from "@lingui/macro";
|
||||
import MyHead from "components/common/MyHead";
|
||||
import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import links from "lib/data/links.json";
|
||||
import links from "utils/data/links.json";
|
||||
|
||||
interface Link {
|
||||
title: string;
|
||||
|
||||
@@ -25,12 +25,12 @@ import { RankedMode } from "@prisma/client";
|
||||
import ModeImage from "components/common/ModeImage";
|
||||
import SubText from "components/common/SubText";
|
||||
import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import { stages } from "lib/lists/stages";
|
||||
import { setManySearchParams } from "lib/setSearchParams";
|
||||
import { shuffleArray } from "lib/shuffleArray";
|
||||
import { useRouter } from "next/router";
|
||||
import { ChangeEvent, Fragment, useEffect, useState } from "react";
|
||||
import { FiCheck, FiFilter, FiRotateCw } from "react-icons/fi";
|
||||
import { stages } from "utils/lists/stages";
|
||||
import { setManySearchParams } from "utils/setSearchParams";
|
||||
import { shuffleArray } from "utils/shuffleArray";
|
||||
|
||||
const MapsGeneratorPage = () => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -3,10 +3,10 @@ import Emoji from "components/common/Emoji";
|
||||
import MyHead from "components/common/MyHead";
|
||||
import MyLink from "components/common/MyLink";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { abilityMarkdownCodes } from "lib/lists/abilityMarkdownCodes";
|
||||
import { gearMarkdownCodes } from "lib/lists/gearMarkdownCodes";
|
||||
import { codeToWeapon } from "lib/lists/weaponCodes";
|
||||
import { useState } from "react";
|
||||
import { abilityMarkdownCodes } from "utils/lists/abilityMarkdownCodes";
|
||||
import { gearMarkdownCodes } from "utils/lists/gearMarkdownCodes";
|
||||
import { codeToWeapon } from "utils/lists/weaponCodes";
|
||||
|
||||
const MarkdownHelpPage = () => {
|
||||
const [showWeapons, setShowWeapons] = useState(false);
|
||||
|
||||
@@ -4,7 +4,6 @@ import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import DraggableImageAdder from "components/plans/DraggableImageAdder";
|
||||
import DraggableToolsSelector from "components/plans/DraggableToolsSelector";
|
||||
import StageSelector from "components/plans/StageSelector";
|
||||
import { stages } from "lib/lists/stages";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
@@ -13,6 +12,7 @@ import {
|
||||
FaFileImage,
|
||||
FaFileUpload,
|
||||
} from "react-icons/fa";
|
||||
import { stages } from "utils/lists/stages";
|
||||
|
||||
const MapSketch = dynamic(() => import("components/plans/MapSketch"), {
|
||||
ssr: false,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Box, Center, Flex, Grid, Heading } from "@chakra-ui/react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import ModeImage from "components/common/ModeImage";
|
||||
import SubText from "components/common/SubText";
|
||||
import LadderTeam from "components/play/LadderTeam";
|
||||
@@ -7,13 +7,13 @@ import MatchUp from "components/play/MatchUp";
|
||||
import RegisterHeader from "components/play/RegisterHeader";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { useLadderTeams } from "hooks/play";
|
||||
import { getLadderRounds } from "lib/playFunctions";
|
||||
import { shuffleArray } from "lib/shuffleArray";
|
||||
import { GetStaticProps } from "next";
|
||||
import prisma from "prisma/client";
|
||||
import { getAllLadderRegisteredTeamsForMatches } from "prisma/queries/getAllLadderRegisteredTeamsForMatches";
|
||||
import { getLadderDay, GetLadderDayData } from "prisma/queries/getLadderDay";
|
||||
import { Fragment } from "react";
|
||||
import { getLadderRounds } from "utils/playFunctions";
|
||||
import { shuffleArray } from "utils/shuffleArray";
|
||||
|
||||
interface Props {
|
||||
ladderDay: GetLadderDayData;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { t } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { useLadderTeams } from "hooks/play";
|
||||
import { sendData } from "lib/postData";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { sendData } from "utils/postData";
|
||||
|
||||
const statusMessage = {
|
||||
LOADING: t`Please wait...`,
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Box, HStack, Radio, RadioGroup } from "@chakra-ui/react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import MyLink from "components/common/MyLink";
|
||||
import QuadTable from "components/player/QuadTable";
|
||||
import TwinTable from "components/player/TwinTable";
|
||||
import XRankTable from "components/player/XRankTable";
|
||||
import { setSearchParams } from "lib/setSearchParams";
|
||||
import { GetStaticPaths, GetStaticProps } from "next";
|
||||
import { useRouter } from "next/router";
|
||||
import {
|
||||
@@ -12,6 +11,7 @@ import {
|
||||
GetPlayerWithPlacementsData,
|
||||
} from "prisma/queries/getPlayerWithPlacements";
|
||||
import { useState } from "react";
|
||||
import { setSearchParams } from "utils/setSearchParams";
|
||||
|
||||
interface Props {
|
||||
player: GetPlayerWithPlacementsData;
|
||||
|
||||
@@ -10,12 +10,12 @@ import {
|
||||
} from "components/common/Table";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { useUser } from "hooks/common";
|
||||
import { SALMON_RUN_ADMIN_DISCORD_IDS } from "lib/constants";
|
||||
import { sendData } from "lib/postData";
|
||||
import { useRouter } from "next/router";
|
||||
import { GetAllSalmonRunRecordsData } from "prisma/queries/getAllSalmonRunRecords";
|
||||
import { useState } from "react";
|
||||
import useSWR, { mutate } from "swr";
|
||||
import { SALMON_RUN_ADMIN_DISCORD_IDS } from "utils/constants";
|
||||
import { sendData } from "utils/postData";
|
||||
import { salmonRunCategoryToNatural } from "./new";
|
||||
|
||||
const SalmonRunAdminPage = ({}) => {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
Select,
|
||||
Stack,
|
||||
} from "@chakra-ui/react";
|
||||
import { Plural, t, Trans } from "@lingui/macro";
|
||||
import { Plural, Trans } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { SalmonRunRecordCategory } from "@prisma/client";
|
||||
import LinkButton from "components/common/LinkButton";
|
||||
@@ -28,10 +28,10 @@ import UserAvatar from "components/common/UserAvatar";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import { useSalmonRunRecords, WeaponsFilter } from "hooks/sr";
|
||||
import { salmonRunStages } from "lib/lists/stages";
|
||||
import { getRankingString } from "lib/strings";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { salmonRunStages } from "utils/lists/stages";
|
||||
import { getRankingString } from "utils/strings";
|
||||
import { salmonRunCategoryToNatural } from "./new";
|
||||
|
||||
const SalmonRunLeaderboardsPage = ({}) => {
|
||||
|
||||
@@ -20,13 +20,13 @@ import UserSelector from "components/common/UserSelector";
|
||||
import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import RotationSelector from "components/sr/RotationSelector";
|
||||
import { useUser } from "hooks/common";
|
||||
import { sendData } from "lib/postData";
|
||||
import { salmonRunRecordSchema } from "lib/validators/salmonRunRecord";
|
||||
import Image from "next/image";
|
||||
import { useRouter } from "next/router";
|
||||
import { useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { mutate } from "swr";
|
||||
import { sendData } from "utils/postData";
|
||||
import { salmonRunRecordSchema } from "utils/validators/salmonRunRecord";
|
||||
import * as z from "zod";
|
||||
|
||||
export const salmonRunCategoryToNatural = {
|
||||
|
||||
@@ -6,7 +6,6 @@ import SubText from "components/common/SubText";
|
||||
import UserAvatar from "components/common/UserAvatar";
|
||||
import WeaponImage from "components/common/WeaponImage";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { salmonRunStages } from "lib/lists/stages";
|
||||
import { GetStaticPaths, GetStaticProps } from "next";
|
||||
import Image from "next/image";
|
||||
import { salmonRunCategoryToNatural } from "pages/sr/leaderboards/new";
|
||||
@@ -14,6 +13,7 @@ import {
|
||||
getUsersSalmonRunRecords,
|
||||
GetUsersSalmonRunRecordsData,
|
||||
} from "prisma/queries/getUsersSalmonRunRecords";
|
||||
import { salmonRunStages } from "utils/lists/stages";
|
||||
|
||||
interface Props {
|
||||
user: GetUsersSalmonRunRecordsData;
|
||||
|
||||
@@ -25,8 +25,6 @@ import RosterPlayerBar from "components/t/RosterPlayerBar";
|
||||
import TeamManagementModal from "components/t/TeamManagementModal";
|
||||
import TeamProfileModal from "components/t/TeamProfileModal";
|
||||
import { useMyTheme, useUser } from "hooks/common";
|
||||
import { getToastOptions } from "lib/getToastOptions";
|
||||
import { sendData } from "lib/postData";
|
||||
import { GetStaticPaths, GetStaticProps } from "next";
|
||||
import Image from "next/image";
|
||||
import { getTeam, GetTeamData } from "prisma/queries/getTeam";
|
||||
@@ -34,6 +32,8 @@ import { Fragment, useEffect, useState } from "react";
|
||||
import { FaTwitter } from "react-icons/fa";
|
||||
import { FiEdit } from "react-icons/fi";
|
||||
import useSWR, { mutate } from "swr";
|
||||
import { getToastOptions } from "utils/getToastOptions";
|
||||
import { sendData } from "utils/postData";
|
||||
|
||||
interface Props {
|
||||
team: GetTeamData;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { t } from "@lingui/macro";
|
||||
import { useLingui } from "@lingui/react";
|
||||
import { sendData } from "lib/postData";
|
||||
import { useRouter } from "next/router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { sendData } from "utils/postData";
|
||||
|
||||
const statusMessage = {
|
||||
LOADING: t`Please wait...`,
|
||||
|
||||
@@ -11,7 +11,6 @@ import BuildModal from "components/u/BuildModal";
|
||||
import ProfileModal from "components/u/ProfileModal";
|
||||
import { useUser } from "hooks/common";
|
||||
import { useBuildsByUser } from "hooks/u";
|
||||
import { GANBA_DISCORD_ID } from "lib/constants";
|
||||
import { GetStaticPaths, GetStaticProps } from "next";
|
||||
import { useRouter } from "next/router";
|
||||
import { getPlayersPeak } from "prisma/queries/getPlayersPeak";
|
||||
@@ -23,6 +22,7 @@ import { useEffect, useState } from "react";
|
||||
import { FiEdit } from "react-icons/fi";
|
||||
import { RiTShirtLine } from "react-icons/ri";
|
||||
import useSWR from "swr";
|
||||
import { GANBA_DISCORD_ID } from "utils/constants";
|
||||
|
||||
interface Props {
|
||||
user: GetUserByIdentifierData;
|
||||
|
||||
@@ -5,14 +5,11 @@ import {
|
||||
InputGroup,
|
||||
InputLeftElement,
|
||||
} from "@chakra-ui/react";
|
||||
import { t } from "@lingui/macro";
|
||||
import MyLink from "components/common/MyLink";
|
||||
import UserAvatar from "components/common/UserAvatar";
|
||||
import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import { getEmojiFlag } from "countries-list";
|
||||
import { useDebounce, useMyTheme } from "hooks/common";
|
||||
import { setSearchParams } from "lib/setSearchParams";
|
||||
import { Unpacked } from "lib/types";
|
||||
import { GetStaticProps } from "next";
|
||||
import Head from "next/head";
|
||||
import Link from "next/link";
|
||||
@@ -21,6 +18,8 @@ import { getAllUsers, GetAllUsersData } from "prisma/queries/getAllUsers";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { FaTwitter } from "react-icons/fa";
|
||||
import { FiSearch } from "react-icons/fi";
|
||||
import { setSearchParams } from "utils/setSearchParams";
|
||||
import { Unpacked } from "utils/types";
|
||||
|
||||
interface Props {
|
||||
users: GetAllUsersData;
|
||||
|
||||
@@ -3,7 +3,6 @@ import { t } from "@lingui/macro";
|
||||
import { RankedMode } from "@prisma/client";
|
||||
import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import Top500Table from "components/top500/Top500Table";
|
||||
import { getLocalizedMonthYearString } from "lib/strings";
|
||||
import { GetStaticPaths, GetStaticProps } from "next";
|
||||
import { useRouter } from "next/router";
|
||||
import prisma from "prisma/client";
|
||||
@@ -12,6 +11,7 @@ import {
|
||||
GetTop500PlacementsByMonthData,
|
||||
} from "prisma/queries/getTop500PlacementsByMonth";
|
||||
import { useEffect, useState } from "react";
|
||||
import { getLocalizedMonthYearString } from "utils/strings";
|
||||
|
||||
interface Props {
|
||||
placements: GetTop500PlacementsByMonthData;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Prisma } from "@prisma/client";
|
||||
import { UserError } from "lib/errors";
|
||||
import { getPercentageFromCounts, getVotingRange } from "lib/plus";
|
||||
import { userBasicSelection } from "lib/prisma";
|
||||
import { suggestionFullSchema } from "lib/validators/suggestion";
|
||||
import { vouchSchema } from "lib/validators/vouch";
|
||||
import prisma from "prisma/client";
|
||||
import { UserError } from "utils/errors";
|
||||
import { getPercentageFromCounts, getVotingRange } from "utils/plus";
|
||||
import { userBasicSelection } from "utils/prisma";
|
||||
import { suggestionFullSchema } from "utils/validators/suggestion";
|
||||
import { vouchSchema } from "utils/validators/vouch";
|
||||
|
||||
export type PlusStatuses = Prisma.PromiseReturnType<typeof getPlusStatuses>;
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 1019 B After Width: | Height: | Size: 1019 B |