From d87b7609a191ddf3d645edf47ab81b9bae2e909c Mon Sep 17 00:00:00 2001 From: xaralis <filip.varecha@fragaria.cz> Date: Tue, 5 Jan 2021 14:20:09 +0100 Subject: [PATCH] feat: some more explanation tooltips and better title handling --- src/containers/GlobalStats.jsx | 19 +++++++++++++++---- src/pages/Home.jsx | 3 ++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/containers/GlobalStats.jsx b/src/containers/GlobalStats.jsx index 85cb17a..fef1e63 100644 --- a/src/containers/GlobalStats.jsx +++ b/src/containers/GlobalStats.jsx @@ -34,7 +34,10 @@ const GlobalStats = () => { return ( <div className="bg-grey-50 flex space-x-4 leading-normal px-4 py-2 text-2xs md:text-xs lg:text-sm text-grey-300 whitespace-no-wrap"> - <div> + <div + data-tip="Počet přihlášených členů Pirátské strany." + data-tip-at="bottom" + > <strong>{onlineMembers}</strong>{" "} <span> {onlineMembers === 1 && "člen online"} @@ -42,11 +45,17 @@ const GlobalStats = () => { {(onlineMembers === 0 || onlineMembers > 4) && "členů online"} </span> </div> - <div> + <div + data-tip="Celkový počet osob, které majà tuto stránku otevřenou." + data-tip-at="bottom" + > <strong>{onlineUsers}</strong> <span>online celkem</span> </div> {groupSizeHalf !== null && ( - <div> + <div + data-tip="Velikost skupiny členů je důležitá při posuzovánà podpory návrhů postupu." + data-tip-at="bottom" + > <span>Vel. skupiny členů je</span> <strong>{groupSizeHalf}</strong> </div> )} @@ -56,7 +65,9 @@ const GlobalStats = () => { <Link to="/program" className="font-bold" - title={nextProgramEntryCaption} + aria-label={nextProgramEntryCaption} + data-tip={"Následuje bod " + nextProgramEntryCaption} + data-tip-at="bottom" > {nextProgramEntryCaption} </Link> diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx index 4864962..cc2e7d1 100644 --- a/src/pages/Home.jsx +++ b/src/pages/Home.jsx @@ -194,7 +194,8 @@ const Home = () => { <article className="container container--wide py-8 lg:py-24 cf2021 bg-white"> <div className="cf2021__title flex justify-between"> <h1 className="head-alt-base lg:head-alt-lg"> - Bod č. {programEntry.number}: {programEntry.title} + {programEntry.number !== "" && `Bod č. ${programEntry.number}: `} + {programEntry.title} </h1> {displayActions && ( <DropdownMenu right triggerSize="lg" className="pl-4 pt-1 lg:pt-5"> -- GitLab