Started working with PayPal

This commit is contained in:
Tiago Ribeiro
2023-11-24 16:02:55 +00:00
parent 23f2bace5d
commit c312260721
5 changed files with 48 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ import {useRouter} from "next/router";
import {useEffect} from "react";
import useExamStore from "@/stores/examStore";
import usePreferencesStore from "@/stores/preferencesStore";
import {PayPalScriptProvider} from "@paypal/react-paypal-js";
export default function App({Component, pageProps}: AppProps) {
const reset = useExamStore((state) => state.reset);
@@ -31,5 +32,10 @@ export default function App({Component, pageProps}: AppProps) {
}
}, [setIsSidebarMinimized]);
return <Component {...pageProps} />;
return (
<PayPalScriptProvider
options={{clientId: process.env.NEXT_PUBLIC_PAYPAL_CLIENT_ID || "", currency: "EUR", intent: "order", commit: true, vault: true}}>
<Component {...pageProps} />
</PayPalScriptProvider>
);
}

View File

@@ -169,7 +169,7 @@ export default function Home() {
{user.type === "corporate" && <CorporateDashboard user={user} />}
{user.type === "agent" && <AgentDashboard user={user} />}
{user.type === "admin" && <AdminDashboard user={user} />}
{user.type === "developer" && <AdminDashboard user={user} />}
{user.type === "developer" && <StudentDashboard user={user} />}
</Layout>
)}
</>