Skip to content

Commit

Permalink
feat: finish ScheduleTotalHoursAndCourses
Browse files Browse the repository at this point in the history
  • Loading branch information
knownotunknown authored and doprz committed Mar 6, 2024
1 parent 21b6430 commit 12f680d
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/stories/components/SchedulTotalHoursAndCourses.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Meta, StoryObj } from '@storybook/react';
import ScheduleTotalHoursAndCourses from '@views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses';

const meta = {
title: 'Components/Common/ScheduleTotalHoursAndCourses',
component: ScheduleTotalHoursAndCourses,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
argTypes: {
scheduleName: { control: 'text' },
totalHours: { control: 'number' },
totalCourses: { control: 'number' }
},
} satisfies Meta<typeof ScheduleTotalHoursAndCourses>;
export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
scheduleName: 'text',
totalHours: 22,
totalCourses: 8
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import clsx from 'clsx';
import React, { useState } from 'react';
import { Course, Status } from '@shared/types/Course';
import { StatusIcon } from '@shared/util/icons';
import { CourseColors, getCourseColors, pickFontColor } from '@shared/util/colors';
import DragIndicatorIcon from '~icons/material-symbols/drag-indicator';
import Text from '../Text/Text';

/**
* Props for ScheduleTotalHoursAndCourses
*/
export interface ScheduleTotalHoursAndCoursesProps {
scheduleName: string;
totalHours: number;
totalCourses: number;
}

/**
* The ScheduleTotalHoursAndCourses as per the Labels and Details Figma section
*
* @param props ScheduleTotalHoursAndCoursesProps
*/
export default function ScheduleTotalHoursAndCoursess({ scheduleName, totalHours, totalCourses }: ScheduleTotalHoursAndCoursesProps): JSX.Element {
return (
<div
style={{
display: 'flex',
minWidth: '245px',
alignItems: 'center',
alignContent: 'center',
gap: '5px 10px',
flexWrap: 'wrap',
}}
>
<Text
style={{
color: '#BF5700',
}}
variant='h1'
as='span'
>
{`${scheduleName}: `}
</Text>
<Text
variant='h3'
as='span'
style={{
color: '#1A2024'
}}
>
{`${totalHours} HOURS`}
</Text>
<Text
variant='h4'
as='span'
style={{
color: '#333F48'
}}
>
{`${totalCourses} courses`}
</Text>
</div>
);
}

0 comments on commit 12f680d

Please sign in to comment.