Added packages for students to be able to purchase

This commit is contained in:
Tiago Ribeiro
2023-11-26 10:08:57 +00:00
parent c312260721
commit 7e91a989b3
16 changed files with 552 additions and 35 deletions

View File

@@ -1,5 +1,6 @@
import Button from "@/components/Low/Button";
import ProgressBar from "@/components/Low/ProgressBar";
import PayPalPayment from "@/components/PayPalPayment";
import ProfileSummary from "@/components/ProfileSummary";
import useAssignments from "@/hooks/useAssignments";
import useStats from "@/hooks/useStats";
@@ -9,13 +10,16 @@ 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 {CreateOrderActions, CreateOrderData, OnApproveActions, OnApproveData, OrderResponseBody} from "@paypal/paypal-js";
import {PayPalButtons} from "@paypal/react-paypal-js";
import axios from "axios";
import clsx from "clsx";
import {capitalize} from "lodash";
import moment from "moment";
import Link from "next/link";
import {useRouter} from "next/router";
import {BsArrowRepeat, BsBook, BsClipboard, BsFileEarmarkText, BsHeadphones, BsMegaphone, BsPen, BsPencil, BsStar} from "react-icons/bs";
import {toast} from "react-toastify";
interface Props {
user: User;
@@ -84,11 +88,6 @@ 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