complete CourseHeaderAndActions Component
added course buttons, using proper subcomponents now.
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
export const colors = {
|
export const colors = {
|
||||||
ut: {
|
ut: {
|
||||||
'burnt-orange': '#BF5700',
|
burntorange: '#BF5700',
|
||||||
black: '#333F48',
|
black: '#333F48',
|
||||||
orange: '#f8971f',
|
orange: '#f8971f',
|
||||||
yellow: '#ffd600',
|
yellow: '#ffd600',
|
||||||
'light-green': '#a6cd57',
|
lightgreen: '#a6cd57',
|
||||||
green: '#579d42',
|
green: '#579d42',
|
||||||
teal: '#00a9b7',
|
teal: '#00a9b7',
|
||||||
blue: '#005f86',
|
blue: '#005f86',
|
||||||
gray: '#9cadb7',
|
gray: '#9cadb7',
|
||||||
'off-white': '#d6d2c4',
|
offwhite: '#d6d2c4',
|
||||||
concrete: '#95a5a6',
|
concrete: '#95a5a6',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
|
|||||||
@@ -1,15 +1,30 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Course } from 'src/shared/types/Course';
|
import { Course } from 'src/shared/types/Course';
|
||||||
|
import Add from '~icons/material-symbols/add';
|
||||||
|
import CalendarMonth from '~icons/material-symbols/calendar-month';
|
||||||
|
import Close from '~icons/material-symbols/close';
|
||||||
|
import Copy from '~icons/material-symbols/content-copy';
|
||||||
|
import Description from '~icons/material-symbols/description';
|
||||||
|
import Mood from '~icons/material-symbols/mood';
|
||||||
|
import Reviews from '~icons/material-symbols/reviews';
|
||||||
import { Button } from '../../common/Button/Button';
|
import { Button } from '../../common/Button/Button';
|
||||||
import { Chip, flagMap } from '../../common/Chip/Chip';
|
import { Chip, flagMap } from '../../common/Chip/Chip';
|
||||||
import Icon from '../../common/Icon/Icon';
|
import Divider from '../../common/Divider/Divider';
|
||||||
import Text from '../../common/Text/Text';
|
import Text from '../../common/Text/Text';
|
||||||
|
|
||||||
interface CourseHeadingAndActionsProps {
|
interface CourseHeadingAndActionsProps {
|
||||||
|
/* The course to display */
|
||||||
course: Course;
|
course: Course;
|
||||||
|
/* The function to call when the popup should be closed */
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders the heading component for the CoursePopup component.
|
||||||
|
*
|
||||||
|
* @param {CourseHeadingAndActionsProps} props - The component props.
|
||||||
|
* @returns {JSX.Element} The rendered component.
|
||||||
|
*/
|
||||||
const CourseHeadingAndActions = ({ course, onClose }: CourseHeadingAndActionsProps) => {
|
const CourseHeadingAndActions = ({ course, onClose }: CourseHeadingAndActionsProps) => {
|
||||||
const { courseName, department, number, uniqueId, instructors, flags, schedule } = course;
|
const { courseName, department, number, uniqueId, instructors, flags, schedule } = course;
|
||||||
const instructorString = instructors
|
const instructorString = instructors
|
||||||
@@ -18,6 +33,11 @@ const CourseHeadingAndActions = ({ course, onClose }: CourseHeadingAndActionsPro
|
|||||||
return `${firstInitial}${instructor.lastName}`;
|
return `${firstInitial}${instructor.lastName}`;
|
||||||
})
|
})
|
||||||
.join(', ');
|
.join(', ');
|
||||||
|
|
||||||
|
const handleCopy = () => {
|
||||||
|
navigator.clipboard.writeText(uniqueId.toString());
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='w-full pb-3 pt-6'>
|
<div className='w-full pb-3 pt-6'>
|
||||||
<div className='flex flex-col gap-1'>
|
<div className='flex flex-col gap-1'>
|
||||||
@@ -25,17 +45,19 @@ const CourseHeadingAndActions = ({ course, onClose }: CourseHeadingAndActionsPro
|
|||||||
<Text variant='h1' className='flex items-center'>
|
<Text variant='h1' className='flex items-center'>
|
||||||
{courseName} ({department} {number})
|
{courseName} ({department} {number})
|
||||||
</Text>
|
</Text>
|
||||||
{/* TODO: change this button, include the left icon */}
|
{/* need to do handlers */}
|
||||||
<Button>{uniqueId}</Button>
|
<div className='ml-3'>
|
||||||
<Button onClick={onClose}>
|
<Button color='ut-burntorange' variant='single' icon={Copy} onClick={handleCopy}>
|
||||||
<Icon name='close' />
|
{uniqueId}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
<Button variant='single' icon={Close} color='ut-black' onClick={onClose} />
|
||||||
|
</div>
|
||||||
<div className='flex gap-2.5 flex-content-center'>
|
<div className='flex gap-2.5 flex-content-center'>
|
||||||
<Text variant='h4' className='text-'>
|
<Text variant='h4' className='text-'>
|
||||||
with <span className='text-ut-burntorange underline'>{instructorString}</span>
|
with <span className='text-ut-burntorange underline'>{instructorString}</span>
|
||||||
</Text>
|
</Text>
|
||||||
<div className='flex gap-1 flex-content-center'>
|
<div className='flex-content-centr flex gap-1'>
|
||||||
{flags.map(flag => (
|
{flags.map(flag => (
|
||||||
<Chip label={flagMap[flag]} />
|
<Chip label={flagMap[flag]} />
|
||||||
))}
|
))}
|
||||||
@@ -58,11 +80,21 @@ const CourseHeadingAndActions = ({ course, onClose }: CourseHeadingAndActionsPro
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='my-3 flex justify-start gap-1'>
|
<div className='my-3 h-[40px] flex items-center gap-[15px]'>
|
||||||
<Button className='m0'>
|
<Button variant='filled' color='ut-burntorange' icon={CalendarMonth} />
|
||||||
<Icon name='calendar_today' />
|
<Divider type='solid' color='ut-offwhite' className='h-[28px]' />
|
||||||
|
<Button variant='outline' color='ut-blue' icon={Reviews}>
|
||||||
|
RateMyProf
|
||||||
|
</Button>
|
||||||
|
<Button variant='outline' color='ut-teal' icon={Mood}>
|
||||||
|
CES
|
||||||
|
</Button>
|
||||||
|
<Button variant='outline' color='ut-orange' icon={Description}>
|
||||||
|
Past Syllabi
|
||||||
|
</Button>
|
||||||
|
<Button variant='filled' color='ut-green' icon={Add}>
|
||||||
|
Add Course
|
||||||
</Button>
|
</Button>
|
||||||
<Button>RateMyProf</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user