chore: lint and format repo - 1 lint error left

This commit is contained in:
doprz
2024-03-05 23:06:12 -06:00
committed by Razboy20
parent 8f360206fb
commit 2593b371d5
7 changed files with 14 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
import type { ThemeColor } from '@shared/util/themeColors';
import type { Meta, StoryObj } from '@storybook/react'; import type { Meta, StoryObj } from '@storybook/react';
import CourseCellColorPicker from '@views/components/common/CourseCellColorPicker/CourseCellColorPicker'; import CourseCellColorPicker from '@views/components/common/CourseCellColorPicker/CourseCellColorPicker';
import React, { useState } from 'react'; import React, { useState } from 'react';
import type { ThemeColor } from 'src/shared/util/themeColors';
const meta = { const meta = {
title: 'Components/Common/CourseCellColorPicker', title: 'Components/Common/CourseCellColorPicker',
@@ -13,6 +13,7 @@ type Story = StoryObj<typeof CourseCellColorPicker>;
export const Default: Story = { export const Default: Story = {
render: () => { render: () => {
// TODO
const [selectedColor, setSelectedColor] = useState<ThemeColor | null>(null); const [selectedColor, setSelectedColor] = useState<ThemeColor | null>(null);
return <CourseCellColorPicker setSelectedColor={setSelectedColor} />; return <CourseCellColorPicker setSelectedColor={setSelectedColor} />;
}, },

View File

@@ -3,7 +3,6 @@ import { getThemeColorHexByName, getThemeColorRgbByName } from '@shared/util/the
import Text from '@views/components/common/Text/Text'; import Text from '@views/components/common/Text/Text';
import clsx from 'clsx'; import clsx from 'clsx';
import React from 'react'; import React from 'react';
import { satisfies } from 'semver';
import type IconComponent from '~icons/material-symbols'; import type IconComponent from '~icons/material-symbols';

View File

@@ -388,4 +388,5 @@ export default function CourseCellColorPicker({
/> />
)} )}
</div> </div>
} );
}

View File

@@ -12,7 +12,7 @@ interface Props {
*/ */
export default function InfoCard({ titleText, bodyText }: React.PropsWithChildren<Props>): JSX.Element { export default function InfoCard({ titleText, bodyText }: React.PropsWithChildren<Props>): JSX.Element {
return ( return (
<div className='w-50 border rounded p-4 border-gray-300 bg-white'> <div className='w-50 border border-gray-300 rounded bg-white p-4'>
<div className='flex flex-col gap-1.5'> <div className='flex flex-col gap-1.5'>
<Text variant='h4' as='span' className='text-ut-orange'> <Text variant='h4' as='span' className='text-ut-orange'>
{titleText} {titleText}

View File

@@ -5,13 +5,13 @@ import type { CalendarCourseCellProps } from '@views/components/calendar/Calenda
import useSchedules from './useSchedules'; import useSchedules from './useSchedules';
const dayToNumber: { [day: string]: number } = { const dayToNumber = {
Monday: 0, Monday: 0,
Tuesday: 1, Tuesday: 1,
Wednesday: 2, Wednesday: 2,
Thursday: 3, Thursday: 3,
Friday: 4, Friday: 4,
}; } as const satisfies Record<string, number>;
interface CalendarGridPoint { interface CalendarGridPoint {
dayIndex: number; dayIndex: number;

View File

@@ -47,7 +47,12 @@ export default function useSchedules(): [active: UserSchedule | null, schedules:
return [activeSchedule, schedules]; return [activeSchedule, schedules];
} }
export async function switchSchedule(name: string) { /**
* Switches the active schedule to the one with the specified name.
* @param name - The name of the schedule to switch to.
* @returns A promise that resolves when the active schedule has been switched.
*/
export async function switchSchedule(name: string): Promise<void> {
const schedules = await UserScheduleStore.get('schedules'); const schedules = await UserScheduleStore.get('schedules');
const activeIndex = schedules.findIndex(s => s.name === name); const activeIndex = schedules.findIndex(s => s.name === name);
await UserScheduleStore.set('activeIndex', activeIndex); await UserScheduleStore.set('activeIndex', activeIndex);

View File

@@ -18,7 +18,7 @@ const TableDataSelector = {
SCHEDULE_HOURS: 'td[data-th="Hour"]>span', SCHEDULE_HOURS: 'td[data-th="Hour"]>span',
SCHEDULE_LOCATION: 'td[data-th="Room"]>span', SCHEDULE_LOCATION: 'td[data-th="Room"]>span',
FLAGS: 'td[data-th="Flags"] ul li', FLAGS: 'td[data-th="Flags"] ul li',
} as const; } as const satisfies Record<string, string>;
type TableDataSelectorType = (typeof TableDataSelector)[keyof typeof TableDataSelector]; type TableDataSelectorType = (typeof TableDataSelector)[keyof typeof TableDataSelector];