-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Eduardo-Pyment/feature/modulos
Feature/modulos
- Loading branch information
Showing
6 changed files
with
214 additions
and
20 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { useState } from "react"; | ||
Check failure on line 1 in src/components/ModulosEducacionais_big.tsx GitHub Actions / Build
|
||
import { useQuery } from "@tanstack/react-query"; | ||
import { Link } from "react-router-dom"; | ||
|
||
import "../style/components/ModulosEducacionais_big.scss"; | ||
|
||
import Timer from "../assets/feather/clock.svg"; | ||
import User from "../assets/feather/user.svg"; | ||
import Star from "../assets/feather/star.svg"; | ||
|
||
|
||
const ModulosEducacionais_big = () => { | ||
const [modulosBigPage, setModulosBigPage] = useState(""); | ||
|
||
const fetchModulosB = async (sort = "", page = "") => { | ||
const response = await fetch( | ||
`http://0.0.0.0:3004/cursos?_sort=${sort}&_page=${page}&_limit=9` | ||
); | ||
const data = await response.json(); | ||
return data; | ||
}; | ||
|
||
const { isLoading, error, data, isFetching } = useQuery({ | ||
queryKey: ["queryModulosSmall", modulosBigPage], | ||
queryFn: () => fetchModulosB(modulosBigPage), | ||
}); | ||
|
||
if (isLoading || isFetching) { | ||
return ( | ||
<p style={{ color: "#000000", fontSize: "30px", marginTop: "20px" }}> | ||
Carregando Modulos.... | ||
</p> | ||
); | ||
} else if (error) { | ||
return ( | ||
<p style={{ color: "#000000", fontSize: "30px", marginTop: "20px" }}> | ||
Error: {error.message} | ||
</p> | ||
); | ||
} | ||
|
||
return ( | ||
<> | ||
<section className="modulosBig"> | ||
<h3>Módulos Educacionais</h3> | ||
<div className="modulosBig-categorias"> | ||
<span>Covid 19</span> | ||
<span>Sifilis e outras Ist's</span> | ||
<span>Preceptoria</span> | ||
<span>Doenças raras</span> | ||
<span>Web Palestras</span> | ||
<span>Sistemas prisionais</span> | ||
<span>OPAS</span> | ||
</div> | ||
<span className="modulosBig-resultados"># de # resultados</span> | ||
|
||
<ol className="modulosBig-container"> | ||
{data?.map((data: any) => { | ||
return ( | ||
<li className="modulosBig-items"> | ||
<img src={data?.capa} className="modulosBig-items-img"></img> | ||
<h2 className="modulosBig-items-titulo">{data?.titulo}</h2> | ||
<span className="modulosBig-items-parceiros"> | ||
{data?.parceiros} | ||
</span> | ||
<div className="modulosBig-items-estatisticas"> | ||
<span className="modulosBig-items-matriculados"> | ||
<img src={User} alt="Imagem matriculados" />{data?.matriculados} | ||
</span> | ||
<span className="modulosBig-items-duracao"> | ||
<img src={Timer} alt="Imagem duração" />{data?.duracao} | ||
</span> | ||
<span className="modulosBig-items-avaliacao"> | ||
<img src={Star} alt="Imagem avaliação" />{data?.avaliacao} | ||
</span> | ||
</div> | ||
<p className="modulosBig-items-objetivogeral">{data?.resumo}</p> | ||
<button className="modulosBig-verModulo">Ver módulo</button> | ||
</li> | ||
); | ||
})} | ||
</ol> | ||
<div className="modulosBig-paginacao"> | ||
<button>paginação</button> | ||
</div> | ||
</section> | ||
</> | ||
); | ||
}; | ||
|
||
export default ModulosEducacionais_big; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
@import "../variables"; | ||
|
||
// * {border: 1px solid black;} | ||
.modulosBig { | ||
width: 80%; | ||
h3 { | ||
margin-bottom: 2rem; | ||
font-size: 2.2rem; | ||
color: $red-ligh; | ||
} | ||
.modulosBig-categorias { | ||
flex-direction: row; | ||
text-align: center; | ||
margin: 1rem 0rem; | ||
display: flex; | ||
span { | ||
text-wrap: nowrap; | ||
font-size: 1.1rem; | ||
} | ||
} | ||
.modulosBig-resultados { | ||
display: inline-block; | ||
margin-left: 0.4rem; | ||
margin-bottom: 1rem; | ||
text-align: left; | ||
} | ||
.modulosBig-container { | ||
grid-template-columns: repeat(3, 1fr); | ||
padding: 0rem 0.4rem; | ||
list-style: none; | ||
display: grid; | ||
gap: 1.5rem; | ||
.modulosBig-items { | ||
position: relative; | ||
text-decoration: none; | ||
.modulosBig-items-img { | ||
border-radius: 1rem; | ||
} | ||
.modulosBig-items-titulo { | ||
text-align: left; | ||
margin: 0.2rem 0rem; | ||
color: $ui-darkest; | ||
font-size: 1.3rem; | ||
} | ||
.modulosBig-items-parceiros { | ||
display: inline-block; | ||
margin: 0.2rem 0rem; | ||
text-align: left; | ||
color: $red-ligh; | ||
font-size: 1rem; | ||
} | ||
.modulosBig-items-estatisticas { | ||
display: inline-block; | ||
margin: 0.2rem 0rem; | ||
text-align: justify; | ||
color: $ui-darkest; | ||
text-wrap: nowrap; | ||
.modulosBig-items-matriculados { | ||
img{ | ||
margin-right: 0.2rem; | ||
width: 1rem; | ||
} | ||
} | ||
.modulosBig-items-duracao { | ||
img{ | ||
margin-right: 0.2rem; | ||
margin-left: 0.4rem; | ||
width: 1rem; | ||
} | ||
} | ||
.modulosBig-items-avaliacao { | ||
img{ | ||
margin-left: 0.4rem; | ||
margin-right: 0.2rem; | ||
width: 1rem; | ||
} | ||
} | ||
} | ||
.modulosBig-items-objetivogeral { | ||
box-shadow: inset 0px -40px 15px 0px rgba(255,255,255,1); | ||
background-color: transparent; | ||
text-overflow: ellipsis; | ||
color: $ui-darkest; | ||
max-height: 4.5rem; | ||
text-align: left; | ||
overflow: hidden; | ||
} | ||
} | ||
.modulosBig-verModulo { | ||
background-color: $ui-lighter; | ||
border-radius: 3rem; | ||
color: $ui-light; | ||
padding: 0rem 0.2rem; | ||
position: absolute; | ||
font-size: 1rem; | ||
width: 7rem; | ||
bottom: 0; | ||
right: 0; | ||
} | ||
} | ||
.modulosBig-paginacao { | ||
width: 7rem; | ||
} | ||
} |