Removed the ENV variable use
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import React from "react";
|
||||
import Image from "next/image";
|
||||
import { capitalize } from "lodash";
|
||||
import {capitalize} from "lodash";
|
||||
import getSymbolFromCurrency from "currency-symbol-map";
|
||||
import clsx from "clsx";
|
||||
import Navbar from "@/components/Navbar";
|
||||
@@ -20,16 +20,13 @@ interface Package {
|
||||
price: number;
|
||||
}
|
||||
|
||||
export default function Page({ language }: { language: "en" | "ar" }) {
|
||||
export default function Page({language}: {language: "en" | "ar"}) {
|
||||
const [payments, setPayments] = React.useState<Package[]>([]);
|
||||
const getData = async () => {
|
||||
// Fetch data from external API
|
||||
const response = await fetch(
|
||||
`${process.env.NEXT_PUBLIC_APP_URL}/api/packages`,
|
||||
{
|
||||
const response = await fetch(`https://platform.encoach.com/api/packages`, {
|
||||
method: "GET",
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
if (response.status === 200) {
|
||||
const payments = await response.json();
|
||||
@@ -50,26 +47,12 @@ export default function Page({ language }: { language: "en" | "ar" }) {
|
||||
<h2 className="text-3xl font-bold">{translation.title[language]}</h2>
|
||||
<div className="grid grid-cols-2 gap-8">
|
||||
{payments.map((p) => (
|
||||
<div
|
||||
key={p.id}
|
||||
className={clsx(
|
||||
"p-4 bg-white rounded-xl flex flex-col gap-6 items-start"
|
||||
)}
|
||||
>
|
||||
<div key={p.id} className={clsx("p-4 bg-white rounded-xl flex flex-col gap-6 items-start")}>
|
||||
<div className="flex flex-col items-start mb-2">
|
||||
<Image
|
||||
src="/logo_title.png"
|
||||
alt="EnCoach's Logo"
|
||||
width={32}
|
||||
height={32}
|
||||
/>
|
||||
<Image src="/logo_title.png" alt="EnCoach's Logo" width={32} height={32} />
|
||||
<span className="font-semibold text-xl">
|
||||
EnCoach - {p.duration}{" "}
|
||||
{capitalize(
|
||||
p.duration === 1
|
||||
? p.duration_unit.slice(0, p.duration_unit.length - 1)
|
||||
: p.duration_unit
|
||||
)}
|
||||
{capitalize(p.duration === 1 ? p.duration_unit.slice(0, p.duration_unit.length - 1) : p.duration_unit)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2 items-start w-full">
|
||||
@@ -91,8 +74,7 @@ export default function Page({ language }: { language: "en" | "ar" }) {
|
||||
</div>
|
||||
<Link
|
||||
className="transition ease-in-out duration-300 text-white hover:bg-mti-purple-dark hover:border-mti-purple-dark border border-mti-purple-light bg-mti-purple-light px-8 py-2 rounded-xl mb-8"
|
||||
href={`${process.env.NEXT_PUBLIC_APP_URL}/register`}
|
||||
>
|
||||
href={`${process.env.NEXT_PUBLIC_APP_URL}/register`}>
|
||||
{translation.joinus[language]}
|
||||
</Link>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user