Skip to content

Commit

Permalink
Merge pull request pclubiitk#39 from shreyashree-17/main
Browse files Browse the repository at this point in the history
dashboard ui bug fixed
  • Loading branch information
Prathamsahu52 authored Dec 25, 2023
2 parents bf4120d + 7062946 commit 05ebf1a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 48 deletions.
34 changes: 7 additions & 27 deletions components/matchedResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,17 @@ import { Matched_Ids, Matches } from '@/utils/UserData';

const Results = () => {

// let Matches: Student[] = []


// useEffect(() => {
// // Fetching Data of the Matched_Ids for Displaying
// const display_result = async() => {
// await get_result();
// for(let j=0; j < Matched_Ids.length; j++) {
// const data: Array<Student> = search_students(Matched_Ids[j]);
// if(!data.length) {
// return;
// }
// const student = data[0];
// Matches.push(student)
// }
// console.log(Matches)
// }
// display_result();
// }, [])

// console.log(Matches)
return (
<div>
{Matches.map((student) => (
<MatchedCard
key={student.i}
student={student}
matched
/>
// <MatchedCard
// key={student.i}
// student={student}
// matched
// />
<div>{student.i}</div>
))}
</div>
</div>
);
};

Expand Down
20 changes: 19 additions & 1 deletion pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ import "../app/globals.css";
import GoToTop from '@/components/GoToTop';
import { useRouter } from 'next/router';
import Clear from '@/components/clear';import { SendHeart } from '@/utils/API_Calls/Send_Heart';
import {receiverIds, setUser, user} from '../utils/UserData';
import {Matched_Ids, receiverIds, setMatches, setUser, user} from '../utils/UserData';
import { handle_Logout } from '@/utils/API_Calls/login_api';
import { Id, Submit} from "../utils/UserData"
import Link from 'next/link';
import { search_students,Student } from '@/utils/API_Calls/search';
import { get_result } from '@/utils/API_Calls/get_results';

const SERVER_IP = process.env.SERVER_IP

Expand Down Expand Up @@ -201,6 +202,23 @@ const New = () => {
setShowStud(!isShowStud);
}

useEffect(() => {
const show_result = async() => {
await get_result();
setMatches([])
for(let j=0; j < Matched_Ids.length; j++) {
const data: Array<Student> = search_students(Matched_Ids[j]);
if(!data.length) {
return;
}
const student = data[0];
console.log(student)
setMatches(student)
}
}
show_result();
}, [])

const stylesss = {
backgroundImage: `url("https://home.iitk.ac.in/~${user?.u}/dp"), url("https://oa.cc.iitk.ac.in/Oa/Jsp/Photo/${user?.i}_0.jpg"), url("/dummy.png")`,
};
Expand Down
19 changes: 1 addition & 18 deletions pages/result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,14 @@ import { get_result } from "@/utils/API_Calls/get_results";

const ResultPage = () => {

useEffect(() => {
const show_result = async() => {
await get_result();
for(let j=0; j < Matched_Ids.length; j++) {
const data: Array<Student> = search_students(Matched_Ids[j]);
if(!data.length) {
return;
}
const student = data[0];
setMatches(student)
}
}
show_result();
}, [])



const stylesss = {
backgroundImage: `url("https://home.iitk.ac.in/~${user?.u}/dp"), url("https://oa.cc.iitk.ac.in/Oa/Jsp/Photo/${user?.i}_0.jpg"), url("/dummy.png")`,
};

return (
<div className='box'>
<Clear />
<div className='hero'>
<div className='heror'>
<div className='section-Ar'>
<div className='section_1r'>
<div className="info">
Expand Down
2 changes: 1 addition & 1 deletion styles/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@

}

logout-button-div{
.logout-button-div{
max-width: 100%;
display: flex;
justify-content: flex-end;
Expand Down
2 changes: 1 addition & 1 deletion styles/result-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
max-width: 100%;
}

.hero{
.heror{
max-width: 100%;
padding: 1rem;
display: grid;
Expand Down

0 comments on commit 05ebf1a

Please sign in to comment.