Skip to content

Commit

Permalink
card botón texto ver más + ajustes
Browse files Browse the repository at this point in the history
  • Loading branch information
lauralog committed Jan 20, 2025
1 parent b29592d commit eca78db
Show file tree
Hide file tree
Showing 33 changed files with 806 additions and 221 deletions.
1 change: 1 addition & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/* border: 1px solid salmon */
}


/*TYPE*/
/* .text-h5 {
color: inherit
Expand Down
172 changes: 172 additions & 0 deletions app/projects/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
"use client";

import { useTranslation } from "react-i18next";
// import TabsResearchLineFilter from "@/components/filters/TabsResearchLineFilter";
import { projects } from "@/constants/projects";
import { Card } from "@/components/core/Cards";
// import { researchlines } from "@/constants/researchlines";
import Heading from "@/components/ui/Heading";
import Text from "@/components/ui/Text"
// import ProjectsFilter from "@/components/filters/ProjectsFilter"
import { useRouter, useSearchParams } from "next/navigation";
import { useState, useEffect } from "react";
import { Suspense } from 'react';


export default function Projects() {
return (
<Suspense>
<ProjectsPage />
</Suspense>
);

}



function ProjectsPage() {
const { t, i18n } = useTranslation();
const currentLang = i18n.language;

const router = useRouter(); // Hook para manipular la URL
let searchParams = useSearchParams();

const [researchLine, setResearchLine] = useState("all");
const [projectType, setProjectType] = useState(undefined);
const [search, setSearch] = useState("");

const pathname = "/projects";

// // creado array de categorías de publications
// const projectTypes = ["all",...new Set(projects.map(project => project.projectType))];

// // 2. Agregar objeto "all", que sería "todas las líneas de inv."
// let researchLines = ["all", ...researchlines];

// //actualizar la URL cuando cambia algo en el estado, usamos router.push
// useEffect(() => {
// let query = {};
// if (search) query.search = search;
// if (projectType) query.category = projectType;
// if (researchLine) query.researchline = researchLine;

// router.push(`${pathname}/?${new URLSearchParams(query).toString()}`, undefined);
// }, [search, projectType, researchLine]);


// // función para obtener todos los parámetros de la URL
// useEffect(() => {
// let researchLineURL = searchParams.get('researchline');
// console.log("researchLineURL: " + researchLineURL);
// setResearchLine(researchLineURL);

// let searchURL = searchParams.get('search');
// console.log("searchURL: " + searchURL);
// setSearch(searchURL);

// let projectTypeURL = searchParams.get('category');
// console.log("projectType: " + projectTypeURL);
// setProjectType(projectTypeURL);

// }, []);

// // Filtrar los proyectos por línea de investigación
// const filteredItems = projects.filter(

// (item) =>

// (!search ||
// search
// .toLowerCase()
// .replace(new RegExp(/\s/g), "")
// .replace(new RegExp(/[àáâãäå]/g), "a")
// .replace(new RegExp(/æ/g), "ae")
// .replace(new RegExp(/ç/g), "c")
// .replace(new RegExp(/[èéêë]/g), "e")
// .replace(new RegExp(/[ìíîï]/g), "i")
// .replace(new RegExp(/ñ/g), "n")
// .replace(new RegExp(/[òóôõö]/g), "o")
// .replace(new RegExp(/œ/g), "oe")
// .replace(new RegExp(/[ùúûü]/g), "u")
// .replace(new RegExp(/[ýÿ]/g), "y")
// .replace(new RegExp(/\W/g), "")
// .split(" ")
// .every((i) =>
// item.title
// .toLowerCase()
// .replace(new RegExp(/\s/g), "")
// .replace(new RegExp(/[àáâãäå]/g), "a")
// .replace(new RegExp(/æ/g), "ae")
// .replace(new RegExp(/ç/g), "c")
// .replace(new RegExp(/[èéêë]/g), "e")
// .replace(new RegExp(/[ìíîï]/g), "i")
// .replace(new RegExp(/ñ/g), "n")
// .replace(new RegExp(/[òóôõö]/g), "o")
// .replace(new RegExp(/œ/g), "oe")
// .replace(new RegExp(/[ùúûü]/g), "u")
// .replace(new RegExp(/[ýÿ]/g), "y")
// .replace(new RegExp(/\W/g), "")
// .includes(i)
// )) &&
// (!researchLine || (researchLine === "all" || item.researchLine.includes(researchLine))) &&
// (!projectType || (item.projectType && item.projectType === projectType))
// );
// console.log(filteredItems.map(filteredItem => filteredItem ));
return (
<div>
<div className="standard_margin" id="banner-publications">
<Heading level="h2">{t("projects.title")}</Heading>
<Text type="p">
{t("projects.description")}
</Text>
</div>
<div>

<div className="flex flex-col justify-center">
{/* <ProjectsFilter
researchLines={researchLines}
researchLine={researchLine}
projectType={projectType}
projectTypes={projectTypes}
search={search}
changeProjectType={(projectType) => setProjectType(projectType)}
changeResearchLine={(researchLine) => setResearchLine(researchLine)}
changeSearch={(search) => setSearch(search)}
pathname={pathname}
/> */}

</div>
<div className="project_cards standard_margin my-4 sm:my-6 lg:my-10 sm:gap-4">
{projects.map(
(
{
year,
title,
description,
description_es,
researchLine,
logo,
route,
projectType
},
index
) => (
<Card
key={index}
cardType={"project"}
year={year}
researchLine={researchLine}
title={title}
logo={logo}
route={route}
description_en={description}
description_es={description_es}
projectType={projectType}
></Card>
)
)}
</div>
</div>
</div>
);
}
6 changes: 3 additions & 3 deletions app/research/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ export default function Research() {
return (
<div className={"research page_" + currentLang}>
<div className="standard_margin" id="banner-publications">
<Heading level="h2">{t("publications.title")}</Heading>
<Heading level="h2">{t("research.title")}</Heading>
<Text type="p">
{t("publications.description")}
{t("research.description")}
</Text>
</div>
<main className="research">
Expand Down Expand Up @@ -146,7 +146,7 @@ export default function Research() {
}) + " w-fit mt-4 my-auto"
}
>
{t("publications.button2")}
{t("research.button2")}
</Button>
)}
</div>
Expand Down
109 changes: 59 additions & 50 deletions app/tools/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import image from "next/image";
import { useState, useEffect } from "react";
import { mytools } from "@/constants/tools";
import { useTranslation } from "react-i18next";
import FaceIcon from '@mui/icons-material/Face';
import FaceIcon from "@mui/icons-material/Face";
import { Card, CardVariants } from "@/components/core/Cards";
import Heading from "@/components/ui/Heading";
import Text from "@/components/ui/Text";


export default function Tools(props) {
const { t, i18n } = useTranslation();
Expand All @@ -24,15 +28,13 @@ export default function Tools(props) {
title,
translationKey,
github,
gradient,
key,
description,
}) => ({
title,
logo,
route,
github,
gradient,
key,
description: t(translationKey),
})
Expand All @@ -47,60 +49,61 @@ export default function Tools(props) {
return (
<div className={"tools page_" + currentLang}>
{/* <Header route="/tools" /> */}
<div className="banner px-4 sm:px-8 md:px-14 md:py-2 lg:px-24 lg:py-4 xl:px-28 xl:py-4 2xl:px-32 2xl:py-6">
<h1>{t("tools.title")}</h1>
<div className="standard_margin ">
<Heading level="h2">{t("tools.title")}</Heading>
<Text type="p" className="pb-8 xs:p-6 md:p-0">{t("tools.description")}</Text>
</div>
<main>
<section className="our_tools lg:mx-36 md:mx-14 sm:mx-8 mx-4 my-4 sm:my-4 md:my-8 lg:my-12 xl:my-16 2xl:my-20 xl:mx-44 2xl:mx-60">
<div className="tools_description text-slate-700 pb-8">
<p>{t("tools.desc")}</p>
<br />
<p>{t("tools.desc2")} </p>
</div>
<ResponsiveMasonry
columnsCountBreakPoints={{ 150: 1, 600: 2, 900: 3 }}
>
<Masonry gutter="12px">
{tools.map(
({ title, description, route, logo, github, gradient }) => {
<section className="standard_margin">
<div className="grid sm:gap-4 gap-y-8 sm:grid-cols-2 md:grid-cols-3 ">
{tools.map(
({ key, title, description, route, logo, github}) => {
return (
<div className="tool" key={title}>
<div className={`tool_logo ${gradient}`}>
<img alt={"Project Logo"} src={logo} />
</div>
<Card
key={key}
title={title}
currentLang={currentLang}
cardType={"tool"}
className={CardVariants({variant: "tool"})}
description={description}
route={route}
></Card>
// <div className="tool" key={title}>
// <div className={`tool_logo ${gradient}`}>
// <img alt={"Project Logo"} src={logo} />
// </div>

<div className="tool_content">
<div className="tool_title">
<h3>{title}</h3>
</div>
<div className="tool_description">
<p>{description}</p>
</div>
<div className="tool_button_container">
<button className="tool_button">
<CreateLink route={route}>
<FaceIcon />
<span> {t("tools.toolCards.button")}</span>
</CreateLink>
</button>
<button className="tool_github">
<CreateLink route={github}>
{/* <FontAwesomeIcon
className="mr-2 "
icon={faGithub}
size="lg"
/> */}
<span> Github </span>{" "}
</CreateLink>
</button>
</div>
</div>
</div>
// <div className="tool_content">
// <div className="tool_title">
// <h3>{title}</h3>
// </div>
// <div className="tool_description">
// <p>{description}</p>
// </div>
// <div className="tool_button_container">
// <button className="tool_button">
// <CreateLink route={route}>
// <FaceIcon />
// <span> {t("tools.toolCards.button")}</span>
// </CreateLink>
// </button>
// <button className="tool_github">
// <CreateLink route={github}>
// {/* <FontAwesomeIcon
// className="mr-2 "
// icon={faGithub}
// size="lg"
// /> */}
// <span> Github </span>{" "}
// </CreateLink>
// </button>
// </div>
// </div>
// </div>
);
}
)}
</Masonry>
</ResponsiveMasonry>
</div>
</section>
</main>
</div>
Expand All @@ -116,3 +119,9 @@ const CreateLink = (props) => {
<Link to={props.route}>{props.children}</Link>
);
};

{
/* <CreateLink route={github}>
<span> Github </span>{" "}
</CreateLink> */
}
4 changes: 2 additions & 2 deletions components/FilterCategory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function FilterCategory( {category, changeCategory, categories }
const { t } = useTranslation();
return (
<div className="container_select_label w-1/2 lg:w-full">
<Label htmlFor="search">{t("publications.filter.fieldTitle2")}</Label>
<Label htmlFor="search">{t("research.filter.fieldTitle2")}</Label>
<Select
className="filter flex flex-col"
onValueChange={(value) =>
Expand All @@ -35,7 +35,7 @@ export default function FilterCategory( {category, changeCategory, categories }
<SelectContent id="publication" name="publication">
{categories.map((category, index) => (
<SelectItem key={index} value={category}>
{t(`publications.filter.fieldOpt${index + 1}`)}
{t(`research.filter.fieldOpt${index + 1}`)}
</SelectItem>
))}
</SelectContent>
Expand Down
4 changes: 2 additions & 2 deletions components/FilterDate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function FilterDate( {year, changeYear, items} ) {

return (
<div className="container_select_label w-1/2 lg:w-full">
<Label htmlFor="year">{t("publications.filter.fieldTitle3")}</Label>
<Label htmlFor="year">{t("research.filter.fieldTitle3")}</Label>
<Select
className="filter"
id="filter_year"
Expand All @@ -49,7 +49,7 @@ export default function FilterDate( {year, changeYear, items} ) {
</SelectTrigger>
<SelectContent id="year" name="year">
<SelectItem key={"all"} value={"all"}>
{t("publications.filter.fieldOpt5")}
{t("research.filter.fieldOpt5")}
</SelectItem>
{years.map((y) => (
<SelectItem key={y} value={y}>
Expand Down
2 changes: 1 addition & 1 deletion components/FilterText.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function FilterText( {search, changeSearch} ) {
const { t } = useTranslation();
return (
<div className="filter flex flex-wrap md:w-1/2">
<Label htmlFor="search">{t("publications.filter.fieldTitle1")}</Label>
<Label htmlFor="search">{t("research.filter.fieldTitle1")}</Label>
<Input
className="w-full"
key={" "}
Expand Down
Loading

0 comments on commit eca78db

Please sign in to comment.