diff --git a/apps/web/src/common/height-calculator.js b/apps/web/src/common/height-calculator.js index ea852cadf..9aedf8c99 100644 --- a/apps/web/src/common/height-calculator.js +++ b/apps/web/src/common/height-calculator.js @@ -11,8 +11,7 @@ function getNoteHeight(item) { const { notebook, headline } = item; let height = SINGLE_LINE_HEIGHT * 3; //if (title.length > 35) height += SINGLE_LINE_HEIGHT; - if (headline?.length > 0) height += SINGLE_LINE_HEIGHT; - if (headline?.length > 50) height += SINGLE_LINE_HEIGHT; + if (headline?.length > 0) height += SINGLE_LINE_HEIGHT * 2; if (notebook) height += SINGLE_LINE_HEIGHT / 2; return height * DEFAULT_FONT_SIZE; @@ -33,11 +32,9 @@ function getNotebookHeight(item) { if (description?.length > 0) { height += SINGLE_LINE_HEIGHT; - } - - if (description?.length > 50) { height += SINGLE_LINE_HEIGHT; } + return height * DEFAULT_FONT_SIZE; } diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.js index cc8fbcb6d..5106445e9 100644 --- a/apps/web/src/components/note/index.js +++ b/apps/web/src/components/note/index.js @@ -126,7 +126,7 @@ function Note(props) { const theme = useTheme(); const color = useMemo(() => COLORS[note.color], [note.color]); const notebook = useMemo( - () => note.notebooks && db.notebooks.notebook(note.notebooks[0].id).data, + () => note.notebooks && db.notebooks.notebook(note.notebooks[0].id)?.data, [note.notebooks] ); @@ -140,7 +140,7 @@ function Note(props) { id={note.id} index={index} header={ - note.notebooks && ( + notebook && (