renamed panel to popup since that's kinda what it is lmao

This commit is contained in:
Sriram Hariharan
2023-03-05 20:50:40 -06:00
parent 295b466505
commit 6d69cd2548
6 changed files with 35 additions and 35 deletions

View File

@@ -9,7 +9,7 @@ import ExtensionRoot from './common/ExtensionRoot/ExtensionRoot';
import Icon from './common/Icon/Icon'; import Icon from './common/Icon/Icon';
import Text from './common/Text/Text'; import Text from './common/Text/Text';
import AutoLoad from './injected/AutoLoad/AutoLoad'; import AutoLoad from './injected/AutoLoad/AutoLoad';
import CoursePanel from './injected/CoursePanel/CoursePanel'; import CoursePopup from './injected/CoursePopup/CoursePopup';
import TableHead from './injected/TableHead'; import TableHead from './injected/TableHead';
import TableRow from './injected/TableRow/TableRow'; import TableRow from './injected/TableRow/TableRow';
@@ -65,6 +65,7 @@ export default function CourseCatalogMain({ support }: Props) {
} }
return ( return (
<TableRow <TableRow
key={row.course.uniqueId}
element={row.element} element={row.element}
course={row.course} course={row.course}
isSelected={row.course.uniqueId === selectedCourse?.uniqueId} isSelected={row.course.uniqueId === selectedCourse?.uniqueId}
@@ -73,7 +74,7 @@ export default function CourseCatalogMain({ support }: Props) {
/> />
); );
})} })}
{selectedCourse && <CoursePanel course={selectedCourse} onClose={handleClearSelectedCourse} />} {selectedCourse && <CoursePopup course={selectedCourse} onClose={handleClearSelectedCourse} />}
<AutoLoad addRows={addRows} /> <AutoLoad addRows={addRows} />
</ExtensionRoot> </ExtensionRoot>
); );

View File

@@ -18,7 +18,7 @@
.body { .body {
overflow-y: auto; overflow-y: auto;
z-index: 2147483647; z-index: 2147483647;
background-color: rgb(52, 53, 65); background-color: $white;
box-shadow: 0px 12px 30px 0px #323e5f29; box-shadow: 0px 12px 30px 0px #323e5f29;
transition: box-shadow 0.15s; transition: box-shadow 0.15s;
} }

View File

@@ -1,18 +1,19 @@
import classNames from 'classnames'; import classNames from 'classnames';
import React, { PropsWithChildren } from 'react'; import React, { PropsWithChildren } from 'react';
import styles from './Panel.module.scss'; import styles from './Popup.module.scss';
interface Props { interface Props {
testId?: string; testId?: string;
style?: React.CSSProperties; style?: React.CSSProperties;
className?: string; className?: string;
/** Should it display a subtle dark overlay over the rest of the screen */
overlay?: boolean; overlay?: boolean;
} }
/** /**
* *
*/ */
export default function Panel(props: PropsWithChildren<Props>) { export default function Popup(props: PropsWithChildren<Props>) {
return ( return (
<div <div
style={props.style} style={props.style}

View File

@@ -1,26 +0,0 @@
import React from 'react';
import { Course } from 'src/shared/types/Course';
import Panel from '../../common/Panel/Panel';
import styles from './CoursePanel.module.scss';
interface Props {
course: Course;
onClose: () => void;
}
export default function CoursePanel({ course, onClose }: Props) {
return (
<Panel overlay>
<div className={styles.coursePanelHeader} id='coursePanelHeader'>
<div onClick={onClose} className={styles.closePanelButton}>
&#x2715;
</div>
</div>
<div className={styles.panelBody}>
<div className={styles.courseTitle}>{course.courseName}</div>
<div className={styles.courseDescription}>{course.uniqueId}</div>
</div>
</Panel>
);
}

View File

@@ -1,4 +1,4 @@
.panelBody { .popupBody {
height: auto; height: auto;
color: white; color: white;
padding: 10px; padding: 10px;
@@ -7,7 +7,7 @@
justify-content: center; justify-content: center;
} }
.coursePanelBase { .coursePopupBase {
position: fixed; position: fixed;
transform: translateY(-50%); transform: translateY(-50%);
top: 15px; top: 15px;
@@ -15,13 +15,13 @@
z-index: 2147483647; z-index: 2147483647;
} }
.coursePanelHeader { .coursePopupHeader {
display: flex; display: flex;
height: 50; height: 50;
background-color: #29465b; background-color: #29465b;
width: 100%; width: 100%;
.closePanelButton { .closePopupButton {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@@ -0,0 +1,24 @@
import React from 'react';
import { Course } from 'src/shared/types/Course';
import Icon from '../../common/Icon/Icon';
import Popup from '../../common/Popup/Popup';
import styles from './CoursePopup.module.scss';
interface Props {
course: Course;
onClose: () => void;
}
/**
* The popup that appears when the user clicks on a course for more details.
*/
export default function CoursePopup({ course, onClose }: Props) {
return (
<Popup overlay>
<div className={styles.popupBody}>
<div className={styles.courseTitle}>{course.courseName}</div>
<div className={styles.courseDescription}>{course.uniqueId}</div>
</div>
</Popup>
);
}