mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-18 21:19:44 +00:00
chore: fix navigator tags
This commit is contained in:
parent
4a47010608
commit
0eea0a92db
@ -1,5 +1,4 @@
|
|||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { uniq } from "lodash-es";
|
|
||||||
import { useAppSelector } from "../stores";
|
import { useAppSelector } from "../stores";
|
||||||
import useViewStore from "../stores/v1/view";
|
import useViewStore from "../stores/v1/view";
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
@ -7,7 +6,7 @@ import Icon from "./Icon";
|
|||||||
const Navigator = () => {
|
const Navigator = () => {
|
||||||
const viewStore = useViewStore();
|
const viewStore = useViewStore();
|
||||||
const { shortcutList } = useAppSelector((state) => state.shortcut);
|
const { shortcutList } = useAppSelector((state) => state.shortcut);
|
||||||
const tags = uniq(shortcutList.map((shortcut) => shortcut.tags).flat());
|
const tags = shortcutList.map((shortcut) => shortcut.tags).flat();
|
||||||
const currentTab = viewStore.filter.tab || `tab:all`;
|
const currentTab = viewStore.filter.tab || `tab:all`;
|
||||||
const sortedTagMap = sortTags(tags);
|
const sortedTagMap = sortTags(tags);
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ const Navigator = () => {
|
|||||||
)}
|
)}
|
||||||
onClick={() => viewStore.setFilter({ tab: `tag:${tag}`, tag: undefined })}
|
onClick={() => viewStore.setFilter({ tab: `tag:${tag}`, tag: undefined })}
|
||||||
>
|
>
|
||||||
<Icon.Hash className="w-4 h-auto mr-1" />
|
<Icon.Hash className="w-4 h-auto mr-0.5" />
|
||||||
<span className="max-w-[8rem] truncate font-normal">{tag}</span>
|
<span className="max-w-[8rem] truncate font-normal">{tag}</span>
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user