Removed the ENV variable use
This commit is contained in:
@@ -24,12 +24,9 @@ export default function Page({ language }: { language: "en" | "ar" }) {
|
|||||||
const [payments, setPayments] = React.useState<Package[]>([]);
|
const [payments, setPayments] = React.useState<Package[]>([]);
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
// Fetch data from external API
|
// Fetch data from external API
|
||||||
const response = await fetch(
|
const response = await fetch(`https://platform.encoach.com/api/packages`, {
|
||||||
`${process.env.NEXT_PUBLIC_APP_URL}/api/packages`,
|
|
||||||
{
|
|
||||||
method: "GET",
|
method: "GET",
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
const payments = await response.json();
|
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>
|
<h2 className="text-3xl font-bold">{translation.title[language]}</h2>
|
||||||
<div className="grid grid-cols-2 gap-8">
|
<div className="grid grid-cols-2 gap-8">
|
||||||
{payments.map((p) => (
|
{payments.map((p) => (
|
||||||
<div
|
<div key={p.id} className={clsx("p-4 bg-white rounded-xl flex flex-col gap-6 items-start")}>
|
||||||
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">
|
<div className="flex flex-col items-start mb-2">
|
||||||
<Image
|
<Image src="/logo_title.png" alt="EnCoach's Logo" width={32} height={32} />
|
||||||
src="/logo_title.png"
|
|
||||||
alt="EnCoach's Logo"
|
|
||||||
width={32}
|
|
||||||
height={32}
|
|
||||||
/>
|
|
||||||
<span className="font-semibold text-xl">
|
<span className="font-semibold text-xl">
|
||||||
EnCoach - {p.duration}{" "}
|
EnCoach - {p.duration}{" "}
|
||||||
{capitalize(
|
{capitalize(p.duration === 1 ? p.duration_unit.slice(0, p.duration_unit.length - 1) : p.duration_unit)}
|
||||||
p.duration === 1
|
|
||||||
? p.duration_unit.slice(0, p.duration_unit.length - 1)
|
|
||||||
: p.duration_unit
|
|
||||||
)}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-2 items-start w-full">
|
<div className="flex flex-col gap-2 items-start w-full">
|
||||||
@@ -91,8 +74,7 @@ export default function Page({ language }: { language: "en" | "ar" }) {
|
|||||||
</div>
|
</div>
|
||||||
<Link
|
<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"
|
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]}
|
{translation.joinus[language]}
|
||||||
</Link>
|
</Link>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user