chore: pinned note ui change
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { FunctionComponent } from 'react'
|
import { FunctionComponent } from 'react'
|
||||||
import Icon from '@/Components/Icon/Icon'
|
import Icon from '@/Components/Icon/Icon'
|
||||||
import { ListableContentItem } from './Types/ListableContentItem'
|
import { ListableContentItem } from './Types/ListableContentItem'
|
||||||
|
import { classNames } from '@standardnotes/snjs'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
item: {
|
item: {
|
||||||
@@ -10,7 +11,6 @@ type Props = {
|
|||||||
pinned: ListableContentItem['pinned']
|
pinned: ListableContentItem['pinned']
|
||||||
starred: ListableContentItem['starred']
|
starred: ListableContentItem['starred']
|
||||||
}
|
}
|
||||||
hideIcon?: boolean
|
|
||||||
hasFiles?: boolean
|
hasFiles?: boolean
|
||||||
hasBorder?: boolean
|
hasBorder?: boolean
|
||||||
isFileBackedUp?: boolean
|
isFileBackedUp?: boolean
|
||||||
@@ -19,14 +19,13 @@ type Props = {
|
|||||||
|
|
||||||
const ListItemFlagIcons: FunctionComponent<Props> = ({
|
const ListItemFlagIcons: FunctionComponent<Props> = ({
|
||||||
item,
|
item,
|
||||||
hideIcon = false,
|
|
||||||
hasFiles = false,
|
hasFiles = false,
|
||||||
hasBorder = true,
|
hasBorder = true,
|
||||||
isFileBackedUp = false,
|
isFileBackedUp = false,
|
||||||
className,
|
className,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div className={`flex items-start ${hasBorder && 'border-b border-solid border-border'} ${className} pl-0`}>
|
<div className={classNames('flex items-start pl-0', hasBorder && 'border-b border-solid border-border', className)}>
|
||||||
{item.locked && (
|
{item.locked && (
|
||||||
<span className="flex items-center" title="Editing Disabled">
|
<span className="flex items-center" title="Editing Disabled">
|
||||||
<Icon ariaLabel="Editing Disabled" type="pencil-off" className="text-info" size="medium" />
|
<Icon ariaLabel="Editing Disabled" type="pencil-off" className="text-info" size="medium" />
|
||||||
@@ -42,11 +41,6 @@ const ListItemFlagIcons: FunctionComponent<Props> = ({
|
|||||||
<Icon ariaLabel="Archived" type="archive" className="text-accessory-tint-3" size="medium" />
|
<Icon ariaLabel="Archived" type="archive" className="text-accessory-tint-3" size="medium" />
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{hideIcon && item.pinned && (
|
|
||||||
<span className="ml-1.5 flex items-center" title="Pinned">
|
|
||||||
<Icon ariaLabel="Pinned" type="pin-filled" className="text-info" size="medium" />
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{hasFiles && (
|
{hasFiles && (
|
||||||
<span className="ml-1.5 flex items-center" title="Files">
|
<span className="ml-1.5 flex items-center" title="Files">
|
||||||
<Icon ariaLabel="Files" type="attachment-file" className="text-info" size="medium" />
|
<Icon ariaLabel="Files" type="attachment-file" className="text-info" size="medium" />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { sanitizeHtmlString, SNNote } from '@standardnotes/snjs'
|
import { classNames, sanitizeHtmlString, SNNote } from '@standardnotes/snjs'
|
||||||
import { FunctionComponent } from 'react'
|
import { FunctionComponent } from 'react'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -13,7 +13,12 @@ const ListItemNotePreviewText: FunctionComponent<Props> = ({ item, hidePreview,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`overflow-hidden overflow-ellipsis text-base lg:text-sm ${item.archived ? 'opacity-60' : ''}`}>
|
<div
|
||||||
|
className={classNames(
|
||||||
|
'overflow-hidden overflow-ellipsis text-base lg:text-sm',
|
||||||
|
item.archived ? 'opacity-60' : '',
|
||||||
|
)}
|
||||||
|
>
|
||||||
{item.preview_html && (
|
{item.preview_html && (
|
||||||
<div
|
<div
|
||||||
className="my-1"
|
className="my-1"
|
||||||
|
|||||||
@@ -1,16 +1,22 @@
|
|||||||
import { FunctionComponent } from 'react'
|
import { FunctionComponent } from 'react'
|
||||||
import { ListableContentItem } from './Types/ListableContentItem'
|
import { ListableContentItem } from './Types/ListableContentItem'
|
||||||
|
import Icon from '../Icon/Icon'
|
||||||
|
import { classNames } from '@standardnotes/snjs'
|
||||||
|
|
||||||
export const ListItemTitle: FunctionComponent<{ item: ListableContentItem }> = ({ item }) => {
|
export const ListItemTitle: FunctionComponent<{ item: ListableContentItem }> = ({ item }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<div
|
||||||
<div
|
className={classNames(
|
||||||
className={`break-word mr-2 flex items-start justify-between overflow-hidden text-lg font-semibold leading-[1.3] lg:text-base lg:leading-[1.3] ${
|
'break-word mr-2 overflow-hidden text-lg font-semibold leading-[1.3] lg:text-base lg:leading-[1.3]',
|
||||||
item.archived ? 'opacity-60' : ''
|
item.archived ? 'opacity-60' : '',
|
||||||
}`}
|
)}
|
||||||
>
|
>
|
||||||
{item.title}
|
{item.pinned && (
|
||||||
</div>
|
<span className="mr-1.5 inline-flex rounded-full bg-info p-0.5 text-info-contrast">
|
||||||
</>
|
<Icon type="pin-filled" size="custom" className="h-3 w-3" />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{item.title}
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,11 +85,6 @@ const NoteListItem: FunctionComponent<DisplayableListItemProps<SNNote>> = ({
|
|||||||
{!hideIcon ? (
|
{!hideIcon ? (
|
||||||
<div className="mr-0 flex flex-col items-center justify-between gap-2 p-4 pr-4">
|
<div className="mr-0 flex flex-col items-center justify-between gap-2 p-4 pr-4">
|
||||||
<Icon type={icon} className={`text-accessory-tint-${tint}`} />
|
<Icon type={icon} className={`text-accessory-tint-${tint}`} />
|
||||||
{item.pinned && (
|
|
||||||
<div className="rounded-full bg-info p-1 text-info-contrast">
|
|
||||||
<Icon type="pin-filled" size="custom" className="h-3 w-3" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="pr-4" />
|
<div className="pr-4" />
|
||||||
@@ -101,13 +96,7 @@ const NoteListItem: FunctionComponent<DisplayableListItemProps<SNNote>> = ({
|
|||||||
<ListItemTags hideTags={hideTags} tags={tags} />
|
<ListItemTags hideTags={hideTags} tags={tags} />
|
||||||
<ListItemConflictIndicator item={item} />
|
<ListItemConflictIndicator item={item} />
|
||||||
</div>
|
</div>
|
||||||
<ListItemFlagIcons
|
<ListItemFlagIcons className="p-4" item={item} hasFiles={hasFiles} hasBorder={hasOffsetBorder} />
|
||||||
className="p-4"
|
|
||||||
item={item}
|
|
||||||
hideIcon={hideIcon}
|
|
||||||
hasFiles={hasFiles}
|
|
||||||
hasBorder={hasOffsetBorder}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user