From 22297ff51470047c1d5e9a0ca408beaba99fa546 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Mon, 22 May 2023 23:24:16 +0530 Subject: [PATCH] chore: pinned note ui change --- .../ContentListView/ListItemFlagIcons.tsx | 10 ++------ .../ListItemNotePreviewText.tsx | 9 +++++-- .../ContentListView/ListItemTitle.tsx | 24 ++++++++++++------- .../ContentListView/NoteListItem.tsx | 13 +--------- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/packages/web/src/javascripts/Components/ContentListView/ListItemFlagIcons.tsx b/packages/web/src/javascripts/Components/ContentListView/ListItemFlagIcons.tsx index 1b28b59f2..cfa8493f8 100644 --- a/packages/web/src/javascripts/Components/ContentListView/ListItemFlagIcons.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/ListItemFlagIcons.tsx @@ -1,6 +1,7 @@ import { FunctionComponent } from 'react' import Icon from '@/Components/Icon/Icon' import { ListableContentItem } from './Types/ListableContentItem' +import { classNames } from '@standardnotes/snjs' type Props = { item: { @@ -10,7 +11,6 @@ type Props = { pinned: ListableContentItem['pinned'] starred: ListableContentItem['starred'] } - hideIcon?: boolean hasFiles?: boolean hasBorder?: boolean isFileBackedUp?: boolean @@ -19,14 +19,13 @@ type Props = { const ListItemFlagIcons: FunctionComponent = ({ item, - hideIcon = false, hasFiles = false, hasBorder = true, isFileBackedUp = false, className, }) => { return ( -
+
{item.locked && ( @@ -42,11 +41,6 @@ const ListItemFlagIcons: FunctionComponent = ({ )} - {hideIcon && item.pinned && ( - - - - )} {hasFiles && ( diff --git a/packages/web/src/javascripts/Components/ContentListView/ListItemNotePreviewText.tsx b/packages/web/src/javascripts/Components/ContentListView/ListItemNotePreviewText.tsx index 379d40308..271971665 100644 --- a/packages/web/src/javascripts/Components/ContentListView/ListItemNotePreviewText.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/ListItemNotePreviewText.tsx @@ -1,4 +1,4 @@ -import { sanitizeHtmlString, SNNote } from '@standardnotes/snjs' +import { classNames, sanitizeHtmlString, SNNote } from '@standardnotes/snjs' import { FunctionComponent } from 'react' type Props = { @@ -13,7 +13,12 @@ const ListItemNotePreviewText: FunctionComponent = ({ item, hidePreview, } return ( -
+
{item.preview_html && (
= ({ item }) => { return ( - <> -
- {item.title} -
- +
+ {item.pinned && ( + + + + )} + {item.title} +
) } diff --git a/packages/web/src/javascripts/Components/ContentListView/NoteListItem.tsx b/packages/web/src/javascripts/Components/ContentListView/NoteListItem.tsx index be4b27423..5e104f93f 100644 --- a/packages/web/src/javascripts/Components/ContentListView/NoteListItem.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/NoteListItem.tsx @@ -85,11 +85,6 @@ const NoteListItem: FunctionComponent> = ({ {!hideIcon ? (
- {item.pinned && ( -
- -
- )}
) : (
@@ -101,13 +96,7 @@ const NoteListItem: FunctionComponent> = ({
- +
) }