Revert "feat: allows duplicate names in tags folder & smart tags (#792)"
This reverts commit a165fa9b4e.
This commit is contained in:
@@ -21,9 +21,6 @@ export const AutocompleteTagResult = observer(
|
||||
|
||||
const tagResultRef = useRef<HTMLButtonElement>(null);
|
||||
|
||||
const title = tagResult.title;
|
||||
const prefixTitle = appState.noteTags.getPrefixTitle(tagResult);
|
||||
|
||||
const onTagOptionClick = async (tag: SNTag) => {
|
||||
await appState.noteTags.addTagToActiveNote(tag);
|
||||
appState.noteTags.clearAutocompleteSearch();
|
||||
@@ -89,10 +86,9 @@ export const AutocompleteTagResult = observer(
|
||||
>
|
||||
<Icon type="hashtag" className="color-neutral mr-2 min-h-5 min-w-5" />
|
||||
<span className="whitespace-nowrap overflow-hidden overflow-ellipsis">
|
||||
{prefixTitle && <span className="grey-2">{prefixTitle}</span>}
|
||||
{autocompleteSearchQuery === ''
|
||||
? title
|
||||
: title
|
||||
? tagResult.title
|
||||
: tagResult.title
|
||||
.split(new RegExp(`(${autocompleteSearchQuery})`, 'gi'))
|
||||
.map((substring, index) => (
|
||||
<span
|
||||
|
||||
@@ -10,9 +10,7 @@ type Props = {
|
||||
};
|
||||
|
||||
export const NoteTag = observer(({ appState, tag }: Props) => {
|
||||
const noteTags = appState.noteTags;
|
||||
|
||||
const { autocompleteInputFocused, focusedTagUuid, tags } = noteTags;
|
||||
const { autocompleteInputFocused, focusedTagUuid, tags } = appState.noteTags;
|
||||
|
||||
const [showDeleteButton, setShowDeleteButton] = useState(false);
|
||||
const [tagClicked, setTagClicked] = useState(false);
|
||||
@@ -20,10 +18,6 @@ export const NoteTag = observer(({ appState, tag }: Props) => {
|
||||
|
||||
const tagRef = useRef<HTMLButtonElement>(null);
|
||||
|
||||
const title = tag.title;
|
||||
const prefixTitle = noteTags.getPrefixTitle(tag);
|
||||
const longTitle = noteTags.getLongTitle(tag);
|
||||
|
||||
const deleteTag = () => {
|
||||
appState.noteTags.focusPreviousTag(tag);
|
||||
appState.noteTags.removeTagFromActiveNote(tag);
|
||||
@@ -103,12 +97,10 @@ export const NoteTag = observer(({ appState, tag }: Props) => {
|
||||
onFocus={onFocus}
|
||||
onBlur={onBlur}
|
||||
tabIndex={getTabIndex()}
|
||||
title={longTitle}
|
||||
>
|
||||
<Icon type="hashtag" className="sn-icon--small color-info mr-1" />
|
||||
<span className="whitespace-nowrap overflow-hidden overflow-ellipsis max-w-290px">
|
||||
{prefixTitle && <span className="color-grey-1">{prefixTitle}</span>}
|
||||
{title}
|
||||
{tag.title}
|
||||
</span>
|
||||
{showDeleteButton && (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user