From 568c737a336358a9167d109f0381e6d8719d8955 Mon Sep 17 00:00:00 2001 From: Rustem Mussabekov Date: Tue, 14 Jan 2025 16:40:59 +0300 Subject: [PATCH] Split existing and new tags in tags suggestions --- package.json | 2 +- .../edit/form/collection/suggested.js | 10 +++++-- .../form/collection/suggested.module.styl | 16 +++-------- src/co/bookmarks/edit/form/tags/suggested.js | 27 ++++++++++++++----- .../edit/form/tags/suggested.module.styl | 10 +++---- src/co/common/button/index.module.styl | 1 + src/data/reducers/bookmarks/index.js | 2 +- src/data/reducers/bookmarks/single.js | 4 +-- src/data/sagas/bookmarks/single.js | 5 ++-- src/data/selectors/bookmarks/single.js | 7 +++-- 10 files changed, 50 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index a26300b4..b42a9a69 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "5.6.68", + "version": "5.6.69", "description": "All-in-one bookmark manager", "author": "Rustem Mussabekov", "license": "MIT", diff --git a/src/co/bookmarks/edit/form/collection/suggested.js b/src/co/bookmarks/edit/form/collection/suggested.js index 3bc22b74..fe2fce50 100644 --- a/src/co/bookmarks/edit/form/collection/suggested.js +++ b/src/co/bookmarks/edit/form/collection/suggested.js @@ -1,5 +1,5 @@ import s from './suggested.module.styl' -import React, { useMemo, useCallback } from 'react' +import React, { useState, useMemo, useCallback } from 'react' import { useSelector } from 'react-redux' import { makeSuggestedFields } from '~data/selectors/bookmarks' import { makeCollectionPath } from '~data/selectors/collections' @@ -43,6 +43,10 @@ export default function BookmarkEditFormCollectionSuggested({ item, events: { on const getSuggestedFields = useMemo(()=>makeSuggestedFields(), []) const { collections=[] } = useSelector(state=>getSuggestedFields(state, item)) + //expand + const [expanded, setExpanded] = useState(false) + const onMouseOver = useCallback(()=>setExpanded(true), []) + //click const onSuggestionClick = useCallback(e=>{ const _id = parseInt(e.currentTarget.getAttribute('data-id')) @@ -55,7 +59,9 @@ export default function BookmarkEditFormCollectionSuggested({ item, events: { on return (
+ data-expanded={expanded} + data-is-new={item.collectionId <= 0} + onMouseOver={onMouseOver}> {collections.map(id=>(