Started working with PayPal
This commit is contained in:
@@ -9,6 +9,7 @@ import useExamStore from "@/stores/examStore";
|
||||
import {getExamById} from "@/utils/exams";
|
||||
import {MODULE_ARRAY, sortByModule, sortByModuleName} from "@/utils/moduleUtils";
|
||||
import {averageScore, groupBySession} from "@/utils/stats";
|
||||
import {PayPalButtons} from "@paypal/react-paypal-js";
|
||||
import clsx from "clsx";
|
||||
import {capitalize} from "lodash";
|
||||
import moment from "moment";
|
||||
@@ -83,6 +84,11 @@ export default function StudentDashboard({user}: Props) {
|
||||
</span>
|
||||
</section>
|
||||
|
||||
<section className="flex flex-col gap-1 md:gap-3">
|
||||
<span className="font-bold text-lg">Payment</span>
|
||||
<PayPalButtons style={{layout: "vertical"}} fundingSource={undefined}></PayPalButtons>
|
||||
</section>
|
||||
|
||||
<section className="flex flex-col gap-1 md:gap-3">
|
||||
<div className="flex gap-4 items-center">
|
||||
<div
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user