Skip to content

Commit 0bbf4f3

Browse files
Feat/coord interface/frontend (#524)
* initial table * table css work * table css work * front end table searching and select data logic * front end table searching and select data logic * search filter works * im done fr now fixed select glitch and styled input and buttons slightly * finished front end table * functions and dropdown basics * touchups for front end filtering integration and css * copy button works and table header structure * fixed filtering bugs and css for action buttons * fixed weird double copy bug * fixed filter copy bug * finished coord interface --------- Co-authored-by: Heidi Chan <heidi.chan@berkeley.edu>
1 parent 88bbbfd commit 0bbf4f3

File tree

11 files changed

+786
-49
lines changed

11 files changed

+786
-49
lines changed

csm_web/frontend/src/components/Home.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ const CourseCard = ({ profiles }: CourseCardProps): React.ReactElement => {
131131

132132
if (role === Role.COORDINATOR) {
133133
return (
134-
<Link to={`/courses/${courseId}`} className="course-card-link">
135-
<Card />
136-
</Link>
134+
<>
135+
<Link to={`/courses/${courseId}`} className="course-card-link">
136+
<Card />
137+
</Link>
138+
</>
137139
);
138140
}
139141

csm_web/frontend/src/components/SearchBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const SearchBar = ({ className, refObject, onChange }: SearchBarProps) =>
1212
return (
1313
<div className={`search-bar ${className ?? ""}`}>
1414
<SearchIcon className="search-icon" />
15-
<input className="search-input" type="text" ref={refObject} onChange={onChange} />
15+
<input placeholder="Search..." className="search-input" type="text" ref={refObject} onChange={onChange} />
1616
</div>
1717
);
1818
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React from "react";
2+
import { useLocation, useNavigate } from "react-router-dom";
3+
4+
interface ActionButtonProps {
5+
copyEmail: () => void;
6+
reset: () => void;
7+
}
8+
9+
export default function ActionButton({ copyEmail, reset }: ActionButtonProps) {
10+
const navigate = useNavigate();
11+
const { pathname } = useLocation();
12+
const isStudents = pathname.includes("students");
13+
function changeURL() {
14+
const newPath = isStudents ? pathname.replace("students", "mentors") : pathname.replace("mentors", "students");
15+
reset();
16+
navigate(newPath);
17+
}
18+
return (
19+
<div className="actionButtons">
20+
<button onClick={copyEmail}>
21+
<div id="default-copy">Copy Selected Emails</div>
22+
<div id="success-copy" className="hidden">
23+
<div className="checkmark"></div>
24+
25+
<div>Copied!</div>
26+
</div>
27+
</button>
28+
{isStudents ? (
29+
<button onClick={changeURL}>
30+
<div>See Mentors</div>
31+
</button>
32+
) : (
33+
<button onClick={changeURL}>
34+
<div>Students</div>
35+
</button>
36+
)}
37+
</div>
38+
);
39+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React from "react";
2+
import styles from "../../css/coord_interface.scss";
3+
4+
interface CheckBoxProps {
5+
id: string;
6+
onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
7+
}
8+
9+
export function CheckBox({ id, onClick: onClick }: CheckBoxProps) {
10+
return (
11+
<td className={styles}>
12+
<div className="checkbox-wrapper">
13+
<input className="inp-cbx" id={id + "check"} type="checkbox" onClick={onClick} />
14+
<label className="cbx" htmlFor={id + "check"}>
15+
<span>
16+
<svg width="12px" height="10px">
17+
<use xlinkHref="#check"></use>
18+
</svg>
19+
</span>
20+
</label>
21+
<svg className="inline-svg">
22+
<symbol id="check" viewBox="0 0 12 10">
23+
<polyline points="1.5 6 4.5 9 10.5 1"></polyline>
24+
</symbol>
25+
</svg>
26+
</div>
27+
</td>
28+
);
29+
}

0 commit comments

Comments
 (0)