Skip to content

Commit

Permalink
fix: chromatic build
Browse files Browse the repository at this point in the history
  • Loading branch information
Razboy20 committed Mar 8, 2024
1 parent 60ab140 commit 11303da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/stories/components/List.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Course, Status } from '@shared/types/Course';
import { CourseMeeting } from '@shared/types/CourseMeeting';
import Instructor from '@shared/types/Instructor';
import type { CourseColors } from '@shared/util/colors';
import { tailwindColorways } from '@shared/util/storybook';
import type { Meta, StoryObj } from '@storybook/react';
import List from '@views/components/common/List/List';
Expand All @@ -9,13 +10,14 @@ import React from 'react';

const numberOfCourses = 5;

// TODO: move into utils
/**
* Generates an array of courses.
*
* @param count - The number of courses to generate.
* @returns An array of generated courses.
*/
export const GenerateCourses = count => {
const generateCourses = (count: number): Course[] => {
const courses = [];

for (let i = 0; i < count; i++) {
Expand Down Expand Up @@ -67,10 +69,10 @@ export const GenerateCourses = count => {
return courses;
};

const exampleCourses = GenerateCourses(numberOfCourses);
const generateCourseBlocks = (exampleCourses, colors) =>
const exampleCourses = generateCourses(numberOfCourses);
const generateCourseBlocks = (exampleCourses: Course[], colors: CourseColors[]) =>
exampleCourses.map((course, i) => <PopupCourseBlock key={course.uniqueId} course={course} colors={colors[i]} />);
export const ExampleCourseBlocks = generateCourseBlocks(exampleCourses, tailwindColorways);
const ExampleCourseBlocks = generateCourseBlocks(exampleCourses, tailwindColorways);

const meta = {
title: 'Components/Common/List',
Expand Down

0 comments on commit 11303da

Please sign in to comment.