From 844ccded3c34c67c5e400c8a3652fd53050a1990 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Tue, 8 Mar 2022 16:39:24 -0800 Subject: [PATCH] client: improve rendered post styling; length is 100% if uneditable --- .../components/document/document.module.css | 4 + client/components/document/index.tsx | 28 +++--- client/components/header/header.module.css | 19 ++-- client/components/header/index.tsx | 25 +++--- client/components/preview/index.tsx | 13 +-- .../preview/react-markdown-preview.tsx | 19 ++++ client/pages/index.tsx | 87 +++++++++++-------- 7 files changed, 113 insertions(+), 82 deletions(-) create mode 100644 client/components/preview/react-markdown-preview.tsx diff --git a/client/components/document/document.module.css b/client/components/document/document.module.css index 4ab0dab..ea8cbf6 100644 --- a/client/components/document/document.module.css +++ b/client/components/document/document.module.css @@ -24,3 +24,7 @@ /* Override geist-ui styling */ margin: 0 !important; } + +.textarea { + height: 100%; +} diff --git a/client/components/document/index.tsx b/client/components/document/index.tsx index 6977457..32b273a 100644 --- a/client/components/document/index.tsx +++ b/client/components/document/index.tsx @@ -17,6 +17,7 @@ type Props = { const Document = ({ remove, editable, title, content, setTitle, setContent, initialTab = 'edit' }: Props) => { const codeEditorRef = useRef(null) const [tab, setTab] = useState(initialTab) + const height = editable ? "500px" : '100%' const handleTabChange = (newTab: string) => { if (newTab === 'edit') { @@ -59,20 +60,23 @@ const Document = ({ remove, editable, title, content, setTitle, setContent, init {/* */} -