feat: experimental toggle for icons, left off for now (#237)

* feat: temporary removal of waitlist etc

* feat: experimental toggle for icons for now

* feat: popupmain toggle

* feat: cal header toggle

* feat: adjusted course cell for toggle

* feat: fine it'll be a constant

* chore: lint

* feat: other experimental options
This commit is contained in:
2024-09-29 15:11:27 -05:00
committed by GitHub
parent d424ccce49
commit f34dd95d77
4 changed files with 29 additions and 13 deletions

View File

@@ -2,6 +2,7 @@ import type { StatusType } from '@shared/types/Course';
import { Status } from '@shared/types/Course';
import type { CourseColors } from '@shared/types/ThemeColors';
import { pickFontColor } from '@shared/util/colors';
import { enableCourseStatusChips } from '@shared/util/experimental';
import Text from '@views/components/common/Text/Text';
import clsx from 'clsx';
import React from 'react';
@@ -43,13 +44,15 @@ export default function CalendarCourseCell({
onClick,
}: CalendarCourseCellProps): JSX.Element {
let rightIcon: React.ReactNode | null = null;
// if (status === Status.WAITLISTED) {
// rightIcon = <WaitlistIcon className='h-5 w-5' />;
// } else if (status === Status.CLOSED) {
// rightIcon = <ClosedIcon className='h-5 w-5' />;
// } else if (status === Status.CANCELLED) {
// rightIcon = <CancelledIcon className='h-5 w-5' />;
// }
if (enableCourseStatusChips) {
if (status === Status.WAITLISTED) {
rightIcon = <WaitlistIcon className='h-5 w-5' />;
} else if (status === Status.CLOSED) {
rightIcon = <ClosedIcon className='h-5 w-5' />;
} else if (status === Status.CANCELLED) {
rightIcon = <CancelledIcon className='h-5 w-5' />;
}
}
// text-white or text-black based on secondaryColor
const fontColor = pickFontColor(colors.primaryColor);

View File

@@ -1,4 +1,5 @@
import { Status } from '@shared/types/Course';
import { enableCourseStatusChips } from '@shared/util/experimental';
import { Button } from '@views/components/common/Button';
import CourseStatus from '@views/components/common/CourseStatus';
import Divider from '@views/components/common/Divider';
@@ -60,9 +61,13 @@ export default function CalendarHeader({ onSidebarToggle }: CalendarHeaderProps)
</div>
</div>
<div className='hidden flex-row items-center justify-end gap-6 screenshot:hidden lg:flex'>
<CourseStatus size='small' status={Status.WAITLISTED} />
<CourseStatus size='small' status={Status.CLOSED} />
<CourseStatus size='small' status={Status.CANCELLED} />
{enableCourseStatusChips && (
<>
<CourseStatus status='WAITLISTED' size='mini' />
<CourseStatus status='CLOSED' size='mini' />
<CourseStatus status='CANCELLED' size='mini' />
</>
)}
{/* <Button variant='single' icon={UndoIcon} color='ut-black' />
<Button variant='single' icon={RedoIcon} color='ut-black' /> */}