Skip to content

Commit

Permalink
simplified ApplicationFlow's searcParam to only have prefaceAccepted
Browse files Browse the repository at this point in the history
  • Loading branch information
cyriljoby committed Jan 13, 2025
1 parent b799457 commit 15b9cb8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/site/src/app/(main)/apply/Hacker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function Hacker({
}) {
return (
<ApplicationFlow
searchParams={searchParams}
prefaceAccepted={searchParams.prefaceAccepted}
applicationType="Hacker"
applicationURL="/apply"
>
Expand Down
2 changes: 1 addition & 1 deletion apps/site/src/app/(main)/volunteer/Volunteer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function Volunteer({
}) {
return (
<ApplicationFlow
searchParams={searchParams}
prefaceAccepted={searchParams.prefaceAccepted}
applicationType="Volunteer"
applicationURL="/volunteer"
>
Expand Down
8 changes: 3 additions & 5 deletions apps/site/src/lib/components/forms/shared/ApplicationFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ import getUserIdentity from "@/lib/utils/getUserIdentity";
export const revalidate = 60;

interface ApplicationFlowProps {
searchParams: {
prefaceAccepted?: string;
};
prefaceAccepted?: string;
applicationType: "Hacker" | "Mentor" | "Volunteer";
applicationURL: "/apply" | "/mentor" | "/volunteer";
}

export default async function ApplicationFlow({
searchParams,
prefaceAccepted,
applicationType,
applicationURL,
children,
}: ApplicationFlowProps & PropsWithChildren) {
const hasAcceptedQueryParam = searchParams.prefaceAccepted === "true";
const hasAcceptedQueryParam = prefaceAccepted === "true";
const identity = await getUserIdentity();

if (identity.status !== null) {
Expand Down

0 comments on commit 15b9cb8

Please sign in to comment.