From 28f4c8b24765aa0f98f4e61e1dda29c0b9c94f76 Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Sun, 27 Aug 2023 14:25:45 -0700 Subject: [PATCH] Restore frontend --- .../ListCard/SectionDrawer/DrawerHeader.tsx | 48 -------- .../ListCard/SectionDrawer/RadioGroup.tsx | 66 ---------- .../ListCard/SectionDrawer/index.tsx | 90 -------------- .../components/ListCard/SectionRow.tsx | 113 ++++++++---------- .../components/ListCard/SideBar.tsx | 88 -------------- 5 files changed, 52 insertions(+), 353 deletions(-) delete mode 100644 app/javascript/components/ListCard/SectionDrawer/DrawerHeader.tsx delete mode 100644 app/javascript/components/ListCard/SectionDrawer/RadioGroup.tsx delete mode 100644 app/javascript/components/ListCard/SectionDrawer/index.tsx delete mode 100644 app/javascript/components/ListCard/SideBar.tsx diff --git a/app/javascript/components/ListCard/SectionDrawer/DrawerHeader.tsx b/app/javascript/components/ListCard/SectionDrawer/DrawerHeader.tsx deleted file mode 100644 index 3d897383..00000000 --- a/app/javascript/components/ListCard/SectionDrawer/DrawerHeader.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import * as React from 'react' -import {Fragment, useState} from 'react' -import {Dialog, Transition} from '@headlessui/react' -import { - ArchiveBoxIcon, - Bars3BottomLeftIcon, - Bars4Icon, - ClockIcon, - HomeIcon, - UserCircleIcon as UserCircleIconOutline, - XMarkIcon, - MapPinIcon, -} from '@heroicons/react/24/outline' -import { - BellIcon, - CalendarIcon, - ChatBubbleLeftEllipsisIcon, - CheckCircleIcon, - LockOpenIcon, - MagnifyingGlassIcon, - PencilIcon, - TagIcon, - UserCircleIcon as UserCircleIconMini, -} from '@heroicons/react/20/solid' - -export default function DrawerHeader() { - return ( - - ) -} diff --git a/app/javascript/components/ListCard/SectionDrawer/RadioGroup.tsx b/app/javascript/components/ListCard/SectionDrawer/RadioGroup.tsx deleted file mode 100644 index 87c445bb..00000000 --- a/app/javascript/components/ListCard/SectionDrawer/RadioGroup.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import * as React from 'react' -import {useState} from 'react' -import {RadioGroup} from '@headlessui/react' -import {clsx} from 'clsx' - -const plans = [ - {name: 'Not Following'}, - {name: 'Plan', description: 'Add course to your quarter plan.'}, - { - name: 'Notify', - description: 'Get text message alerts about the course. Will use one of your X notification tokens.', - }, - {name: 'Enroll', description: 'Add to your enrolled courses.'}, -] - -export default function Example() { - const [selected, setSelected] = useState(plans[0]) - - return ( - - Server size -
- {plans.map((plan) => ( - - clsx( - checked ? 'border-transparent' : 'border-gray-300', - active ? 'border-indigo-500 ring-2 ring-indigo-500' : '', - 'relative block cursor-pointer rounded-lg border bg-white px-6 py-4 shadow-sm focus:outline-none sm:flex sm:justify-between' - ) - } - > - {({active, checked}) => ( - <> - - - {/* @ts-expect-error */} - - {plan.name} - - {plan.description && ( - // @ts-expect-error - - {plan.description} - - )} - - - - ))} -
-
- ) -} diff --git a/app/javascript/components/ListCard/SectionDrawer/index.tsx b/app/javascript/components/ListCard/SectionDrawer/index.tsx deleted file mode 100644 index 11a0d6dd..00000000 --- a/app/javascript/components/ListCard/SectionDrawer/index.tsx +++ /dev/null @@ -1,90 +0,0 @@ -import * as React from 'react' -import {Fragment, useState} from 'react' -import {Dialog, Transition} from '@headlessui/react' -import {XMarkIcon, MapPinIcon} from '@heroicons/react/24/outline' - -import DrawerHeader from './DrawerHeader' -import RadioGroup from './RadioGroup' - -interface Props { - isOpen: boolean - onClose: () => void -} - -export default function SectionDrawer({isOpen, onClose}: Props) { - return ( - - {/* @ts-expect-error */} - - -
- - -
-
-
- - -
-
-
-
- {'MGMT 1B: Lec 1'} -
- -
-
-
-
- - -
-
-
- - -
-
-
-
-
-
-
-
-
- ) -} diff --git a/app/javascript/components/ListCard/SectionRow.tsx b/app/javascript/components/ListCard/SectionRow.tsx index 7c201e94..28529a8a 100644 --- a/app/javascript/components/ListCard/SectionRow.tsx +++ b/app/javascript/components/ListCard/SectionRow.tsx @@ -1,10 +1,6 @@ import * as React from 'react' -import {useState} from 'react' import {ClockIcon, MapPinIcon, UserIcon, UsersIcon, CalendarIcon} from '@heroicons/react/24/outline' -import SectionDrawer from './SectionDrawer' -import SideBar from './SideBar' - import Badge from 'components/Badge' import type {BadgeColor} from 'components/Badge' @@ -33,69 +29,64 @@ export default function SectionRow({ section: {title, instructorCount, instructorLabel, timeLabel, locationLabel, termLabel, badgeLabel, badgeColor}, actionButtons, }: SectionRowProps) { - const [isOpen, setIsOpen] = useState(false) return ( - <> - setIsOpen(false)} /> - -
  • setIsOpen(true)}> -
    -
    -
    -
    -
    -

    {title}

    - {badgeLabel && badgeColor && ( - - )} -
    +
  • +
    +
    +
    +
    +
    +

    {title}

    + {badgeLabel && badgeColor && ( + + )} +
    -
    - {instructorLabel !== null && instructorCount !== null && ( -

    - {instructorCount > 1 ? ( - - ) : ( - - )} - {instructorLabel} -

    - )} +
    + {instructorLabel !== null && instructorCount !== null && ( +

    + {instructorCount > 1 ? ( + + ) : ( + + )} + {instructorLabel} +

    + )} - {termLabel && ( -

    -

    - )} - {timeLabel && ( -

    -

    - )} - {locationLabel && ( -

    -

    - )} -
    + {termLabel && ( +

    +

    + )} + {timeLabel && ( +

    +

    + )} + {locationLabel && ( +

    +

    + )}
    -
    {actionButtons}
    +
    {actionButtons}
    -
  • - + + ) } diff --git a/app/javascript/components/ListCard/SideBar.tsx b/app/javascript/components/ListCard/SideBar.tsx deleted file mode 100644 index c0381a28..00000000 --- a/app/javascript/components/ListCard/SideBar.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import * as React from 'react' -import { Fragment, useState } from 'react' -import { Dialog, Transition } from '@headlessui/react' -import { XMarkIcon } from '@heroicons/react/24/outline' - -interface Props { - isOpen: boolean - onClose: () => void -} - -export default function SideBar({ isOpen, onClose }: Props) { - return ( - - {/* @ts-expect-error */} - - -
    - - -
    -
    -
    - - -
    -
    -
    -
    - Panel title -
    - -
    -
    -
    -
    - {/* Replace with your content */} - -
    -
    - - -
    -
    - - -
    -
    -
    -
    -
    - ) -}