♻️ Move paddle script

This commit is contained in:
Luke Vella 2023-11-03 20:38:57 +00:00
parent 30f57948e2
commit 1d79f117b3
2 changed files with 14 additions and 14 deletions

View file

@ -8,7 +8,6 @@ import { NextPage } from "next";
import { AppProps } from "next/app";
import { Inter } from "next/font/google";
import Head from "next/head";
import Script from "next/script";
import { SessionProvider, signIn, useSession } from "next-auth/react";
import { appWithTranslation } from "next-i18next";
import { DefaultSeo } from "next-seo";
@ -85,19 +84,6 @@ const MyApp: NextPage<AppPropsWithLayout> = ({ Component, pageProps }) => {
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=5, user-scalable=yes"
/>
</Head>
{process.env.NEXT_PUBLIC_PADDLE_VENDOR_ID ? (
<Script
src="https://cdn.paddle.com/paddle/paddle.js"
onLoad={() => {
if (process.env.NEXT_PUBLIC_PADDLE_SANDBOX === "true") {
window.Paddle.Environment.set("sandbox");
}
window.Paddle.Setup({
vendor: Number(process.env.NEXT_PUBLIC_PADDLE_VENDOR_ID),
});
}}
/>
) : null}
<style jsx global>{`
html {
--font-inter: ${inter.style.fontFamily};

View file

@ -6,6 +6,7 @@ import dayjs from "dayjs";
import { GetStaticProps } from "next";
import Head from "next/head";
import Link from "next/link";
import Script from "next/script";
import { useTranslation } from "next-i18next";
import { BillingPlans } from "@/components/billing/billing-plans";
@ -106,6 +107,19 @@ const LegacyBilling = () => {
return (
<Card>
{process.env.NEXT_PUBLIC_PADDLE_VENDOR_ID ? (
<Script
src="https://cdn.paddle.com/paddle/paddle.js"
onLoad={() => {
if (process.env.NEXT_PUBLIC_PADDLE_SANDBOX === "true") {
window.Paddle.Environment.set("sandbox");
}
window.Paddle.Setup({
vendor: Number(process.env.NEXT_PUBLIC_PADDLE_VENDOR_ID),
});
}}
/>
) : null}
<div className="grid gap-4 p-4 sm:grid-cols-2">
<div>
<Label>