Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add tooltip to voie and toponyme onglet #936

Merged
merged 4 commits into from
Jul 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions pages/bal/[balId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Tablist,
Tab,
toaster,
Tooltip,
} from "evergreen-ui";

import TokenContext from "@/contexts/token";
Expand Down Expand Up @@ -244,23 +245,35 @@ function BaseLocalePage({ commune }: BaseLocalePageProps) {
},
{
label: "Voies",
tooltip:
"Renseignez ici les voies, places et lieux-dits numérotés.",
},
{
label: "Toponymes",
tooltip:
"Renseignez ici les voies, places et lieux-dits sans numeros, les compléments d'adresse et points d'intérêts.",
},
].map(({ label, notif }, index) => (
<Tab
key={label}
position="relative"
isSelected={selectedTabIndex === index}
onSelect={() => {
setSelectedTabIndex(index);
}}
>
{label}
{notif > 0 && <span className="tab-notif">{notif}</span>}
</Tab>
))}
].map(({ label, notif, tooltip }, index) => {
const tab = (
<Tab
position="relative"
isSelected={selectedTabIndex === index}
onSelect={() => {
setSelectedTabIndex(index);
}}
>
{label}
{notif > 0 && <span className="tab-notif">{notif}</span>}
</Tab>
);
return tooltip ? (
<Tooltip content={tooltip} key={label}>
{tab}
</Tooltip>
) : (
tab
);
})}
</Tablist>
</Pane>

Expand Down
Loading