Skip to content

Commit

Permalink
fix: plain editor revision rendering and revision list sorting (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara authored Feb 18, 2022
1 parent 1c57b52 commit 1887d5d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ export const NotesOptions = observer(
}}
>
<Icon type="trash" className={iconClass} />
Move to Trash
Move to trash
</button>
))}
{trashed && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const SelectedRevisionContent: FunctionComponent<SelectedRevisionContentP
{!componentViewer && (
<div className="relative flex-grow min-h-0 overflow-x-hidden overflow-y-auto">
{selectedRevision.payload.content.text.length ? (
<p className="p-4 pt-0">
<p className="p-4 pt-0 color-text text-editor font-editor">
{selectedRevision.payload.content.text}
</p>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,17 @@ export const sortRevisionListIntoGroups = <EntryType extends RevisionEntry>(
},
];

const addBeforeLastGroup = (group: ListGroup<EntryType>) => {
sortedGroups.splice(sortedGroups.length - 1, 0, group);
};

revisionList?.forEach((entry) => {
const groupIndex = getGroupIndexForEntry(entry, sortedGroups);

if (groupIndex > -1) {
sortedGroups[groupIndex]?.entries?.push(entry);
} else {
sortedGroups.push({
addBeforeLastGroup({
title: formatDateAsMonthYearString(
new Date(
(entry as RevisionListEntry).created_at ??
Expand Down
4 changes: 4 additions & 0 deletions app/assets/stylesheets/_sn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -946,3 +946,7 @@
.sn-component .border-t-0 {
border-top-width: 0;
}

.text-editor {
font-size: var(--sn-stylekit-font-size-editor);
}

0 comments on commit 1887d5d

Please sign in to comment.