Perf improvements and billing updates

This commit is contained in:
giancarlo
2024-03-26 16:49:11 +08:00
parent 8626ea30c7
commit 4032aed827
39 changed files with 1261 additions and 1090 deletions

View File

@@ -1,3 +1,5 @@
import { GlobalLoader } from '@kit/ui/global-loader';
export default GlobalLoader;
import { withI18n } from '~/lib/i18n/with-i18n';
export default withI18n(GlobalLoader);

View File

@@ -26,6 +26,7 @@ export function TeamAccountCheckoutForm(params: { accountId: string }) {
if (checkoutToken) {
return (
<EmbeddedCheckout
load
checkoutToken={checkoutToken}
provider={billingConfig.provider}
/>

View File

@@ -16,11 +16,18 @@ interface SessionPageProps {
};
}
const LazyEmbeddedCheckout = dynamic(async () => {
const { EmbeddedCheckout } = await import('@kit/billing-gateway/components');
const LazyEmbeddedCheckout = dynamic(
async () => {
const { EmbeddedCheckout } = await import(
'@kit/billing-gateway/components'
);
return EmbeddedCheckout;
});
return EmbeddedCheckout;
},
{
ssr: false,
},
);
async function ReturnStripeSessionPage({ searchParams }: SessionPageProps) {
const { customerEmail, checkoutToken } = await loadCheckoutSession(

View File

@@ -1,3 +1,5 @@
import { GlobalLoader } from '@kit/ui/global-loader';
export default GlobalLoader;
import { withI18n } from '~/lib/i18n/with-i18n';
export default withI18n(GlobalLoader);

View File

@@ -1,3 +1,5 @@
import { GlobalLoader } from '@kit/ui/global-loader';
export default GlobalLoader;
import { withI18n } from '~/lib/i18n/with-i18n';
export default withI18n(GlobalLoader);