diff --git a/app/courses/page.js b/app/courses/page.js
index 8633392..eec48bc 100644
--- a/app/courses/page.js
+++ b/app/courses/page.js
@@ -5,6 +5,7 @@ import Link from "next/link";
import { mycourses } from "@/constants/courses.js";
import { useTranslation } from 'react-i18next';
import { FaceIcon } from "@radix-ui/react-icons";
+import { Card, CardVariants } from "@/components/core/Cards";
export default function Courses() {
@@ -27,41 +28,18 @@ export default function Courses() {
{t('courses.desc')}
- {courses.map(({ date, gradient, edition, title, description, route }) => {
+ {courses.map(({ date, edition, title, description, route }) => {
return (
-
-
-
-
-
-
- {date}
-
-
- {edition}{t('courses.tag')}
-
-
-
-
-
-
-
{title}
-
-
- {description}
-
-
-
-
-
+
);
})}
diff --git a/app/page.js b/app/page.js
index 2bb1455..1472196 100644
--- a/app/page.js
+++ b/app/page.js
@@ -65,14 +65,11 @@ export default function Page() {
{t("front.action-button")}
-
{/* */}
diff --git a/components/core/Cards.jsx b/components/core/Cards.jsx
index 3372c42..5c5985e 100644
--- a/components/core/Cards.jsx
+++ b/components/core/Cards.jsx
@@ -19,7 +19,7 @@ import {
CardSubtitle,
CardDescription,
CardFooter,
- CardHeader
+ CardHeader,
} from "@/components/ui/customCard";
import { useTranslation } from "react-i18next";
@@ -50,7 +50,6 @@ const tagContainerClasses = cn(
"mt-6 w-full flex flex-wrap gap-2 justify-start"
);
-
/**
* Se puede integrar si cambiamos el modelo de datos del json por array
* @param {String} tags
@@ -60,45 +59,46 @@ const renderTags = (tags) => {
if (!tags) return null;
const tagsArray = tags.split(",").map((tag) => tag.trim()); // Convierte el string en array y elimina espacios
return tagsArray.map((tag, index) => (
- {tag} // Añade una key a cada Label
+
+ {tag}
+ // Añade una key a cada Label
));
};
// quitarle guión, añadir espaciado, mayúscula (Formateo)
const renderCategory = (category) => {
if (!category) return null;
- const categoryFormat = category.split('-') // cadena en un array de palabras
- .map(palabra => palabra.charAt(0).toUpperCase() + palabra.slice(1)) // la primera letra en mayúscula
- .join(' '); // unir las palabras con espacio
+ const categoryFormat = category
+ .split("-") // cadena en un array de palabras
+ .map((palabra) => palabra.charAt(0).toUpperCase() + palabra.slice(1)) // la primera letra en mayúscula
+ .join(" "); // unir las palabras con espacio
return (
- {categoryFormat}
- )
+
+ {categoryFormat}
+
+ );
};
const translateCategory = (category, currentLang) => {
if (currentLang == "es") {
if (category == "article-journal") {
category = "artículo-revista";
- console.log(category)
- }
- else if (category == "paper-conference") {
+ console.log(category);
+ } else if (category == "paper-conference") {
category = "acta-congreso";
- console.log(category)
- }
- else if (category == "book") {
+ console.log(category);
+ } else if (category == "book") {
category = "libro";
- console.log(category)
- }
- else if (category == "chapter") {
+ console.log(category);
+ } else if (category == "chapter") {
category = "capítulo";
- console.log(category)
- }
+ console.log(category);
+ }
} else if (currentLang == "en") {
// transformar "artículo-revista" en article journal
}
- return renderCategory(category)
-}
-
+ return renderCategory(category);
+};
const Card = React.forwardRef(
(
@@ -126,11 +126,9 @@ const Card = React.forwardRef(
cardType,
role,
currentLang,
- basePath
-
+ basePath,
},
ref
-
) => {
const { t } = useTranslation();
@@ -160,7 +158,15 @@ const Card = React.forwardRef(
// COURSE
const courseCard = (
-
+
{date}
@@ -173,18 +179,28 @@ const Card = React.forwardRef(
Ir al curso
+ {/* */}
{title}
{subtitle}
{description}
- {renderTags(tags)}
+ {/* {renderTags(tags)}
*/}
);
// PUBLICATIONS - ok
const publicationCard = (
-
+
{date}
@@ -201,8 +217,8 @@ const Card = React.forwardRef(
{doi ? (
@@ -225,7 +241,7 @@ const Card = React.forwardRef(
src={img || "placeholder.jpg"} // La imagen por defecto será una cadena vacía si no hay src
alt={title || "Image"} // Usa el título como alt si existe
fit="cover" // Ajustamos el contenido al contenedor
- hasBadge={position? true : false} // Por defecto, no tiene badge
+ hasBadge={position ? true : false} // Por defecto, no tiene badge
badgeContent={position}
/>
)}
@@ -234,8 +250,14 @@ const Card = React.forwardRef(
{name}
- { role && ({role})}
- {email && {email}}
+ {role && {role}}
+ {email && (
+
+ {email}
+
+ )}
)}
{/* {( email &&
@@ -250,22 +272,24 @@ const Card = React.forwardRef(
{img && (
+ src={/* process.env.PUBLIC_URL */ +img || "placeholder.jpg"}
+ alt={/* process.env.PUBLIC_URL */ +img || "placeholder.jpg"}
+ className={"h-24"}
+ fit="contain"
+ />
)}
{title}
{description}
- {( github && )}
+ {github && (
+
+ )}