Switch common hooks from /utils to /hooks

This commit is contained in:
Kalle (Sendou) 2022-01-16 22:03:53 +02:00
parent c8377f5a98
commit d530e9383c
15 changed files with 14 additions and 14 deletions

View File

@ -1,7 +1,7 @@
import { useCatch, useLocation } from "remix";
import { DISCORD_URL } from "~/constants";
import { getLogInUrl } from "~/utils";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
import { Button } from "./Button";
// TODO: some nice art

View File

@ -1,6 +1,6 @@
import { useLocation } from "remix";
import { getLogInUrl } from "~/utils";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
import { DiscordIcon } from "../icons/Discord";
export function UserItem() {

View File

@ -1,6 +1,6 @@
import { useEffect } from "react";
import { useActionData, useTransition } from "remix";
import { useTimeoutState } from "~/utils/hooks";
import { useTimeoutState } from "~/hooks/common";
import { Button, ButtonProps } from "./Button";
export function SubmitButton(

View File

@ -3,7 +3,7 @@ import invariant from "tiny-invariant";
import { matchIsOver } from "~/core/tournament/utils";
import type { BracketModified } from "~/services/bracket";
import type { FindTournamentByNameForUrlI } from "~/services/tournament";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
import { ActionSectionWrapper } from "./ActionSectionWrapper";
import { DuringMatchActions } from "./DuringMatchActions";

View File

@ -7,7 +7,7 @@ import {
} from "~/constants";
import { TournamentAction } from "~/routes/to/$organization.$tournament";
import type { FindTournamentByNameForUrlI } from "~/services/tournament";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
import { Button } from "../Button";
import { AlertIcon } from "../icons/Alert";
import { CheckInIcon } from "../icons/CheckIn";

View File

@ -5,7 +5,7 @@ import { resolveTournamentFormatString } from "~/core/tournament/bracket";
import { tournamentHasStarted } from "~/core/tournament/utils";
import { FindTournamentByNameForUrlI } from "~/services/tournament";
import { getLogInUrl } from "~/utils";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
export function InfoBanner() {
const data = useLoaderData<FindTournamentByNameForUrlI>();

View File

@ -1,5 +1,5 @@
import { Form, useTransition } from "remix";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
import { Button } from "../Button";
export function TeamRoster({

View File

@ -3,7 +3,7 @@ import { useLoaderData } from "remix";
import type { BracketData } from "server/events";
import type { BracketModified } from "~/services/bracket";
import { Unpacked } from "~/utils";
import { useEvents } from "~/utils/hooks";
import { useEvents } from "~/hooks/common";
export function useBracketDataWithEvents(): BracketModified {
const data = useLoaderData<BracketModified>();

View File

@ -23,7 +23,7 @@ import {
} from "~/services/tournament";
import { makeTitle, requireUser } from "~/utils";
import type { MyCSSProperties } from "~/utils";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
import tournamentStylesUrl from "../../styles/tournament.css";
import * as React from "react";

View File

@ -16,7 +16,7 @@ import {
requireUser,
safeJSONParse,
} from "~/utils";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
export const links: LinksFunction = () => {
return [{ rel: "stylesheet", href: styles }];

View File

@ -35,7 +35,7 @@ import {
import { getTrustingUsers } from "~/services/user";
import styles from "~/styles/tournament-manage-roster.css";
import { parseRequestFormData, requireUser } from "~/utils";
import { useBaseURL, useTimeoutState } from "~/utils/hooks";
import { useBaseURL, useTimeoutState } from "~/hooks/common";
export const links: LinksFunction = () => {
return [{ rel: "stylesheet", href: styles }];

View File

@ -18,7 +18,7 @@ import {
FindTournamentByNameForUrlI,
} from "~/services/tournament";
import styles from "~/styles/tournament-register.css";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
import { requireUser } from "~/utils";
import { Catcher } from "~/components/Catcher";
import {

View File

@ -39,7 +39,7 @@ import {
safeJSONParse,
Unpacked,
} from "~/utils";
import { useTimeoutState } from "~/utils/hooks";
import { useTimeoutState } from "~/hooks/common";
const seedsActionSchema = z.object({
tournamentId: z.string().uuid(),

View File

@ -1,7 +1,7 @@
import { useMatches } from "remix";
import type { FindTournamentByNameForUrlI } from "~/services/tournament";
import { TeamRoster } from "~/components/tournament/TeamRoster";
import { useUser } from "~/utils/hooks";
import { useUser } from "~/hooks/common";
export default function TeamsTab() {
const [, parentRoute] = useMatches();