-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: finish ScheduleTotalHoursAndCourses
- Loading branch information
1 parent
21b6430
commit 12f680d
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/stories/components/SchedulTotalHoursAndCourses.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}, | ||
}; |
64 changes: 64 additions & 0 deletions
64
src/views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |