From 9e6bb53ba12978c03d1fb2a4585d7c0b680fc3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Diamond?= <32074058+Andre-Diamond@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:45:40 +0200 Subject: [PATCH] refactor: Update styles for workingDocsTable and typea modules --- components/ActionItem.tsx | 147 +++++++++++--------- components/DecisionItem.tsx | 171 ++++++++++++++---------- components/Item.tsx | 78 +++++++---- components/SummaryAgendaItems.tsx | 4 +- components/SummaryMeetingInfo.tsx | 208 +++++++++++++++-------------- components/SummaryTemplate.tsx | 11 +- components/WorkingDocs.tsx | 4 +- styles/agendaitems.module.css | 79 +++++++++++ styles/globals.css | 44 +++--- styles/items.module.css | 58 ++++++++ styles/meetinginfo.module.css | 73 ++++++++++ styles/meetingsummary.module.css | 43 +++--- styles/summarytemplate.module.css | 67 ++++++++++ styles/typea.module.css | 31 +++-- styles/workingDocsTable.module.css | 40 +++--- 15 files changed, 730 insertions(+), 328 deletions(-) create mode 100644 styles/agendaitems.module.css create mode 100644 styles/items.module.css create mode 100644 styles/meetinginfo.module.css create mode 100644 styles/summarytemplate.module.css diff --git a/components/ActionItem.tsx b/components/ActionItem.tsx index c675bb7..a0c74b8 100644 --- a/components/ActionItem.tsx +++ b/components/ActionItem.tsx @@ -1,5 +1,6 @@ +import { useEffect, useRef } from 'react'; import styles from '../styles/typea.module.css'; -import SelectNames from '../components/SelectNames' +import SelectNames from '../components/SelectNames'; const formatDate = (dateString: any) => { if (!dateString) return ""; @@ -18,67 +19,87 @@ const parseDate = (dateString: any) => { return `${year}-${month.toString().padStart(2, '0')}-${day.padStart(2, '0')}`; }; -const ActionItem = ({ item, itemIndex, handleUpdate, onRemove, agendaIndex, type }: any) => ( +const ActionItem = ({ item, itemIndex, handleUpdate, onRemove, agendaIndex, type }: any) => { + const actionRef = useRef(null); + + // Function to adjust height of the textarea + const adjustTextareaHeight = (textarea: HTMLTextAreaElement | null) => { + if (textarea) { + textarea.style.height = 'auto'; // Reset height + textarea.style.height = `${textarea.scrollHeight}px`; // Set to scrollHeight + } + }; + + // Auto-resize when content changes + useEffect(() => { + adjustTextareaHeight(actionRef.current); + }, [item.text]); + + return (
-
- - handleUpdate('text', e.target.value)} - autoComplete="off" - /> -
-
-
-
- - handleUpdate('assignee', selectedNames)} - initialValue={item.assignee} - /> -
-
- - handleUpdate('dueDate', formatDate(e.target.value))} - /> -
-
- - -
-
-
- -
-
-
- ); +
+ +