Skip to content

Commit

Permalink
fix: notes list item layout when title is empty (#850)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara authored Feb 7, 2022
1 parent a05075d commit 9932c2a
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 55 deletions.
78 changes: 39 additions & 39 deletions app/assets/javascripts/components/NotesListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,45 +95,7 @@ export const NotesListItem: FunctionComponent<Props> = ({
)}
<div className={`meta ${hideEditorIcon ? 'icon-hidden' : ''}`}>
<div className="name-container">
<div className="name">{note.title}</div>
<div className="flag-icons">
{note.locked && (
<span title="Editing Disabled">
<Icon
ariaLabel="Editing Disabled"
type="pencil-off"
className="sn-icon--small color-info"
/>
</span>
)}
{note.trashed && (
<span title="Trashed">
<Icon
ariaLabel="Trashed"
type="trash-filled"
className="sn-icon--small color-danger"
/>
</span>
)}
{note.archived && (
<span title="Archived">
<Icon
ariaLabel="Archived"
type="archive"
className="sn-icon--mid color-accessory-tint-3"
/>
</span>
)}
{note.pinned && (
<span title="Pinned">
<Icon
ariaLabel="Pinned"
type="pin-filled"
className="sn-icon--small color-info"
/>
</span>
)}
</div>
{note.title.length ? <div className="name">{note.title}</div> : null}
</div>
{!hidePreview && !note.hidePreview && !note.protected && (
<div className="note-preview">
Expand Down Expand Up @@ -187,6 +149,44 @@ export const NotesListItem: FunctionComponent<Props> = ({
</div>
) : null}
</div>
<div className="flag-icons">
{note.locked && (
<span title="Editing Disabled">
<Icon
ariaLabel="Editing Disabled"
type="pencil-off"
className="sn-icon--small color-info"
/>
</span>
)}
{note.trashed && (
<span title="Trashed">
<Icon
ariaLabel="Trashed"
type="trash-filled"
className="sn-icon--small color-danger"
/>
</span>
)}
{note.archived && (
<span title="Archived">
<Icon
ariaLabel="Archived"
type="archive"
className="sn-icon--mid color-accessory-tint-3"
/>
</span>
)}
{note.pinned && (
<span title="Pinned">
<Icon
ariaLabel="Pinned"
type="pin-filled"
className="sn-icon--small color-info"
/>
</span>
)}
</div>
</div>
);
};
33 changes: 17 additions & 16 deletions app/assets/stylesheets/_notes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@
.meta {
flex-grow: 1;
min-width: 0;
padding: 1rem;
padding-left: 0;
padding: 1rem 0;
border-bottom: 1px solid var(--sn-stylekit-border-color);

&.icon-hidden {
Expand All @@ -152,27 +151,29 @@
margin-right: 0.5rem;
}

.flag-icons {
padding: 0.135rem 0;

&,
& > * {
display: flex;
align-items: center;
}

& > * + * {
margin-left: 0.375rem;
}
}

.bottom-info {
font-size: 12px;
line-height: 1.4;
margin-top: 0.25rem;
}
}

.flag-icons {
display: flex;
align-items: flex-start;
padding: 1rem;
padding-left: 0;

& > * {
display: flex;
align-items: center;
}

& > * + * {
margin-left: 0.375rem;
}
}

.tags-string {
display: flex;
flex-wrap: wrap;
Expand Down

0 comments on commit 9932c2a

Please sign in to comment.