Update package versions and optimize URL generation

Updated the versions of several packages including pino and pnpm. Also, the generation of URLs in the pricing-table.tsx file has been optimized by implementing URLSearchParams. A new global error page was also added.
This commit is contained in:
giancarlo
2024-05-13 21:47:51 +07:00
parent a75009c0df
commit 9d30039ba8
6 changed files with 100 additions and 34 deletions

View File

@@ -426,20 +426,18 @@ function DefaultCheckoutButton(
highlighted?: boolean;
}>,
) {
const redirectToCheckoutParam = props.redirectToCheckout
? '?redirectToCheckout=true'
: '';
const { t } = useTranslation('billing');
const planId = props.plan.id;
const signUpPath = props.paths.signUp;
const subscriptionPath = props.paths.subscription;
const searchParams = new URLSearchParams({
next: props.paths.subscription,
plan: props.plan.id,
redirectToCheckout: props.redirectToCheckout ? 'true' : 'false',
});
const linkHref =
props.plan.href ??
`${signUpPath}?plan=${planId}&next=${subscriptionPath}?plan=${planId}${redirectToCheckoutParam}` ??
'';
props.plan.href ?? `${signUpPath}?${searchParams.toString()}` ?? '';
const label = props.plan.buttonLabel ?? 'common:getStartedWithPlan';