fix: chromatic build
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { Course, Status } from '@shared/types/Course';
|
import { Course, Status } from '@shared/types/Course';
|
||||||
import { CourseMeeting } from '@shared/types/CourseMeeting';
|
import { CourseMeeting } from '@shared/types/CourseMeeting';
|
||||||
import Instructor from '@shared/types/Instructor';
|
import Instructor from '@shared/types/Instructor';
|
||||||
|
import type { CourseColors } from '@shared/util/colors';
|
||||||
import { tailwindColorways } from '@shared/util/storybook';
|
import { tailwindColorways } from '@shared/util/storybook';
|
||||||
import type { Meta, StoryObj } from '@storybook/react';
|
import type { Meta, StoryObj } from '@storybook/react';
|
||||||
import List from '@views/components/common/List/List';
|
import List from '@views/components/common/List/List';
|
||||||
@@ -9,13 +10,14 @@ import React from 'react';
|
|||||||
|
|
||||||
const numberOfCourses = 5;
|
const numberOfCourses = 5;
|
||||||
|
|
||||||
|
// TODO: move into utils
|
||||||
/**
|
/**
|
||||||
* Generates an array of courses.
|
* Generates an array of courses.
|
||||||
*
|
*
|
||||||
* @param count - The number of courses to generate.
|
* @param count - The number of courses to generate.
|
||||||
* @returns An array of generated courses.
|
* @returns An array of generated courses.
|
||||||
*/
|
*/
|
||||||
export const GenerateCourses = count => {
|
const generateCourses = (count: number): Course[] => {
|
||||||
const courses = [];
|
const courses = [];
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
@@ -67,10 +69,10 @@ export const GenerateCourses = count => {
|
|||||||
return courses;
|
return courses;
|
||||||
};
|
};
|
||||||
|
|
||||||
const exampleCourses = GenerateCourses(numberOfCourses);
|
const exampleCourses = generateCourses(numberOfCourses);
|
||||||
const generateCourseBlocks = (exampleCourses, colors) =>
|
const generateCourseBlocks = (exampleCourses: Course[], colors: CourseColors[]) =>
|
||||||
exampleCourses.map((course, i) => <PopupCourseBlock key={course.uniqueId} course={course} colors={colors[i]} />);
|
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 = {
|
const meta = {
|
||||||
title: 'Components/Common/List',
|
title: 'Components/Common/List',
|
||||||
|
|||||||
Reference in New Issue
Block a user