refactor: remove component subfolders (#184)

(and unused components)
This commit is contained in:
Razboy20
2024-03-21 13:47:59 -05:00
committed by GitHub
parent efed1c0edb
commit e080e93faa
56 changed files with 70 additions and 275 deletions

View File

@@ -1,6 +1,6 @@
import { colorsFlattened } from '@shared/util/themeColors';
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from '@views/components/common/Button/Button';
import { Button } from '@views/components/common/Button';
import React from 'react';
import AddIcon from '~icons/material-symbols/add';

View File

@@ -1,23 +0,0 @@
import type { Meta, StoryObj } from '@storybook/react';
import Card from '@views/components/common/Card/Card';
import React from 'react';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
const meta = {
title: 'Components/Common/Card',
component: Card,
parameters: {
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
layout: 'centered',
},
args: {
children: <div>Hello</div>,
},
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
tags: ['autodocs'],
} satisfies Meta<typeof Card>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {};

View File

@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Chip } from '@views/components/common/Chip/Chip';
import { Chip } from '@views/components/common/Chip';
const meta = {
title: 'Components/Common/Chip',

View File

@@ -3,7 +3,7 @@ import { CourseMeeting } from '@shared/types/CourseMeeting';
import Instructor from '@shared/types/Instructor';
import { getCourseColors } from '@shared/util/colors';
import type { Meta, StoryObj } from '@storybook/react';
import ConflictsWithWarning from '@views/components/common/ConflictsWithWarning/ConflictsWithWarning';
import ConflictsWithWarning from '@views/components/common/ConflictsWithWarning';
export const ExampleCourse: Course = new Course({
courseName: 'ELEMS OF COMPTRS/PROGRAMMNG-WB',

View File

@@ -1,6 +1,6 @@
import { Status } from '@shared/types/Course';
import type { Meta, StoryObj } from '@storybook/react';
import CourseStatus from '@views/components/common/CourseStatus/CourseStatus';
import CourseStatus from '@views/components/common/CourseStatus';
import React from 'react';
const meta = {

View File

@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from '@views/components/common/Button/Button';
import Divider from '@views/components/common/Divider/Divider';
import { Button } from '@views/components/common/Button';
import Divider from '@views/components/common/Divider';
import React from 'react';
import AddIcon from '~icons/material-symbols/add';

View File

@@ -2,10 +2,10 @@ import { UserScheduleStore } from '@shared/storage/UserScheduleStore';
import { UserSchedule } from '@shared/types/UserSchedule';
import { generateRandomId } from '@shared/util/random';
import type { Meta, StoryObj } from '@storybook/react';
import List from '@views/components/common/List/List';
import type { ScheduleDropdownProps } from '@views/components/common/ScheduleDropdown/ScheduleDropdown';
import ScheduleDropdown from '@views/components/common/ScheduleDropdown/ScheduleDropdown';
import ScheduleListItem from '@views/components/common/ScheduleListItem/ScheduleListItem';
import List from '@views/components/common/List';
import type { ScheduleDropdownProps } from '@views/components/common/ScheduleDropdown';
import ScheduleDropdown from '@views/components/common/ScheduleDropdown';
import ScheduleListItem from '@views/components/common/ScheduleListItem';
import useSchedules, { getActiveSchedule, switchSchedule } from '@views/hooks/useSchedules';
import type { Serialized } from 'chrome-extension-toolkit';
import React, { useEffect } from 'react';

View File

@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import InfoCard from '@views/components/common/InfoCard/InfoCard';
import InfoCard from '@views/components/common/InfoCard';
const meta = {
title: 'Components/Common/InfoCard',

View File

@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import Link from '@views/components/common/Link/Link';
import Link from '@views/components/common/Link';
const meta = {
title: 'Components/Common/Link',

View File

@@ -4,8 +4,8 @@ import { CourseMeeting } from '@shared/types/CourseMeeting';
import Instructor from '@shared/types/Instructor';
import { tailwindColorways } from '@shared/util/storybook';
import type { Meta, StoryObj } from '@storybook/react';
import List from '@views/components/common/List/List';
import PopupCourseBlock from '@views/components/common/PopupCourseBlock/PopupCourseBlock';
import List from '@views/components/common/List';
import PopupCourseBlock from '@views/components/common/PopupCourseBlock';
import React from 'react';
const numberOfCourses = 5;

View File

@@ -4,7 +4,7 @@ import Instructor from '@shared/types/Instructor';
import { getCourseColors } from '@shared/util/colors';
import { tailwindColorways } from '@shared/util/storybook';
import type { Meta, StoryObj } from '@storybook/react';
import PopupCourseBlock from '@views/components/common/PopupCourseBlock/PopupCourseBlock';
import PopupCourseBlock from '@views/components/common/PopupCourseBlock';
import React from 'react';
/**

View File

@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from '@views/components/common/Button/Button';
import type { PromptDialogProps } from '@views/components/common/Prompt/Prompt';
import PromptDialog from '@views/components/common/Prompt/Prompt';
import { Button } from '@views/components/common/Button';
import type { PromptDialogProps } from '@views/components/common/Prompt';
import PromptDialog from '@views/components/common/Prompt';
import Text from '@views/components/common/Text/Text';
import React from 'react';

View File

@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import ScheduleTotalHoursAndCourses from '@views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses';
import ScheduleTotalHoursAndCourses from '@views/components/common/ScheduleTotalHoursAndCourses';
const meta = {
title: 'Components/Common/ScheduleTotalHoursAndCourses',

View File

@@ -1,6 +1,6 @@
import { UserSchedule } from '@shared/types/UserSchedule';
import type { Meta, StoryObj } from '@storybook/react';
import ScheduleListItem from '@views/components/common/ScheduleListItem/ScheduleListItem';
import ScheduleListItem from '@views/components/common/ScheduleListItem';
import useSchedules from '@views/hooks/useSchedules';
import React from 'react';

View File

@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import Calendar from '@views/components/calendar/Calendar/Calendar';
import Calendar from '@views/components/calendar/Calendar';
const meta = {
title: 'Components/Calendar/Calendar',

View File

@@ -2,7 +2,7 @@ import { Course, Status } from '@shared/types/Course';
import Instructor from '@shared/types/Instructor';
import { getCourseColors } from '@shared/util/colors';
import type { Meta, StoryObj } from '@storybook/react';
import CalendarBottomBar from '@views/components/calendar/CalendarBottomBar/CalendarBottomBar';
import CalendarBottomBar from '@views/components/calendar/CalendarBottomBar';
import React from 'react';
const exampleGovCourse: Course = new Course({

View File

@@ -1,62 +0,0 @@
import { Course, Status } from '@shared/types/Course';
import { CourseMeeting, DAY_MAP } from '@shared/types/CourseMeeting';
import { CourseSchedule } from '@shared/types/CourseSchedule';
import Instructor from '@shared/types/Instructor';
import { getCourseColors } from '@shared/util/colors';
import type { Meta, StoryObj } from '@storybook/react';
import CalendarCourse from '@views/components/calendar/CalendarCourseBlock/CalendarCourseMeeting';
const meta = {
title: 'Components/Calendar/CalendarCourseMeeting',
component: CalendarCourse,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
argTypes: {
course: { control: 'object' },
meetingIdx: { control: 'number' },
},
} satisfies Meta<typeof CalendarCourse>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
course: new Course({
uniqueId: 123,
number: '311C',
fullName: "311C - Bevo's Default Course",
courseName: "Bevo's Default Course",
department: 'BVO',
creditHours: 3,
status: Status.OPEN,
instructors: [new Instructor({ firstName: '', lastName: 'Bevo', fullName: 'Bevo' })],
isReserved: false,
url: '',
flags: [],
schedule: new CourseSchedule({
meetings: [
new CourseMeeting({
days: [DAY_MAP.M, DAY_MAP.W, DAY_MAP.F],
startTime: 480,
endTime: 570,
location: {
building: 'UTC',
room: '123',
},
}),
],
}),
instructionMode: 'In Person',
semester: {
year: 2024,
season: 'Spring',
},
scrapedAt: Date.now(),
colors: getCourseColors('emerald', 500),
}),
meetingIdx: 0,
},
};

View File

@@ -1,8 +1,8 @@
import { Status } from '@shared/types/Course';
import { getCourseColors } from '@shared/util/colors';
import type { Meta, StoryObj } from '@storybook/react';
import type { CalendarCourseCellProps } from '@views/components/calendar/CalendarCourseCell/CalendarCourseCell';
import CalendarCourseCell from '@views/components/calendar/CalendarCourseCell/CalendarCourseCell';
import type { CalendarCourseCellProps } from '@views/components/calendar/CalendarCourseCell';
import CalendarCourseCell from '@views/components/calendar/CalendarCourseCell';
import React from 'react';
import { ExampleCourse } from '../PopupCourseBlock.stories';

View File

@@ -1,7 +1,7 @@
import { Status } from '@shared/types/Course';
import { getCourseColors } from '@shared/util/colors';
import type { Meta, StoryObj } from '@storybook/react';
import CalendarGrid from '@views/components/calendar/CalendarGrid/CalendarGrid';
import CalendarGrid from '@views/components/calendar/CalendarGrid';
import type { CalendarGridCourse } from '@views/hooks/useFlattenedCourseSchedule';
import { ExampleCourse } from '../PopupCourseBlock.stories';

View File

@@ -1,6 +1,6 @@
// Calendar.stories.tsx
import type { Meta, StoryObj } from '@storybook/react';
import CalendarCell from '@views/components/calendar/CalendarGridCell/CalendarGridCell';
import CalendarCell from '@views/components/calendar/CalendarGridCell';
const meta = {
title: 'Components/Calendar/CalendarGridCell',

View File

@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import CalendarHeader from '@views/components/calendar/CalendarHeader/CalenderHeader';
import CalendarHeader from '@views/components/calendar/CalenderHeader';
const meta = {
title: 'Components/Calendar/CalendarHeader',

View File

@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { CalendarSchedules } from '@views/components/calendar/CalendarSchedules/CalendarSchedules';
import { CalendarSchedules } from '@views/components/calendar/CalendarSchedules';
const meta = {
title: 'Components/Calendar/CalendarSchedules',