Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Apply-For-Me-UI/src/components/spinner/Spinner.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/* eslint-disable no-unused-vars */
import React from "react";
import { useState } from "react";
import PacmanLoader from "react-spinners/PacmanLoader";
import ScaleLoader from "react-spinners/ScaleLoader";
import classes from "./Spinner.module.css";
const Spinner = () => {
let [color] = useState("#2E3192");

return (
<div className={classes.spinner_container}>
<PacmanLoader
<ScaleLoader
color={color}
size={50}
size={100}
aria-label="Loading Spinner"
data-testid="loader"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const Table = () => {
setPageCout(response.data?.totalPages);
} catch (error) {
toast.error(`${error}`);
console.log("thisis", JSON.stringify(error.response))
}
}, [token, pagination.pageNo, pagination.pageSize]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Table = () => {
}
);
setData(response.data?.content);
console.log(response.data?.content);
setPageCout(response.data?.totalPages);
setIsLoading(false);

Expand Down Expand Up @@ -100,13 +101,15 @@ const Table = () => {
<div className="table_wrap">
<div className="div_table">
<div className="div_table_child">Name</div>
<div className="div_table_child">Job Title</div>
<div className="div_table_child_hideOnMobile">Salary</div>
<div className="div_table_child">Type</div>
<div className="div_table_child">Details</div>
</div>
{data?.map((application, index) => {
return(
<div className="div_table" key={index}>
<div className="div_table_child">{application.professional.member.firstName}</div>
<div className="div_table_child">{application.profileTitle}</div>
<div className="div_table_child_hideOnMobile">{application.salaryRange}</div>
<div className="div_table_child">{application.preferredJobLocationType}</div>
Expand Down
23 changes: 0 additions & 23 deletions Apply-For-Me-UI/src/pages/paystack/paystack.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import jwt_decode from "jwt-decode";
import { useParams } from "react-router-dom";
import Spinner from "components/spinner/PulseLoader";
import { useState } from "react";
// import { useCallback } from "react";
import axios from "axios";
import { toast, ToastContainer } from "react-toastify";

Expand All @@ -13,26 +12,7 @@ export const PaystackPage = () => {
const { price, planName, paymentInterval } = useParams();
const channels = ["card", "bank"];
const currency = "NGN";

// const [convertedPrice, setConvertedPrice] = useState();
// const exchangeBaseUrl = "https://api.apilayer.com/exchangerates_data";
const token = localStorage.getItem("tokenHngKey");
// const convertToNaira = useCallback(async () => {
// try {
// const response = await axios.get(
// `${exchangeBaseUrl}/convert?to=NGN&from=USD&amount=${price}`,
// {
// headers: {
// "apikey": process.env.REACT_APP_EXCHANGE_RATE_API_KEY
// }
// }
// );
// setConvertedPrice(response?.data?.result);
// setLoading(false);
// } catch (err) {
// toast.error(err?.response?.data?.message);
// }
// }, [price]);

const createPlan = async(planName,paymentInterval)=>{
setLoading(true);
Expand Down Expand Up @@ -91,9 +71,6 @@ export const PaystackPage = () => {
setLoading(false);
}
}
// useEffect(() => {
// convertToNaira();
// }, [convertToNaira])

const handleSubmit = (e)=>{
e.preventDefault();
Expand Down
149 changes: 1 addition & 148 deletions Apply-For-Me-UI/src/pages/pricing_plan/Pricing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@ const Pricing = ({
const [paymentInterval, setpaymentInterval] = useState();
const [seeMore, setSeeMore] = useState(false);

//const data = seeMore ? plans : plansFull;

useEffect(() => {
toggle.yearly
? setpaymentInterval("yearly")
: setpaymentInterval("monthly");
}, [toggle.yearly, paymentInterval]);
//const location = useLocation();

//const { user } = useSelector(state => state.user);

const navigate = useNavigate();

return (
Expand Down Expand Up @@ -114,149 +110,6 @@ const Pricing = ({
therefore prices are not included in the pricing
plan but based on individual requests.
</p>
{/* <div className={styles.majorPlan}>
{data.map(
(
{
planName,
price,
duration,
model,
btnText,
stamp
},
index
) => {
return (
<div
className={styles.card}
key={index}
>
<div className={styles.choices}>
<p
className={
styles.choice_text
}
>
{stamp}
</p>
</div>

<h3
className={styles.card__heading}
>
{planName} Plan
</h3>
<p className={styles.card__price}>
$ {price}
</p>
<p
className={
styles.card__duration
}
>
{duration}
</p>

<div
className={styles.statusWrapper}
>
{model.map(
(
{ icon, text, alt },
index
) => {
return (
<div
className={
styles.status
}
key={index}
>
<img
src={icon}
alt={alt}
className={
styles.status__img
}
/>
<p
className={
styles.status__text
}
>
{text}
</p>
</div>
);
}
)}
</div>
{user ? (
<BlueButton
text="Get Plan"
width={200}
func={() => {
let isAuthorized;
user?.roles?.forEach(
role => {
if (
role.includes(
"Professional"
)
) {
isAuthorized = true;
}
}
);
if (
isAuthorized &&
price !== "0"
) {
navigate(
`/checkout/${planName}/${paymentInterval}/${price}`
);
} else if (
isAuthorized &&
price === "0"
) {
return;
} else {
toast.error(
"Unauthorized"
);
}
}}
/>
) : (
<>
<BlueButton
width={200}
text={btnText}
func={() =>
navigate("/wel2", {
state: {
from: location
}
})
}
/>{" "}
</>
)}
</div>
);
}
)}
</div> */}

{/* <div >
<p
className={styles.seemorePar}
>
See more plans
</p>
</div> */}

{!seeMore && (
<div className={styles.seemore}>
<button
Expand Down
76 changes: 40 additions & 36 deletions Apply-For-Me-UI/src/pages/pricing_plan/components/Plans3.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import BlueButton from "components/buttons/blue_background/BlueButton";
import { toast } from "react-toastify";
import { useSelector } from "react-redux";
import styles from "pages/pricing_plan/pricing.module.css";
import { useState } from "react";

const Plans3 = ({ paymentInterval, plans }) => {
const location = useLocation();
const navigate = useNavigate();
const { user } = useSelector(state => state.user);
const [activeSubScription] = useState("Free")
return (
<div className={styles.majorPlan}>
{plans.map(
Expand Down Expand Up @@ -44,45 +46,47 @@ const Plans3 = ({ paymentInterval, plans }) => {
);
})}
</div>
{user ? (
<BlueButton
text="Get Plan"
width={200}
func={() => {
let isAuthorized;
user?.roles?.forEach(role => {
if (role.includes("Professional")) {
isAuthorized = true;
{
user && (user?.roles?.includes("Professional"))? (
activeSubScription !== planName ?
<BlueButton
text="Upgrade"
width={200}
func={() => {
if (price !== "0") {
navigate(
`/checkout/${planName}/${paymentInterval}/${price}`
);
} else {
return;
}
});
if (isAuthorized && price !== "0") {
navigate(
`/checkout/${planName}/${paymentInterval}/${price}`
);
} else if (
isAuthorized &&
price === "0"
) {
return;
} else {
toast.error("Unauthorized");
}
}}
/>
) : (
<>
}}
/>
:
<BlueButton
text="SubScribed"
width={200}
text={btnText}
func={() =>
navigate("/wel2", {
state: {
from: location
}
})
}
/>{" "}
</>
/>
) : user && (!user?.roles?.includes("Professional"))? (
<BlueButton
text="Get Plan"
width={200}
func={()=>toast("SubScriptions are meant for users alone")}
/>
):(
<>
<BlueButton
width={200}
text={btnText}
func={() =>
navigate("/wel2", {
state: {
from: location
}
})
}
/>{" "}
</>
)}
</div>
);
Expand Down
Loading