Done, but might want to update font size

This commit is contained in:
knownotunknown
2024-02-09 11:57:22 -06:00
parent f045b400a5
commit e3301cc200
2 changed files with 91 additions and 0 deletions

View File

@@ -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
},
};

View File

@@ -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>
);
}