From bec2649fc1244bffb5cb03809db62cc0ea477260 Mon Sep 17 00:00:00 2001 From: DhruvArora-03 Date: Mon, 19 Feb 2024 11:29:24 -0600 Subject: [PATCH] feat: add button to the rows, use new ConflictsWithWarning component --- .../components/injected/TableRow/TableRow.tsx | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/views/components/injected/TableRow/TableRow.tsx b/src/views/components/injected/TableRow/TableRow.tsx index e9c6796ed..a6e82cb10 100644 --- a/src/views/components/injected/TableRow/TableRow.tsx +++ b/src/views/components/injected/TableRow/TableRow.tsx @@ -3,9 +3,9 @@ import { UserSchedule } from '@shared/types/UserSchedule'; import React, { useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; import { Button } from '../../common/Button/Button'; -import Icon from '../../common/Icon/Icon'; -import Text from '../../common/Text/Text'; import styles from './TableRow.module.scss'; +import ConflictsWithWarning from '../../common/ConflictsWithWarning/ConflictsWithWarning'; +import AddIcon from '~icons/material-symbols/add-circle'; interface Props { isSelected: boolean; @@ -54,7 +54,7 @@ export default function TableRow({ row, isSelected, activeSchedule, onClick }: P return () => { element.classList.remove(styles.inActiveSchedule); }; - }, [activeSchedule, element.classList]); + }, [activeSchedule, course, element.classList]); useEffect(() => { if (!activeSchedule || !course) { @@ -84,20 +84,14 @@ export default function TableRow({ row, isSelected, activeSchedule, onClick }: P return ReactDOM.createPortal( <> - - {conflicts.length > 0 && ( -
-
- {conflicts.map(c => ( - - {c.department} {c.number} ({c.uniqueId}) - - ))} -
-
- )} +