From 93f45c738fdd4afa1fa9426e62e27650ee45ea17 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Sat, 13 Feb 2021 10:45:28 +1100 Subject: [PATCH] Changed notes to left aligned and accept more text per line --- src/components/note/Note.js | 8 +++++--- src/components/note/NoteMenu.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/note/Note.js b/src/components/note/Note.js index 4a1aa8d..1aacc4d 100644 --- a/src/components/note/Note.js +++ b/src/components/note/Note.js @@ -11,6 +11,8 @@ import colors from "../../helpers/colors"; import usePrevious from "../../hooks/usePrevious"; import useGridSnapping from "../../hooks/useGridSnapping"; +const minTextSize = 16; + function Note({ note, map, @@ -117,10 +119,10 @@ function Note({ } function findFontSize() { - // Create an array from 1 / 10 of the note height to the full note height + // Create an array from 1 / minTextSize of the note height to the full note height const sizes = Array.from( { length: Math.ceil(noteHeight - notePadding * 2) }, - (_, i) => i + Math.ceil(noteHeight / 10) + (_, i) => i + Math.ceil(noteHeight / minTextSize) ); if (sizes.length > 0) { @@ -203,7 +205,7 @@ function Note({ ? "white" : "black" } - align="center" + align="left" verticalAlign="middle" padding={notePadding} fontSize={fontSize} diff --git a/src/components/note/NoteMenu.js b/src/components/note/NoteMenu.js index 9d30af0..9724c2c 100644 --- a/src/components/note/NoteMenu.js +++ b/src/components/note/NoteMenu.js @@ -53,7 +53,7 @@ function NoteMenu({ }, [isOpen, note, wasOpen, noteNode]); function handleTextChange(event) { - const text = event.target.value.substring(0, 144); + const text = event.target.value.substring(0, 1024); note && onNoteChange({ ...note, text: text }); }