Skip to content

Commit 7afdbac

Browse files
description stuff done
1 parent 1a89432 commit 7afdbac

File tree

4 files changed

+43
-3
lines changed

4 files changed

+43
-3
lines changed

src/views/components/injected/CoursePopup/CoursePopup.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import Popup from '@views/components/common/Popup/Popup';
22
import React from 'react';
33
import { Course } from 'src/shared/types/Course';
44
import { UserSchedule } from 'src/shared/types/UserSchedule';
5-
import CourseHeadingAndActions from './CourseHeadingAndActions';
5+
import CoursePopupDescriptions from './CoursePopupDescriptions';
6+
import CoursePopupHeadingAndActions from './CoursePopupHeadingAndActions';
67

78
interface CoursePopup2Props {
89
course: Course;
@@ -11,9 +12,10 @@ interface CoursePopup2Props {
1112
}
1213

1314
const CoursePopup = ({ course, activeSchedule, onClose }: CoursePopup2Props) => (
14-
<Popup overlay className='px-6' onClose={onClose}>
15+
<Popup overlay className='max-w-[780px] px-6' onClose={onClose}>
1516
<div className='flex flex-col'>
16-
<CourseHeadingAndActions course={course} onClose={onClose} activeSchedule={activeSchedule} />
17+
<CoursePopupHeadingAndActions course={course} onClose={onClose} activeSchedule={activeSchedule} />
18+
<CoursePopupDescriptions lines={course.description} />
1719
</div>
1820
</Popup>
1921
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import clsx from 'clsx';
2+
import React from 'react';
3+
import Text from '../../common/Text/Text';
4+
5+
interface CoursePopupDescriptionsProps {
6+
lines: string[];
7+
}
8+
9+
const CoursePopupDescriptions: React.FC<CoursePopupDescriptionsProps> = ({ lines }: CoursePopupDescriptionsProps) => {
10+
const keywords = ['prerequisite', 'restricted'];
11+
return (
12+
<ul className='my-[5px] space-y-1.5 children:marker:text-ut-burntorange'>
13+
{lines.map(line => {
14+
const isKeywordPresent = keywords.some(keyword => line.toLowerCase().includes(keyword));
15+
return (
16+
<div className='flex gap-2'>
17+
<span className='text-ut-burntorange'></span>
18+
<li key={line}>
19+
<Text variant='p' className={clsx({ 'font-bold text-ut-burntorange': isKeywordPresent })}>
20+
{line}
21+
</Text>
22+
</li>
23+
</div>
24+
);
25+
})}
26+
</ul>
27+
);
28+
};
29+
30+
export default CoursePopupDescriptions;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface CoursePopupGradeDistributionProps {}
2+
3+
const CoursePopupGradeDistribution: React.FC<
4+
CoursePopupGradeDistributionProps
5+
> = ({}: CoursePopupGradeDistributionProps) => {};
6+
7+
export default CoursePopupGradeDistribution;

src/views/components/injected/CoursePopup/CourseHeadingAndActions.tsx src/views/components/injected/CoursePopup/CoursePopupHeadingAndActions.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ const CourseHeadingAndActions = ({ course, onClose, activeSchedule }: CourseHead
130130
Add Course
131131
</Button>
132132
</div>
133+
<Divider />
133134
</div>
134135
);
135136
};

0 commit comments

Comments
 (0)