feat: show async courses in the bottom bar (#204)
* feat: show async courses in the bottom bar * fix: hide "Async/Other" header when there are no async courses, off-by-n error (where n is the number async courses) * refactor: move types closer to map instead of weird "as boolean" * refactor: move satisfies to return type
This commit is contained in:
@@ -84,18 +84,29 @@ type Story = StoryObj<typeof meta>;
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
courses: [
|
||||
courseCells: [
|
||||
{
|
||||
colors: getCourseColors('pink', 200),
|
||||
courseDeptAndInstr: `${exampleGovCourse.department} ${exampleGovCourse.number} – ${exampleGovCourse.instructors[0]!.lastName}`,
|
||||
status: exampleGovCourse.status,
|
||||
async: true,
|
||||
calendarGridPoint: { dayIndex: -1, endIndex: -1, startIndex: -1 },
|
||||
componentProps: {
|
||||
colors: getCourseColors('pink', 200),
|
||||
courseDeptAndInstr: `${exampleGovCourse.department} ${exampleGovCourse.number} – ${exampleGovCourse.instructors[0]!.lastName}`,
|
||||
status: exampleGovCourse.status,
|
||||
},
|
||||
course: exampleGovCourse,
|
||||
},
|
||||
{
|
||||
colors: getCourseColors('slate', 500),
|
||||
courseDeptAndInstr: `${examplePsyCourse.department} ${examplePsyCourse.number} – ${examplePsyCourse.instructors[0]!.lastName}`,
|
||||
status: examplePsyCourse.status,
|
||||
async: true,
|
||||
calendarGridPoint: { dayIndex: -1, endIndex: -1, startIndex: -1 },
|
||||
componentProps: {
|
||||
colors: getCourseColors('slate', 500),
|
||||
courseDeptAndInstr: `${examplePsyCourse.department} ${examplePsyCourse.number} – ${examplePsyCourse.instructors[0]!.lastName}`,
|
||||
status: examplePsyCourse.status,
|
||||
},
|
||||
course: examplePsyCourse,
|
||||
},
|
||||
],
|
||||
setCourse: () => {},
|
||||
},
|
||||
render: props => (
|
||||
<div className='outline-red outline w-292.5!'>
|
||||
@@ -105,7 +116,7 @@ export const Default: Story = {
|
||||
};
|
||||
export const Empty: Story = {
|
||||
args: {
|
||||
courses: [],
|
||||
courseCells: [],
|
||||
},
|
||||
render: props => (
|
||||
<div className='outline-red outline w-292.5!'>
|
||||
|
||||
@@ -35,6 +35,7 @@ const testData: CalendarGridCourse[] = [
|
||||
colors: getCourseColors('emerald', 500),
|
||||
},
|
||||
course: ExampleCourse,
|
||||
async: false,
|
||||
},
|
||||
{
|
||||
calendarGridPoint: {
|
||||
@@ -49,6 +50,7 @@ const testData: CalendarGridCourse[] = [
|
||||
colors: getCourseColors('emerald', 500),
|
||||
},
|
||||
course: ExampleCourse,
|
||||
async: false,
|
||||
},
|
||||
{
|
||||
calendarGridPoint: {
|
||||
@@ -63,6 +65,7 @@ const testData: CalendarGridCourse[] = [
|
||||
colors: getCourseColors('emerald', 500),
|
||||
},
|
||||
course: ExampleCourse,
|
||||
async: false,
|
||||
},
|
||||
{
|
||||
calendarGridPoint: {
|
||||
@@ -77,6 +80,7 @@ const testData: CalendarGridCourse[] = [
|
||||
colors: getCourseColors('emerald', 500),
|
||||
},
|
||||
course: ExampleCourse,
|
||||
async: false,
|
||||
},
|
||||
{
|
||||
calendarGridPoint: {
|
||||
@@ -91,6 +95,7 @@ const testData: CalendarGridCourse[] = [
|
||||
colors: getCourseColors('emerald', 500),
|
||||
},
|
||||
course: ExampleCourse,
|
||||
async: false,
|
||||
},
|
||||
{
|
||||
calendarGridPoint: {
|
||||
@@ -105,6 +110,7 @@ const testData: CalendarGridCourse[] = [
|
||||
colors: getCourseColors('emerald', 500),
|
||||
},
|
||||
course: ExampleCourse,
|
||||
async: false,
|
||||
},
|
||||
{
|
||||
calendarGridPoint: {
|
||||
@@ -119,6 +125,7 @@ const testData: CalendarGridCourse[] = [
|
||||
colors: getCourseColors('emerald', 500),
|
||||
},
|
||||
course: ExampleCourse,
|
||||
async: false,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user