Skip to content

Commit 2aed159

Browse files
nbudinclaude
andcommitted
Fix SignupAdmin route component TypeScript 6 errors
Remove required teamMembersUrl prop from EditSignup and derive the URL internally from useParams, allowing the component to be used as a route Component (which requires ComponentType<{}>) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fad4dbd commit 2aed159

File tree

1 file changed

+4
-6
lines changed
  • app/javascript/EventsApp/SignupAdmin/$id

1 file changed

+4
-6
lines changed

app/javascript/EventsApp/SignupAdmin/$id/route.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useCallback, useContext } from 'react';
22
import classNames from 'classnames';
3-
import { ActionFunction, data, Link, Outlet, useSubmit, RouterContextProvider } from 'react-router';
3+
import { ActionFunction, data, Link, Outlet, useParams, useSubmit, RouterContextProvider } from 'react-router';
44
import { Trans, useTranslation } from 'react-i18next';
55
import { TFunction } from 'i18next';
66
import { DateTime } from 'luxon';
@@ -90,10 +90,6 @@ function getToggleCountedConfirmPrompt(signup: SignupFieldsFragment) {
9090
return getMakeCountedConfirmPrompt(signup);
9191
}
9292

93-
export type EditSignupProps = {
94-
teamMembersUrl: string;
95-
};
96-
9793
export const action: ActionFunction<RouterContextProvider> = async ({ context, request, params: { id } }) => {
9894
const client = context.get(apolloClientContext);
9995
const formData = await request.formData();
@@ -107,8 +103,10 @@ export const action: ActionFunction<RouterContextProvider> = async ({ context, r
107103
return data(result.data);
108104
};
109105

110-
function EditSignup({ teamMembersUrl }: EditSignupProps): React.JSX.Element {
106+
function EditSignup(): React.JSX.Element {
111107
const data = useSingleSignupLoader();
108+
const { eventId } = useParams();
109+
const teamMembersUrl = `/events/${eventId}/team_members`;
112110
const { timezoneName, ticketName } = useContext(AppRootContext);
113111
const confirm = useConfirm();
114112
const { t } = useTranslation();

0 commit comments

Comments
 (0)