feat(layout): indicate clickable badges

This commit is contained in:
Elian Doran 2025-12-09 21:50:38 +02:00
parent 644d051477
commit 28c1d0b3f5
No known key found for this signature in database
2 changed files with 13 additions and 1 deletions

View File

@ -11,5 +11,13 @@
font-size: 0.75em;
background-color: var(--badge-background-color);
color: var(--badge-text-color);
&.clickable {
cursor: pointer;
&:hover {
background-color: var(--badge-background-hover-color);
}
}
}
}

View File

@ -4,6 +4,7 @@ import { ComponentChildren } from "preact";
import { useIsNoteReadOnly, useNoteContext } from "./react/hooks";
import Icon from "./react/Icon";
import { useShareInfo } from "./shared_info";
import clsx from "clsx";
export default function NoteBadges() {
return (
@ -43,7 +44,10 @@ function ShareBadge() {
function Badge({ icon, children, onClick }: { icon: string, children: ComponentChildren, onClick?: () => void }) {
return (
<div className="breadcrumb-badge" onClick={onClick}>
<div
className={clsx("breadcrumb-badge", { "clickable": !!onClick })}
onClick={onClick}
>
<Icon icon={icon} />&nbsp;
{children}
</div>