Plus suggestion redirect to tab with new user

This commit is contained in:
Kalle
2022-07-26 20:38:56 +03:00
parent 5f89b234a3
commit 118d89496a
2 changed files with 6 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ import {
playerAlreadyMember,
playerAlreadySuggested,
} from "~/permissions";
import { PLUS_SUGGESTIONS_PAGE } from "~/utils/urls";
import { plusSuggestionPage, PLUS_SUGGESTIONS_PAGE } from "~/utils/urls";
import type { PlusSuggestionsLoaderData } from "../suggestions";
import * as React from "react";
import { Label } from "~/components/Label";
@@ -80,7 +80,7 @@ export const action: ActionFunction = async ({ request }) => {
...nextNonCompletedVoting(new Date()),
});
return redirect(PLUS_SUGGESTIONS_PAGE);
return redirect(plusSuggestionPage(data.tier));
};
export default function PlusNewSuggestionModalPage() {

View File

@@ -12,6 +12,8 @@ export const LEAN_TWITTER = "https://twitter.com/LeanYoshi";
export const UBERU_TWITTER = "https://twitter.com/uberu5";
export const LOG_IN_URL = "/auth";
export const LOG_OUT_URL = "/auth/logout";
// xxx: remove?
export const PLUS_SUGGESTIONS_PAGE = "/plus/suggestions";
export const ADMIN_PAGE = "/admin";
export const FAQ_PAGE = "/faq";
@@ -23,6 +25,8 @@ export const userPage = (discordId: string) => `/u/${discordId}`;
export const impersonateUrl = (idToLogInAs: number) =>
`/auth/impersonate?id=${idToLogInAs}`;
export const badgePage = (badgeId: number) => `${BADGES_PAGE}/${badgeId}`;
export const plusSuggestionPage = (tier: string | number) =>
`/plus/suggestions${tier ? `?tier=${tier}` : ""}`;
export const badgeUrl = ({
code,