+
+
{translation.expertise.title[language]}
{translation.expertise.intro[language]}
diff --git a/src/templates/ComingSoon.tsx b/src/templates/ComingSoon.tsx
index 7fbaad3..7d0f437 100644
--- a/src/templates/ComingSoon.tsx
+++ b/src/templates/ComingSoon.tsx
@@ -20,7 +20,7 @@ interface Props {
export default function ComingSoon({ page, language }: Props) {
return (
-
+
diff --git a/src/templates/History.tsx b/src/templates/History.tsx
index 8e1341c..cae76a3 100644
--- a/src/templates/History.tsx
+++ b/src/templates/History.tsx
@@ -50,7 +50,7 @@ const Element = ({date, label, isEven, language, Icon}: ElementProps) => {
export default function History({language}: Props) {
return (
-
+
diff --git a/src/templates/Home.tsx b/src/templates/Home.tsx
index 5842291..a25ad3a 100644
--- a/src/templates/Home.tsx
+++ b/src/templates/Home.tsx
@@ -14,7 +14,9 @@ interface Props {
export default function Home({language}: Props) {
return (
-
+
@@ -77,7 +79,7 @@ export default function Home({language}: Props) {
{translation.learn_ai.title[language]}
{translation.learn_ai.description[language]}
-
+
{translation.learn_more[language]}
@@ -169,7 +171,7 @@ export default function Home({language}: Props) {
-
+
diff --git a/src/templates/Price.tsx b/src/templates/Price.tsx
index f1cec90..582ccc2 100644
--- a/src/templates/Price.tsx
+++ b/src/templates/Price.tsx
@@ -21,6 +21,28 @@ interface Package {
}
export default function Page({language}: {language: "en" | "ar"}) {
+ const getDurationUnit = (duration: number, durationUnitSingular: string, durationUnitPlural: string) => {
+ if(duration >= 2 && duration <= 10) {
+ return durationUnitPlural;
+ }
+
+ return durationUnitSingular;
+ }
+ const durationAndDurationUnitParser = (duration: number, duration_unit: DurationUnit) => {
+ if(language === 'ar') {
+ switch (duration_unit) {
+ case "days":
+ return `${duration} ${getDurationUnit(duration, translation.days.singular[language], translation.days.plural[language])}`;
+ case "weeks":
+ return `${duration} ${getDurationUnit(duration, translation.weeks.singular[language], translation.weeks.plural[language])}`;
+ case "months":
+ return `${duration} ${getDurationUnit(duration, translation.months.singular[language], translation.months.plural[language])}`;
+ }
+ }
+
+ return capitalize(duration === 1 ? duration_unit.slice(0, duration_unit.length - 1) : duration_unit);
+ }
+
const [payments, setPayments] = React.useState
([]);
const getData = async () => {
// Fetch data from external API
@@ -40,10 +62,9 @@ export default function Page({language}: {language: "en" | "ar"}) {
getData();
}, []);
return (
-
+
-
-
+
{translation.title[language]}
{payments.map((p) => (
@@ -51,8 +72,7 @@ export default function Page({language}: {language: "en" | "ar"}) {
- EnCoach - {p.duration}{" "}
- {capitalize(p.duration === 1 ? p.duration_unit.slice(0, p.duration_unit.length - 1) : p.duration_unit)}
+ {translation.encoach[language]} - {durationAndDurationUnitParser(p.duration, p.duration_unit)}
diff --git a/src/templates/Privacy.tsx b/src/templates/Privacy.tsx
index 8783ad8..71f7e44 100644
--- a/src/templates/Privacy.tsx
+++ b/src/templates/Privacy.tsx
@@ -22,16 +22,16 @@ interface Content {
export default function Privacy({language}: Props) {
return (
-
+
-
+
{translation.title[language]}
-
+
string) =>
- data.map((section, index) => (
-
-
-
-
{section.title}
-
-
{section.description}
-
- {section.bullets.map((bullet) => (
-
-
- {bullet.icon && (
-
- )}
-
-
-
- {bullet.title}
-
-
- {bullet.values.map((value) => (
- {value}
- ))}
-
-
-
- ))}
-
-
-
- ));
+ const renderStruct = (data: SectionStruct[], getBackgroundColor: (index: number) => string) =>
+ data.map((section, index) => (
+
+
+
+
{section.title}
+
+
{section.description}
+
+ {section.bullets.map((bullet) => (
+
+
+ {bullet.icon && }
+
+
+
{bullet.title}
+
+ {bullet.values.map((value) => (
+ {value}
+ ))}
+
+
+
+ ))}
+
+
+
+ ));
- return (
-
-
-
-
-
{translation.services[language]}
-
-
- {renderStruct(
- struct,
- (index: number) => `bg-${index % 2 ? "mti-gray-seasalt" : "white"}`
- )}
-
-
-
- {translation.corporate_educational_institutions[language]}
-
-
-
- {renderStruct(
- final_struct,
- (index: number) => `bg-${index % 2 ? "white" : "mti-gray-seasalt"}`
- )}
-
-
- );
+ return (
+
+
+
+
+
{translation.services[language]}
+
+
+ {renderStruct(struct, (index: number) => `bg-${index % 2 ? "mti-gray-seasalt" : "white"}`)}
+
+
+
{translation.corporate_educational_institutions[language]}
+
+
+ {renderStruct(final_struct, (index: number) => `bg-${index % 2 ? "white" : "mti-gray-seasalt"}`)}
+
+
+ );
}
diff --git a/src/templates/Terms.tsx b/src/templates/Terms.tsx
index 18c76c3..494b16d 100644
--- a/src/templates/Terms.tsx
+++ b/src/templates/Terms.tsx
@@ -22,16 +22,16 @@ interface Content {
export default function Terms({language}: Props) {
return (
-
+
-
+
{translation.title[language]}
-