From 0f7d7853cbe5b329c7fbe4d33147f68d874a56f4 Mon Sep 17 00:00:00 2001 From: brenoimatos <70553244+brenoimatos@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:26:42 -0300 Subject: [PATCH] feat: add tooltip to ranking table --- pages/ranking/index.module.css | 47 ++++++++++++++++++++++++++++++++++ pages/ranking/index.tsx | 13 +++++++++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/pages/ranking/index.module.css b/pages/ranking/index.module.css index d7dbf67..001f6c7 100644 --- a/pages/ranking/index.module.css +++ b/pages/ranking/index.module.css @@ -55,3 +55,50 @@ .groupsTable tr:hover { background-color: rgb(239, 254, 255); } + + +/* Tooltip styles */ +.degreeHeader { + text-align: left; + position: relative; +} + +.tooltip { + position: relative; + display: inline-block; + cursor: help; + z-index: 1000; +} + +.tooltipIcon { + font-size: 12px; + margin-left: 5px; + vertical-align: middle; +} + + +.tooltipText { + visibility: hidden; + width: 230px; + background-color: #fff; + color: #000; + text-align: left; + border: 1px solid #ccc; + border-radius: 5px; + padding: 10px; + font-size: 12px; + position: absolute; + top: 100%; + left: 50%; + transform: translateX(-50%); + z-index: 2000; + opacity: 0; + transition: opacity 0.3s ease, visibility 0s 0.3s; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); +} + +.tooltip:hover .tooltipText { + visibility: visible; + opacity: 1; + transition: opacity 0.3s ease, visibility 0s 0s; +} diff --git a/pages/ranking/index.tsx b/pages/ranking/index.tsx index f7e086f..7ff13d2 100644 --- a/pages/ranking/index.tsx +++ b/pages/ranking/index.tsx @@ -6,6 +6,7 @@ import ResultsDisplay from "../../components/ranking/ResultsDisplay/ResultsDispl import Header from "../../components/ranking/Header/Header"; import { useEffect, useState } from "react"; import { GetRankingData } from "../api/ranking/types"; +import InfoIcon from "@material-ui/icons/Info"; export default function RankingPage() { const [rankingData, setRankingData] = useState({ @@ -88,7 +89,17 @@ const Table = (props: { ranking: GetRankingData["ranking"] }) => { - +
#Curso (anos de entrada) + Curso (anos de entrada) + + + + + + Estamos agrupando alunos com anos de entrada próximos, considerando intervalos de 5 anos. Por exemplo, alunos que ingressaram entre 2010 e 2014 serão agrupados juntos. + + + Doadores Total