From 8b0a6f0d90dd3976e1f9bf4d9fd80a78672b3d2d Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 3 Mar 2026 20:26:23 +0200 Subject: [PATCH] Add sub post (after tournament start) as SendouForm --- .../actions/to.$id.looking.server.ts | 2 +- .../routes/to.$id.looking.module.css | 5 -- .../tournament-lfg/routes/to.$id.looking.tsx | 58 +++++++------------ .../tournament-lfg-constants.ts | 3 - .../tournament-lfg/tournament-lfg-schemas.ts | 25 ++++---- 5 files changed, 35 insertions(+), 58 deletions(-) delete mode 100644 app/features/tournament-lfg/tournament-lfg-constants.ts diff --git a/app/features/tournament-lfg/actions/to.$id.looking.server.ts b/app/features/tournament-lfg/actions/to.$id.looking.server.ts index c256e5277..aa4c8984b 100644 --- a/app/features/tournament-lfg/actions/to.$id.looking.server.ts +++ b/app/features/tournament-lfg/actions/to.$id.looking.server.ts @@ -221,7 +221,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => { tournamentId, userId: user.id, isStayAsSub: true, - lfgNote: data.message, + lfgNote: data.message ?? undefined, }); break; diff --git a/app/features/tournament-lfg/routes/to.$id.looking.module.css b/app/features/tournament-lfg/routes/to.$id.looking.module.css index 4b4d7fb0b..0186ad42b 100644 --- a/app/features/tournament-lfg/routes/to.$id.looking.module.css +++ b/app/features/tournament-lfg/routes/to.$id.looking.module.css @@ -43,11 +43,6 @@ margin-inline: auto; } -.subsTextarea { - width: 100%; - resize: vertical; -} - .subsSection { display: grid; grid-template-columns: max-content 1fr; diff --git a/app/features/tournament-lfg/routes/to.$id.looking.tsx b/app/features/tournament-lfg/routes/to.$id.looking.tsx index 8cb980462..bd352939b 100644 --- a/app/features/tournament-lfg/routes/to.$id.looking.tsx +++ b/app/features/tournament-lfg/routes/to.$id.looking.tsx @@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next"; import { Link, useFetcher, useLoaderData } from "react-router"; import { Avatar } from "~/components/Avatar"; import { SendouButton } from "~/components/elements/Button"; +import { SendouDialog } from "~/components/elements/Dialog"; import { SendouTab, SendouTabList, @@ -30,8 +31,10 @@ import { loader, type SubEntry, } from "../loaders/to.$id.looking.server"; -import { TOURNAMENT_LFG } from "../tournament-lfg-constants"; -import { joinQueueFormSchema } from "../tournament-lfg-schemas"; +import { + addSubFormSchema, + joinQueueFormSchema, +} from "../tournament-lfg-schemas"; export { action } from "../actions/to.$id.looking.server"; export { loader }; @@ -255,44 +258,25 @@ function SubsView({ ); } -// xxx: use SendouForm function AddSubForm() { - const { t } = useTranslation(["tournament", "common"]); - const fetcher = useFetcher(); - const [showForm, setShowForm] = React.useState(false); - - if (!showForm) { - return ( -
- setShowForm(true)}> - {t("tournament:subs.addPost")} - -
- ); - } + const { t } = useTranslation(["tournament"]); return ( - -