Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplified ApplicationFlow's searcParam to only have prefaceAccepted #551

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)/mentor/Mentor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default async function Mentor({
}) {
return (
<ApplicationFlow
searchParams={searchParams}
prefaceAccepted={searchParams.prefaceAccepted}
applicationType="Mentor"
applicationURL="/mentor"
>
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
Loading