feat: classnames

This commit is contained in:
2023-10-16 15:48:56 +01:00
parent 7129ffa1c7
commit 2ce5bd153b
22 changed files with 91 additions and 80 deletions

View File

@ -23,6 +23,7 @@ import ProfilePreview from "Element/User/ProfilePreview";
import { getDisplayName } from "Element/User/DisplayName";
import { Day } from "Const";
import Tabs, { Tab } from "Element/Tabs";
import classNames from "classnames";
function notificationContext(ev: TaggedNostrEvent) {
switch (ev.kind) {
@ -196,9 +197,12 @@ function NotificationSummary({ evs }: { evs: Array<TaggedNostrEvent> }) {
const filterIcon = (f: NotificationSummaryFilter, icon: string, iconActiveClass?: string) => {
const active = hasFlag(filter, f);
return (
<div className={`summary-icon${active ? " active" : ""}`} onClick={() => setFilter(v => v ^ f)}>
<button
type="button"
className={classNames("icon-sm transparent", { active: active })}
onClick={() => setFilter(v => v ^ f)}>
<Icon name={icon} className={active ? iconActiveClass : undefined} />
</div>
</button>
);
};