From b19bca49f040882e412dfc24f196974de2c381b3 Mon Sep 17 00:00:00 2001 From: sasszz Date: Thu, 23 Jan 2025 12:10:08 -0800 Subject: [PATCH 01/12] Init Commit + Notes + Example Input --- .../components/manageProjects/eventForm.jsx | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/client/src/components/manageProjects/eventForm.jsx b/client/src/components/manageProjects/eventForm.jsx index f075575dd..a7bb40616 100644 --- a/client/src/components/manageProjects/eventForm.jsx +++ b/client/src/components/manageProjects/eventForm.jsx @@ -1,5 +1,6 @@ import React from 'react'; import { createClockHours } from '../../utils/createClockHours'; +import { TextField } from '@mui/material'; import '../../sass/ManageProjects.scss'; const EventForm = ({ @@ -14,20 +15,36 @@ const EventForm = ({ return (
{title &&

{title}

} - + + +
{children} From a752351e7e749d5fb93511172ac8042d43036b35 Mon Sep 17 00:00:00 2001 From: sasszz Date: Tue, 28 Jan 2025 18:39:43 -0800 Subject: [PATCH 02/12] Clean up + CSS Refactor + Full MUI Event Form --- .../manageProjects/createNewEvent.jsx | 3 +- .../components/manageProjects/eventForm.jsx | 148 ------------------ .../manageProjects/eventForm/EventForm.scss | 27 ++++ .../manageProjects/eventForm/eventForm.jsx | 136 ++++++++++++++++ .../manageProjects/eventForm/index.ts | 1 + client/src/sass/CheckIn.scss | 59 +++---- client/src/sass/ManageProjects.scss | 68 -------- 7 files changed, 197 insertions(+), 245 deletions(-) delete mode 100644 client/src/components/manageProjects/eventForm.jsx create mode 100644 client/src/components/manageProjects/eventForm/EventForm.scss create mode 100644 client/src/components/manageProjects/eventForm/eventForm.jsx create mode 100644 client/src/components/manageProjects/eventForm/index.ts diff --git a/client/src/components/manageProjects/createNewEvent.jsx b/client/src/components/manageProjects/createNewEvent.jsx index a74c8526d..3ae80103b 100644 --- a/client/src/components/manageProjects/createNewEvent.jsx +++ b/client/src/components/manageProjects/createNewEvent.jsx @@ -5,7 +5,7 @@ import { findNextOccuranceOfDay } from './utilities/findNextDayOccuranceOfDay'; import { addDurationToTime } from './utilities/addDurationToTime'; import { timeConvertFromForm } from './utilities/timeConvertFromForm'; import validateEventForm from './utilities/validateEventForm'; -import EventForm from './eventForm'; +import EventForm from './eventForm/eventForm'; const CreateNewEvent = ({ projectToEdit, @@ -30,6 +30,7 @@ const CreateNewEvent = ({ // Handle form input changes const handleInputChange = (event) => { setFormValues({ ...formValues, [event.target.name]: event.target.value }); + console.log(event.target.value); }; const handleEventCreate = () => { diff --git a/client/src/components/manageProjects/eventForm.jsx b/client/src/components/manageProjects/eventForm.jsx deleted file mode 100644 index a7bb40616..000000000 --- a/client/src/components/manageProjects/eventForm.jsx +++ /dev/null @@ -1,148 +0,0 @@ -import React from 'react'; -import { createClockHours } from '../../utils/createClockHours'; -import { TextField } from '@mui/material'; -import '../../sass/ManageProjects.scss'; - -const EventForm = ({ - title, - formValues, - formErrors, - handleInputChange, - children, -}) => { - // This creates the clock hours for the form - const clockHours = createClockHours(); - return ( -
- {title &&

{title}

} - - - -
- - -
-
- - -
- - - - {children} -
- ); -}; - -export default EventForm; diff --git a/client/src/components/manageProjects/eventForm/EventForm.scss b/client/src/components/manageProjects/eventForm/EventForm.scss new file mode 100644 index 000000000..a1f220281 --- /dev/null +++ b/client/src/components/manageProjects/eventForm/EventForm.scss @@ -0,0 +1,27 @@ +.event-form-box { + min-width: 100%; + min-height: 540px; + padding: 10px; + position: relative; + border: solid black 2px; + display: flex; + flex-direction: column; + gap: 20px; + background-color: white; +} + +.event-form-title { + font-size: 20px; +} + +.event-form-row { + display: flex; + flex-direction: row; + gap: 16px; +} + +.event-form-error { + color: red; + margin-bottom: 10px; +} + diff --git a/client/src/components/manageProjects/eventForm/eventForm.jsx b/client/src/components/manageProjects/eventForm/eventForm.jsx new file mode 100644 index 000000000..0d88c999a --- /dev/null +++ b/client/src/components/manageProjects/eventForm/eventForm.jsx @@ -0,0 +1,136 @@ +import React from 'react'; +import { createClockHours } from '../../../utils/createClockHours'; +import { + TextField, + MenuItem, + Select, + InputLabel, + FormControl, + Box, +} from '@mui/material'; +import './EventForm.scss'; + +const EventForm = ({ + title, + formValues, + formErrors, + handleInputChange, + children, +}) => { + // This creates the clock hours for the form + const clockHours = createClockHours(); + + return ( +
+ {title &&

{title}

} + +
+ + Event Type + + + + Day of the Week + + +
+
+ + Start Time + + + + Duration + + +
+
+ +
+
+ +
+ + {children} +
+ ); +}; + +export default EventForm; diff --git a/client/src/components/manageProjects/eventForm/index.ts b/client/src/components/manageProjects/eventForm/index.ts new file mode 100644 index 000000000..278568617 --- /dev/null +++ b/client/src/components/manageProjects/eventForm/index.ts @@ -0,0 +1 @@ +export { default } from './eventForm'; diff --git a/client/src/sass/CheckIn.scss b/client/src/sass/CheckIn.scss index 694f1bd70..b4cca11be 100644 --- a/client/src/sass/CheckIn.scss +++ b/client/src/sass/CheckIn.scss @@ -62,34 +62,37 @@ label { font-weight: bold; } -input[type=text], input[type=email] { - -webkit-appearance: none; - max-width: 310px; - width: 310px; - height: 36px; - outline: none; - background-color: inherit; - border-top: none; - border-right: none; - border-bottom: 3px solid black; - border-left: none; - border-radius: 2px; - font-size: 24px; - padding: 0 4px; - margin: 4px 0px; - color: rgb(250, 17, 79); - font-weight: bold; - transition: all .3s ease-in-out; - - &::placeholder { - color: rgb(250, 17, 79); - font-weight: 200; - } - - &:focus { - border-color: rgb(250, 17, 79); - } -} +// Following styles apply to all text fields including Material UI component +// Global styles help with UI consistency but can lead to style conflicts + +// input[type=text], input[type=email] { +// -webkit-appearance: none; +// max-width: 310px; +// width: 310px; +// height: 36px; +// outline: none; +// background-color: inherit; +// border-top: none; +// border-right: none; +// border-bottom: 3px solid black; +// border-left: none; +// border-radius: 2px; +// font-size: 24px; +// padding: 0 4px; +// margin: 4px 0px; +// color: rgb(250, 17, 79); +// font-weight: bold; +// transition: all .3s ease-in-out; + +// &::placeholder { +// color: rgb(250, 17, 79); +// font-weight: 200; +// } + +// &:focus { +// border-color: rgb(250, 17, 79); +// } +// } input[type=radio] { transform: scale(1.8); diff --git a/client/src/sass/ManageProjects.scss b/client/src/sass/ManageProjects.scss index 46899a9dc..ebe3914d9 100644 --- a/client/src/sass/ManageProjects.scss +++ b/client/src/sass/ManageProjects.scss @@ -218,74 +218,6 @@ div.editable-field { background-color: white; } -// create new event form on createNewEvent.js -.event-form-box { - min-width: 100%; - min-height: 540px; - padding: 10px; - position: relative; - border: solid black 2px; - display: flex; - flex-direction: column; - background-color: white; -} - -.event-form-box .event-form-title { - font-size: 20px; - margin-bottom: 16px; -} - -.event-form-row { - display: flex; - flex-direction: row; -} - -.event-form-label { - display: block; - margin-top: 4px; - select { - display: block; - } -} - -.event-form-error { - color: red; - margin-bottom: 10px; -} - -.event-form-box input, -textarea { - display: block; - width: 100%; - padding: 2px 0 15px 10px; - margin: 5px 0; - border: 1px; - border-radius: 5px; - font-size: 20px; - color: black; -} - -.event-form-box select { - color: black; - width: 140px; - padding: 6px; - font-size: 16px; - font-weight: bold; - border: 1px solid black; - border-radius: 0px; - margin: 12px; -} - -.event-form-box textarea { - height: 25px; -} - -.event-form-box label { - font-size: 15px; - width: 100%; - display: block; -} - .button-box { margin-top: 10px; } From cee3a81481c31d3a830919c52df1006d29d5dd4d Mon Sep 17 00:00:00 2001 From: sasszz Date: Tue, 28 Jan 2025 21:28:41 -0800 Subject: [PATCH 03/12] Fix text size bug --- .../manageProjects/eventForm/EventForm.scss | 8 +- client/src/sass/CheckIn.scss | 278 +++++++++--------- 2 files changed, 145 insertions(+), 141 deletions(-) diff --git a/client/src/components/manageProjects/eventForm/EventForm.scss b/client/src/components/manageProjects/eventForm/EventForm.scss index a1f220281..38bfee744 100644 --- a/client/src/components/manageProjects/eventForm/EventForm.scss +++ b/client/src/components/manageProjects/eventForm/EventForm.scss @@ -8,6 +8,13 @@ flex-direction: column; gap: 20px; background-color: white; + + // Resets the label text size + // A global variable was interacting with MUI styles and overflowing the label + .MuiInputLabel-root { + font-size: inherit; + } + } .event-form-title { @@ -24,4 +31,3 @@ color: red; margin-bottom: 10px; } - diff --git a/client/src/sass/CheckIn.scss b/client/src/sass/CheckIn.scss index b4cca11be..1151b23e5 100644 --- a/client/src/sass/CheckIn.scss +++ b/client/src/sass/CheckIn.scss @@ -1,165 +1,163 @@ .check-in-container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - z-index: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 1; } .check-in-headers { - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: flex-start; - text-align: left; - width: 300px; - max-width: 300px; + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + text-align: left; + width: 300px; + max-width: 300px; } .check-in-form { - display: flex; - justify-content: center; - align-items: center; - min-height: 30vh; + display: flex; + justify-content: center; + align-items: center; + min-height: 30vh; } .form-check-in { - width: 300px; - max-width: 300px; + width: 300px; + max-width: 300px; } .form-row { - max-width: 300px; - width: 300px; - margin: 6px 0px; - - p { - text-align: left; - font-weight: bold; - letter-spacing: .05em; - } + max-width: 300px; + width: 300px; + margin: 6px 0px; + + p { + text-align: left; + font-weight: bold; + letter-spacing: 0.05em; + } } .last-row { - margin-top: 24px; + margin-top: 24px; } .form-input-text { - display: flex; - flex-direction: column; + display: flex; + flex-direction: column; - label { - font-size: 14px; - font-weight: 100px; - } + label { + font-size: 14px; + font-weight: 100px; + } } label { - max-width: 300px; - width: 300px; - text-align: left; - font-size: 20px; - font-weight: bold; + max-width: 300px; + width: 300px; + text-align: left; + font-size: 20px; + font-weight: bold; } // Following styles apply to all text fields including Material UI component // Global styles help with UI consistency but can lead to style conflicts -// input[type=text], input[type=email] { -// -webkit-appearance: none; -// max-width: 310px; -// width: 310px; -// height: 36px; -// outline: none; -// background-color: inherit; -// border-top: none; -// border-right: none; -// border-bottom: 3px solid black; -// border-left: none; -// border-radius: 2px; -// font-size: 24px; -// padding: 0 4px; -// margin: 4px 0px; -// color: rgb(250, 17, 79); -// font-weight: bold; -// transition: all .3s ease-in-out; - -// &::placeholder { -// color: rgb(250, 17, 79); -// font-weight: 200; -// } - -// &:focus { -// border-color: rgb(250, 17, 79); -// } -// } - -input[type=radio] { - transform: scale(1.8); - margin-right: 24px; - margin-top: 8px; - - &:checked { - background-color: black; - color: black; - } +input[type='text'], +input[type='email'] { + -webkit-appearance: none; + // max-width: 310px; + // width: 310px; + // height: 36px; + outline: none; + background-color: inherit; + border-top: none; + border-right: none; + border-bottom: 3px solid black; + border-left: none; + border-radius: 2px; + font-size: 24px; + // padding: 0 4px; + margin: 4px 0px; + color: rgb(250, 17, 79); + font-weight: bold; + transition: all 0.3s ease-in-out; + + &::placeholder { + color: rgb(250, 17, 79); + font-weight: 200; + } - &:checked:after { - background-color: black; - color: black; - } + &:focus { + border-color: rgb(250, 17, 79); + } } -.form-input-radio { - display: flex; - flex-direction: column; - justify-content: center; - align-content: center; - margin: 4px; +input[type='radio'] { + transform: scale(1.8); + margin-right: 24px; + margin-top: 8px; + + &:checked { + background-color: black; + color: black; + } + + &:checked:after { + background-color: black; + color: black; + } +} +.form-input-radio { + display: flex; + flex-direction: column; + justify-content: center; + align-content: center; + margin: 4px; } .radio-buttons { - display: flex; - justify-content: space-around; + display: flex; + justify-content: space-around; } .first-time-select { - margin: 8px; + margin: 8px; } - .form-input-button { - display: flex; - justify-content: center; - align-items: center; - width: 300px; - height: 40px; - margin-top: 20px; - margin-bottom: 36px; - button { - border: 3px solid black; - border-radius: 4px; - font-weight: bold; - font-size: 18px; - font-weight: bold; - transition: all .3s ease-in-out; - - &:hover { - background-color: black; - color: white; - } - &:disabled { - color: #bbb; - border-color: #bbb; - pointer-events: none; - } - + display: flex; + justify-content: center; + align-items: center; + width: 300px; + height: 40px; + margin-top: 20px; + margin-bottom: 36px; + button { + border: 3px solid black; + border-radius: 4px; + font-weight: bold; + font-size: 18px; + font-weight: bold; + transition: all 0.3s ease-in-out; + + &:hover { + background-color: black; + color: white; + } + &:disabled { + color: #bbb; + border-color: #bbb; + pointer-events: none; } + } } input:-webkit-autofill, -input:-webkit-autofill:hover, +input:-webkit-autofill:hover, input:-webkit-autofill:focus, textarea:-webkit-autofill, textarea:-webkit-autofill:hover, @@ -175,33 +173,33 @@ select:-webkit-autofill:focus { } select { - width: 140px; - padding: 6px; - font-size: 16px; - font-weight: bold; - color: rgb(250, 17, 79); - background-color: inherit; - border: 3px solid black; - border-radius: 0px; - margin: 12px; - - &:focus { - border: 3px solid rgb(250, 17, 79); - outline: none; - } + width: 140px; + padding: 6px; + font-size: 16px; + font-weight: bold; + color: rgb(250, 17, 79); + background-color: inherit; + border: 3px solid black; + border-radius: 0px; + margin: 12px; + + &:focus { + border: 3px solid rgb(250, 17, 79); + outline: none; + } } .select-reason { - display: flex; - justify-content: space-around; - margin: 8px; + display: flex; + justify-content: space-around; + margin: 8px; - select { - min-width: 280px; - } + select { + min-width: 280px; + } } .block { - pointer-events: none; - opacity: .4; -} \ No newline at end of file + pointer-events: none; + opacity: 0.4; +} From 7c6b846aa9e441c44deac94115542ce4bb63c11a Mon Sep 17 00:00:00 2001 From: sasszz Date: Wed, 29 Jan 2025 21:39:35 -0800 Subject: [PATCH 04/12] Final Version + Clean Up --- .../manageProjects/createNewEvent.jsx | 5 +- .../manageProjects/editableMeeting.jsx | 1 + .../manageProjects/eventForm/EventForm.scss | 8 ++- .../manageProjects/eventForm/eventForm.jsx | 72 ++++++++++++------- client/src/pages/ManageProjects.jsx | 2 + 5 files changed, 58 insertions(+), 30 deletions(-) diff --git a/client/src/components/manageProjects/createNewEvent.jsx b/client/src/components/manageProjects/createNewEvent.jsx index 3ae80103b..2b704e61a 100644 --- a/client/src/components/manageProjects/createNewEvent.jsx +++ b/client/src/components/manageProjects/createNewEvent.jsx @@ -19,10 +19,11 @@ const CreateNewEvent = ({ eventType: 'Team Meeting', description: '', videoConferenceLink: '', - day: '0', + day: new Date().getDay().toString(), // sets initial date value to user's current day in their local time startTime: '7:00pm', duration: '1', }; + const [formValues, setFormValues] = useState(initialFormValues); const [formErrors, setFormErrors] = useState({}); const { showSnackbar } = useSnackbar(); @@ -30,7 +31,6 @@ const CreateNewEvent = ({ // Handle form input changes const handleInputChange = (event) => { setFormValues({ ...formValues, [event.target.name]: event.target.value }); - console.log(event.target.value); }; const handleEventCreate = () => { @@ -83,6 +83,7 @@ const CreateNewEvent = ({ } setFormErrors(errors); }; + return (