Skip to content

Commit

Permalink
Restore frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanmsmith committed Aug 27, 2023
1 parent 0cf4ba8 commit 28f4c8b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 353 deletions.
48 changes: 0 additions & 48 deletions app/javascript/components/ListCard/SectionDrawer/DrawerHeader.tsx

This file was deleted.

66 changes: 0 additions & 66 deletions app/javascript/components/ListCard/SectionDrawer/RadioGroup.tsx

This file was deleted.

90 changes: 0 additions & 90 deletions app/javascript/components/ListCard/SectionDrawer/index.tsx

This file was deleted.

113 changes: 52 additions & 61 deletions app/javascript/components/ListCard/SectionRow.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -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 (
<>
<SectionDrawer isOpen={isOpen} onClose={() => setIsOpen(false)} />
<SideBar />
<li onClick={() => setIsOpen(true)}>
<div className="block hover:bg-gray-50 dark:hover:bg-gray-700">
<div className="flex items-center px-4 py-2 sm:px-6">
<div className="min-w-0 flex-1 sm:flex sm:items-center sm:justify-between">
<div className="sm:flex-1 min-w-0">
<div className="flex flex-row items-center mb-0.5">
<p className="text-base font-medium text-gray-700 dark:text-gray-200 truncate">{title}</p>
{badgeLabel && badgeColor && (
<Badge className="ml-2 inline-flex text-xs" label={badgeLabel} color={badgeColor} size="small" />
)}
</div>
<li>
<div className="block hover:bg-gray-50 dark:hover:bg-gray-700">
<div className="flex items-center px-4 py-2 sm:px-6">
<div className="min-w-0 flex-1 sm:flex sm:items-center sm:justify-between">
<div className="sm:flex-1 min-w-0">
<div className="flex flex-row items-center mb-0.5">
<p className="text-base font-medium text-gray-700 dark:text-gray-200 truncate">{title}</p>
{badgeLabel && badgeColor && (
<Badge className="ml-2 inline-flex text-xs" label={badgeLabel} color={badgeColor} size="small" />
)}
</div>

<div className="sm:flex sm:space-x-3">
{instructorLabel !== null && instructorCount !== null && (
<p className="flex items-center text-sm text-gray-500">
{instructorCount > 1 ? (
<UsersIcon className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500" />
) : (
<UserIcon className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500" />
)}
{instructorLabel}
</p>
)}
<div className="sm:flex sm:space-x-3">
{instructorLabel !== null && instructorCount !== null && (
<p className="flex items-center text-sm text-gray-500">
{instructorCount > 1 ? (
<UsersIcon className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500" />
) : (
<UserIcon className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500" />
)}
{instructorLabel}
</p>
)}

{termLabel && (
<p className="flex items-center text-sm text-gray-500 dark:text-gray-400">
<CalendarIcon
className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500"
aria-hidden="true"
/>
{termLabel}
</p>
)}
{timeLabel && (
<p className="flex items-center text-sm text-gray-500 dark:text-gray-400">
<ClockIcon
className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500"
aria-hidden="true"
/>
{timeLabel}
</p>
)}
{locationLabel && (
<p className="flex items-center text-sm text-gray-500 dark:text-gray-400">
<MapPinIcon
className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500"
aria-hidden="true"
/>
{locationLabel}
</p>
)}
</div>
{termLabel && (
<p className="flex items-center text-sm text-gray-500 dark:text-gray-400">
<CalendarIcon
className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500"
aria-hidden="true"
/>
{termLabel}
</p>
)}
{timeLabel && (
<p className="flex items-center text-sm text-gray-500 dark:text-gray-400">
<ClockIcon
className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500"
aria-hidden="true"
/>
{timeLabel}
</p>
)}
{locationLabel && (
<p className="flex items-center text-sm text-gray-500 dark:text-gray-400">
<MapPinIcon
className="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400 dark:text-gray-500"
aria-hidden="true"
/>
{locationLabel}
</p>
)}
</div>
</div>
<div className="ml-4 flex items-center flex-shrink-0 space-x-2">{actionButtons}</div>
</div>
<div className="ml-4 flex items-center flex-shrink-0 space-x-2">{actionButtons}</div>
</div>
</li>
</>
</div>
</li>
)
}
Loading

0 comments on commit 28f4c8b

Please sign in to comment.