refactor: remove react-hotkeys-hook and use inertia propos instead of recreating a local store

This commit is contained in:
Sonny
2025-08-19 23:47:52 +02:00
parent 1d1e182523
commit 42f391d99a
16 changed files with 122 additions and 182 deletions

View File

@@ -3,8 +3,8 @@ import { route } from '@izzyjs/route/client';
import { Text } from '@mantine/core';
import { useEffect, useRef } from 'react';
import { AiFillFolderOpen, AiOutlineFolder } from 'react-icons/ai';
import { useActiveCollection } from '~/hooks/collections/use_active_collection';
import { appendCollectionId } from '~/lib/navigation';
import { useActiveCollection } from '~/stores/collection_store';
import { CollectionWithLinks } from '~/types/app';
import classes from './collection_item.module.css';
@@ -14,7 +14,7 @@ export default function CollectionItem({
collection: CollectionWithLinks;
}) {
const itemRef = useRef<HTMLAnchorElement>(null);
const { activeCollection } = useActiveCollection();
const activeCollection = useActiveCollection();
const isActiveCollection = collection.id === activeCollection?.id;
const FolderIcon = isActiveCollection ? AiFillFolderOpen : AiOutlineFolder;