mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 15:35:35 +00:00
refactor: recreate collection and global hotkey contexts as store (using zustand)
This commit is contained in:
@@ -4,7 +4,7 @@ import CollectionHeader from '~/components/dashboard/collection/header/collectio
|
||||
import LinkList from '~/components/dashboard/link/link_list';
|
||||
import { NoCollection } from '~/components/dashboard/link/no_item';
|
||||
import Footer from '~/components/footer/footer';
|
||||
import useActiveCollection from '~/hooks/use_active_collection';
|
||||
import { useActiveCollection } from '~/store/collection_store';
|
||||
|
||||
export interface CollectionHeaderProps {
|
||||
showButtons: boolean;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import styled from '@emotion/styled';
|
||||
import TextEllipsis from '~/components/common/text_ellipsis';
|
||||
import useActiveCollection from '~/hooks/use_active_collection';
|
||||
import { useActiveCollection } from '~/store/collection_store';
|
||||
|
||||
const CollectionDescriptionStyle = styled.div({
|
||||
width: '100%',
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CollectionHeaderProps } from '~/components/dashboard/collection/collect
|
||||
import CollectionControls from '~/components/dashboard/collection/header/collection_controls';
|
||||
import CollectionDescription from '~/components/dashboard/collection/header/collection_description';
|
||||
import VisibilityBadge from '~/components/visibilty/visibilty';
|
||||
import useActiveCollection from '~/hooks/use_active_collection';
|
||||
import { useActiveCollection } from '~/store/collection_store';
|
||||
|
||||
const paddingLeft = '1.25em';
|
||||
const paddingRight = '1.65em';
|
||||
|
||||
@@ -5,8 +5,8 @@ import { useEffect, useRef } from 'react';
|
||||
import { AiFillFolderOpen, AiOutlineFolder } from 'react-icons/ai';
|
||||
import TextEllipsis from '~/components/common/text_ellipsis';
|
||||
import { Item } from '~/components/dashboard/side_nav/nav_item';
|
||||
import useActiveCollection from '~/hooks/use_active_collection';
|
||||
import { appendCollectionId } from '~/lib/navigation';
|
||||
import { useActiveCollection } from '~/store/collection_store';
|
||||
import { CollectionWithLinks } from '~/types/app';
|
||||
|
||||
const CollectionItemStyle = styled(Item, {
|
||||
|
||||
@@ -2,9 +2,8 @@ import styled from '@emotion/styled';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import CollectionItem from '~/components/dashboard/collection/list/collection_item';
|
||||
import CollectionListContainer from '~/components/dashboard/collection/list/collection_list_container';
|
||||
import useActiveCollection from '~/hooks/use_active_collection';
|
||||
import useCollections from '~/hooks/use_collections';
|
||||
import useShortcut from '~/hooks/use_shortcut';
|
||||
import { useActiveCollection, useCollections } from '~/store/collection_store';
|
||||
|
||||
const SideMenu = styled.nav(({ theme }) => ({
|
||||
height: '100%',
|
||||
|
||||
Reference in New Issue
Block a user