diff --git a/src/hooks/usePayments.jsx b/src/hooks/usePayments.jsx new file mode 100644 index 00000000..42ce6558 --- /dev/null +++ b/src/hooks/usePayments.jsx @@ -0,0 +1,37 @@ +import { useMutation, useQueryClient } from "@tanstack/react-query"; +import { PaymentRepository } from "../repositories/PaymentRepository"; + +export const useMakePayment = (onSuccessCallBack) => { + const client = useQueryClient(); + return useMutation({ + mutationFn: (payload) => PaymentRepository.makePayment(payload), + onSuccess: (_, varibales) => { + if (onSuccessCallBack) onSuccessCallBack(); + }, + onError: (error) => { + showToast( + error.message || + error.response.message || + "Something went wrong.Please try again later.", + "error" + ); + }, + }); +}; +export const useVerifyPayment = () => { + const client = useQueryClient(); + return useMutation({ + mutationFn: (payload) => PaymentRepository.verifyPayment(payload), + onSuccess: (_, varibales) => { + if (onSuccessCallBack) onSuccessCallBack(); + }, + onError: (error) => { + showToast( + error.message || + error.response.message || + "Something went wrong.Please try again later.", + "error" + ); + }, + }); +}; diff --git a/src/pages/Home/SubscriptionSummary.jsx b/src/pages/Home/SubscriptionSummary.jsx new file mode 100644 index 00000000..733ec81a --- /dev/null +++ b/src/pages/Home/SubscriptionSummary.jsx @@ -0,0 +1,117 @@ +import React from "react"; + +const SubscriptionSummary = () => { + const options = [ + { + id: 1, + title: "Design", + description: "Cake sugar plum fruitcake I love sweet roll jelly-o.", + svg: ( + + ), + }, + { + id: 2, + title: "Development", + description: "Cake sugar plum fruitcake I love sweet roll jelly-o.", + svg: ( + + ), + }, + { + id: 3, + title: "Native App", + description: "Cake sugar plum fruitcake I love sweet roll jelly-o.", + svg: ( + + ), + }, + ]; + + return ( +
Summary
+