Skip to content

Commit

Permalink
frontend linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jennymar committed Jun 29, 2024
1 parent 0a24933 commit e6564fe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
28 changes: 9 additions & 19 deletions frontend/src/components/EventSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,6 @@ const EventSidebar = ({
const [warningOpen, setWarningOpen] = useState(false);
const [showAlert, setShowAlert] = useState(false);

// useEffect(() => {
// if (date && startTime && endTime) {
// const [startHour, startMinute] = startTime.split(":");
// const [endHour, endMinute] = endTime.split(":");
// const updatedStartDate = new Date(date);
// const updatedEndDate = new Date(date);

// updatedStartDate.setHours(parseInt(startHour), parseInt(startMinute));
// updatedEndDate.setHours(parseInt(endHour), parseInt(endMinute));

// setDate(updatedStartDate);
// setEndTime(
// updatedEndDate.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" }),
// );
// }
// }, [startTime, endTime]);

const confirmCancel = () => {
setName(eventDetails ? eventDetails.name : "");
setDescription(eventDetails ? eventDetails.description : "");
Expand Down Expand Up @@ -427,7 +410,12 @@ const EventSidebar = ({
<p>Cancel</p>
</button>
{/* Save button */}
<button onClick={handleSave} className={styles.saveButton}>
<button
onClick={() => {
void handleSave();
}}
className={styles.saveButton}
>
<p>Save</p>
</button>
</div>
Expand All @@ -441,7 +429,9 @@ const EventSidebar = ({
cancelText="Discard changes"
actionText="Save changes"
cancel={confirmCancel}
action={handleSave}
action={() => {
void handleSave();
}}
onClose={() => {
setWarningOpen(false);
}}
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/components/NewsletterSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ const NewsletterSidebar = ({
cancelText="Discard changes"
actionText="Save changes"
cancel={confirmCancel}
action={handleSave}
action={() => {
void handleSave();
}}
onClose={() => {
setWarningOpen(false);
}}
Expand Down Expand Up @@ -288,7 +290,12 @@ const NewsletterSidebar = ({
<p>Cancel</p>
</button>
{/* Save button */}
<button onClick={handleSave} className={styles.saveButton}>
<button
onClick={() => {
setIsEditing(true);
}}
className={styles.saveButton}
>
<p>Save</p>
</button>
</div>
Expand Down

0 comments on commit e6564fe

Please sign in to comment.