Skip to content

Commit

Permalink
Resolve miscellaneous nonfatal React errors
Browse files Browse the repository at this point in the history
  • Loading branch information
n8srumsey committed Nov 16, 2024
1 parent a7a9dd7 commit 55820a2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
3 changes: 2 additions & 1 deletion client/src/components/nav/TopNavbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ function LoggedIn(props) {

return (
<>
{navItems.map((item) => (
{navItems.map((item, index) => (
<a
key={index}
href={item.path}
className={`page ${item.className} ${
pathname === item.path ? "curr" : ""
Expand Down
30 changes: 15 additions & 15 deletions client/src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ import "../styles/home.css"
function Home() {
return(
<div id="home">
<div class="section">
<p class="homeHeader">Welcome to MyClassroom</p>
<div className="section">
<p className="homeHeader">Welcome to MyClassroom</p>
<p>Open-Source Classroom Polling Software</p>
</div>

<div class="infoContainer">
<div class="infoConnector"></div>
<div class="infoBox leftBox">
<div className="infoContainer">
<div className="infoConnector"></div>
<div className="infoBox leftBox">
<img src="classroom.png"></img>
<p class="infoText">Create courses and manage lectures easily.</p>
<p className="infoText">Create courses and manage lectures easily.</p>
</div>
<div class="infoBox rightBox">
<div className="infoBox rightBox">
<img src="goal.png"></img>
<p class="infoText">Track student progress and manage grades.</p>
<p className="infoText">Track student progress and manage grades.</p>
</div>
<div class="infoBox leftBox">
<div className="infoBox leftBox">
<img src="lms.png"></img>
<p class="infoText">Seamless integration with educational platforms.</p>
<p className="infoText">Seamless integration with educational platforms.</p>
</div>
<div class="infoBox rightBox">
<div className="infoBox rightBox">
<img src="graph.png"></img>
<p class="infoText">Boost student engagement with interactive polls.</p>
<p className="infoText">Boost student engagement with interactive polls.</p>
</div>
<div class="infoBox leftBox">
<div className="infoBox leftBox">
<img src="school.png"></img>
<p class="infoText">Highly customizable and free to use.</p>
<p className="infoText">Highly customizable and free to use.</p>
</div>
</div>
</div>
)
}

export default Home
export default Home
8 changes: 5 additions & 3 deletions client/src/pages/SingleCoursePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ function DisplayCoursePage(){
const { courseId } = useParams()
let navigate = useNavigate()
const [ course, role, message, error, loading ] = useCourse()
if (role === "student") {
navigate(`/${courseId}/lectures`)
}
useEffect(() => {
if (role === "student") {
navigate(`/${courseId}/lectures`);
}
}, [role, navigate, courseId]);

return <>
{ loading ? <TailSpin visibile={true}/> : (error ? <Notice message={message} error={error ? "error" : ""}/> : <div className="singleCourseContainer">
Expand Down

0 comments on commit 55820a2

Please # to comment.