Skip to content

Commit

Permalink
Merge pull request #1292 from nishant0708/Scroll_to_top
Browse files Browse the repository at this point in the history
College Social By default redirecting to footer It should open from top +Fixed Some Darkmode Bugs  #1289
  • Loading branch information
thestarsahil authored Jul 29, 2024
2 parents 3115174 + dd59d28 commit 1dc25a4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/components/CollegePage/CollegePage.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
}
#dark .content{
background-color: rgb(37, 37, 37) !important;
color: #ebedee;
}

.abeezee-regular {
Expand Down Expand Up @@ -267,6 +268,7 @@
}
#dark .student-card{
background-color: rgb(37, 37, 37) !important;;
color: #c5d5d4;
}

.student-description {
Expand Down
13 changes: 6 additions & 7 deletions src/components/CollegePage/CollegePage.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useState, useEffect, useCallback } from "react";
import React, { useState, useEffect, useLayoutEffect, useCallback } from "react";
import collegesData from "../Dashboard/colleges.json";
import studentsData from "./students.json";
import "./CollegePage.css";
import { useParams, useNavigate, Link } from "react-router-dom";
import Logo from "../../assets/logo.webp";
import { signOut } from "firebase/auth";
import Navbar from "../Navbar/Navbar";
import { auth } from "../../firebase/auth";
Expand All @@ -15,12 +14,12 @@ import { toast } from "react-toastify";

const CollegePage = () => {
const [selectedStudent, setSelectedStudent] = useState(null);
const navigate = useNavigate();
const { id } = useParams();

useEffect(() => {
useLayoutEffect(() => {
window.scrollTo(0, 0);
}, []);
const navigate = useNavigate();
const { id } = useParams();

useEffect(() => {
auth.onAuthStateChanged((user) => {
Expand Down Expand Up @@ -164,11 +163,11 @@ const CollegePage = () => {
<Link
to={`/student/${student.id}/${student.name}`}
style={{ textDecoration: "none", color: "inherit" }}
key={student.id} // Ensure unique key
>
<div
className="student-card"
onClick={() => handleStudentClick(student)}
key={index}
>
<div
style={{
Expand All @@ -179,7 +178,7 @@ const CollegePage = () => {
}}
>
<img
src={imgArray[index]}
src={imgArray[index % imgArray.length]} // Use modulo for safety
style={{
height: "80%",
minHeight: "66px",
Expand Down
7 changes: 7 additions & 0 deletions src/components/Contact/Contact.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ background-color: #cae8ff !important;
justify-content: center;
align-items: center;
}
#dark .contact1 .left h1 {
color: white;
}
#dark .contact1 .left p {
color: rgb(215, 210, 210);
}
.contact1 .form{
width: 60%;
border-radius: 20px;
Expand All @@ -156,6 +162,7 @@ flex-direction: column;
}
#dark .contact1 .form{
background-color: #080707;
color: white;
border: solid 2px white;
box-shadow: 0px 0px 10px white;

Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const Dashboard = () => {

const handleCollegeClick = useCallback(
(college) => {
navigate(`/college/${college.id}`);
window.location.href=`/college/${college.id}`;
},
[navigate]
);
Expand Down
1 change: 1 addition & 0 deletions src/components/blogs/BlogReadPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
}
#dark .blog-read-page {
background-color: #2d2d2d;
color: white;
}
.blog-header {
margin-bottom: 20px;
Expand Down

0 comments on commit 1dc25a4

Please sign in to comment.