diff --git a/frontend/src/Components/CategoryItem.tsx b/frontend/src/Components/CategoryItem.tsx deleted file mode 100644 index b09f7b945..000000000 --- a/frontend/src/Components/CategoryItem.tsx +++ /dev/null @@ -1,156 +0,0 @@ -import { ResourceCategory, ResourceLink } from '@/common'; -import { useRef, useState } from 'react'; -import LinkItem from './LinkItem'; -import AddLinkForm from '@/Components/forms/AddLinkForm'; -import { ModalType } from '@/common'; -import { - ChevronDownIcon, - ChevronRightIcon, - ChevronUpIcon, - PlusIcon, - TrashIcon -} from '@heroicons/react/24/solid'; -import Modal from './Modal'; -import DeleteForm from './forms/DeleteForm'; - -export default function CategoryItem({ - category, - deleteLink, - addLink, - moveLink, - updateLink -}: { - category: ResourceCategory; - deleteLink: (link: ResourceCategory, linkPair: ResourceLink) => void; - addLink: (category: ResourceCategory, title: string, url: string) => void; - moveLink: ( - category: ResourceCategory, - index: number, - direction: string - ) => void; - updateLink: ( - category: ResourceCategory, - index: number, - newLinkPair: ResourceLink - ) => void; -}) { - const [activeLinkToDelete, setActiveLinkToDelete] = useState< - ResourceLink | undefined - >(); - const [open, setOpen] = useState(true); - const deleteLinkModal = useRef(null); - const addLinkModal = useRef(null); - - return ( -
- setOpen(!open)} - > -
- {category.name} - {open ? ( - - ) : ( - - )} -
-
    -
    -

    Title

    -

    URL

    -
    - {category.links.map((linkPair: ResourceLink, index) => { - const key = Object.keys(linkPair)[0]; - return ( -
    - - updateLink(category, index, newLinkPair) - } - /> -
    - { - setActiveLinkToDelete(linkPair); - deleteLinkModal.current?.showModal(); - }} - /> -
    -
    - - moveLink(category, index, 'up') - } - /> -
    -
    - - moveLink(category, index, 'down') - } - /> -
    -
    - ); - })} - -
- {/* Modals */} - {activeLinkToDelete && ( - setActiveLinkToDelete(undefined)} - onSuccess={() => - deleteLink(category, activeLinkToDelete) - } - /> - } - ref={deleteLinkModal} - /> - )} - {addLinkModal.current && ( - { - addLink(category, title, url); - addLinkModal.current?.close(); - }} - /> - } - ref={addLinkModal} - /> - )} -
- ); -} diff --git a/frontend/src/Components/NavLink.tsx b/frontend/src/Components/NavLink.tsx deleted file mode 100644 index 12e755a4d..000000000 --- a/frontend/src/Components/NavLink.tsx +++ /dev/null @@ -1,27 +0,0 @@ -export interface NavLinkProps { - href: string; - className?: string; - children: React.ReactNode; -} - -export default function NavLink({ - active = false, - className = '', - children, - ...props -}: NavLinkProps & { active: boolean }) { - return ( -
- {children} -
- ); -} diff --git a/frontend/src/Components/NotificationCard.tsx b/frontend/src/Components/NotificationCard.tsx deleted file mode 100644 index 34224954e..000000000 --- a/frontend/src/Components/NotificationCard.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { Announcement, NotificationType } from '@/common.ts'; - -export default function NotificationCard({ - cardInfo, - type -}: { - cardInfo: Announcement; - type: NotificationType; -}) { - return ( - -

- {cardInfo.course_name && cardInfo.course_name + ': '} - {cardInfo.title} -

- {type == NotificationType.Announcement ? ( -

{cardInfo.message}

- ) : ( - <> -

- {cardInfo.course_name + - ' | ' + - cardInfo.provider_platform} -

-

- {cardInfo.due.toUTCString()} -

- - )} -
- ); -} diff --git a/frontend/src/Components/NotificationsSideBar.tsx b/frontend/src/Components/NotificationsSideBar.tsx deleted file mode 100644 index c7c33162d..000000000 --- a/frontend/src/Components/NotificationsSideBar.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import NotificationCard from './NotificationCard'; -import { Announcement, NotificationType } from '@/common.ts'; - -const date = new Date(); - -const announcements: Announcement[] = [ - { - course_name: 'Data and Algorithms', - title: 'Enrollment Approved', - message: - 'You are now enrolled in Data and Algorithms from Harvard University.', - url: '', - provider_platform: 'Canvas', - due: date - }, - { - course_name: 'Advanced English Composition', - title: 'Schedule Change', - message: 'Advanced English Composition is now M/W 10:30am-12pm.', - url: '', - provider_platform: 'Canvas', - due: date - }, - { - course_name: 'Linear Algebra', - title: 'Midterm Grades Out', - message: - 'Hi everyone, midterm grades have been posted. Please reach out if you have any questions.', - url: '', - provider_platform: 'Canvas', - due: date - } -]; - -const toDo: Announcement[] = [ - { - title: 'Assignment 4', - course_name: 'Introduction to Computer Science', - provider_platform: 'Kolibri', - message: 'Please submit your assignment 4 by the end of the day.', - url: '', - due: date - }, - { - title: 'Homework 6', - course_name: 'Linear Algebra', - provider_platform: 'WashU Canvas', - message: 'Please submit your homework 6 by the end of the day.', - url: '', - due: date - } -]; - -export default function NotificationsSideBar() { - // call the data here in the future - - return ( -
-
-

Announcements

-
- {announcements.map((cardInfo: Announcement) => { - return ( - - ); - })} -
-
-
-

To Do

-
- {toDo.map((cardInfo: Announcement) => { - return ( - - ); - })} -
-
-
- ); -} diff --git a/frontend/src/Components/ResponsiveNavLink.tsx b/frontend/src/Components/ResponsiveNavLink.tsx deleted file mode 100644 index 19bd72664..000000000 --- a/frontend/src/Components/ResponsiveNavLink.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { NavLinkProps } from './NavLink'; - -export default function ResponsiveNavLink({ - active = false, - className = '', - children, - ...props -}: NavLinkProps & { active?: boolean }) { - return ( -
- {children} -
- ); -} diff --git a/frontend/src/common.ts b/frontend/src/common.ts index ba71f4ba6..c02979588 100644 --- a/frontend/src/common.ts +++ b/frontend/src/common.ts @@ -620,15 +620,6 @@ export interface RecentActivity { delta: number; } -export type Link = Record; - -export interface Resource { - id: number; - name: string; - links: Link[]; - rank: number; -} - export interface Announcement { course_name: string; title: string; @@ -762,11 +753,6 @@ export interface OpenContentProvider { description: string | null; } -export interface ToastProps { - state: ToastState; - message: string; -} - export enum FilterLibraries { 'All Libraries' = 'all' }