diff --git a/src/pages/background/lib/deleteSchedule.ts b/src/pages/background/lib/deleteSchedule.ts index 51c6453c..2f627fba 100644 --- a/src/pages/background/lib/deleteSchedule.ts +++ b/src/pages/background/lib/deleteSchedule.ts @@ -17,10 +17,14 @@ export default async function deleteSchedule(scheduleId: string): Promise= schedules.length) { + await UserScheduleStore.set('activeIndex', schedules.length - 1); + } return undefined; } diff --git a/src/views/components/common/Prompt.tsx b/src/views/components/common/Prompt.tsx index 21624a1e..cad58e81 100644 --- a/src/views/components/common/Prompt.tsx +++ b/src/views/components/common/Prompt.tsx @@ -1,4 +1,4 @@ -import { Dialog, Transition, TransitionChild } from '@headlessui/react'; +import { Description, Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@headlessui/react'; import type { ReactElement } from 'react'; import React from 'react'; @@ -50,11 +50,11 @@ function PromptDialog({ isOpen, onClose, title, content, children }: PromptDialo leaveTo='opacity-0 scale-95' >
- - {title} - {content} + + {title} + {content}
{children}
-
+
diff --git a/src/views/components/common/ScheduleListItem.tsx b/src/views/components/common/ScheduleListItem.tsx index 46bccda7..6e2ce754 100644 --- a/src/views/components/common/ScheduleListItem.tsx +++ b/src/views/components/common/ScheduleListItem.tsx @@ -9,6 +9,9 @@ import React, { useEffect, useMemo, useState } from 'react'; import XIcon from '~icons/material-symbols/close'; import DragIndicatorIcon from '~icons/material-symbols/drag-indicator'; +import { Button } from './Button'; +import PromptDialog from './Prompt'; + /** * Props for the ScheduleListItem component. */ @@ -26,6 +29,7 @@ export default function ScheduleListItem({ schedule, dragHandleProps, onClick }: const [activeSchedule] = useSchedules(); const [isEditing, setIsEditing] = useState(false); const [editorValue, setEditorValue] = useState(schedule.name); + const [error, setError] = useState(undefined); const editorRef = React.useRef(null); useEffect(() => { @@ -50,8 +54,28 @@ export default function ScheduleListItem({ schedule, dragHandleProps, onClick }: setIsEditing(false); }; + const onDelete = () => { + deleteSchedule(schedule.id).catch(e => setError(e.message)); + }; + return (
+ setError(undefined)} + title={ + + Something Went Wrong + + } + content={{error}} + // eslint-disable-next-line react/no-children-prop + children={[ + , + ]} + />
  • @@ -93,10 +117,7 @@ export default function ScheduleListItem({ schedule, dragHandleProps, onClick }: )}
    - deleteSchedule(schedule.id)} - /> +
  • diff --git a/src/views/components/injected/RecruitmentBanner/RecruitmentBanner.tsx b/src/views/components/injected/RecruitmentBanner/RecruitmentBanner.tsx index 04105e9f..945b5494 100644 --- a/src/views/components/injected/RecruitmentBanner/RecruitmentBanner.tsx +++ b/src/views/components/injected/RecruitmentBanner/RecruitmentBanner.tsx @@ -8,7 +8,7 @@ import styles from './RecruitmentBanner.module.scss'; const DISCORD_URL = 'https://discord.gg/7pQDBGdmb7'; const GITHUB_URL = 'https://github.com/Longhorn-Developers/UT-Registration-Plus'; -const RECRUIT_FROM_DEPARTMENTS = ['C S', 'ECE', 'MIS', 'CSE', 'EE', 'ITD']; +const RECRUIT_FROM_DEPARTMENTS = ['C S', 'ECE', 'MIS', 'CSE', 'EE', 'ITD', 'DES']; /** * This adds a new column to the course catalog table header.