Skip to content

Commit 6a8017f

Browse files
committedApr 8, 2023
Revert "updates"
This reverts commit 772d71c.
1 parent b486522 commit 6a8017f

11 files changed

+13
-147
lines changed
 

‎package-lock.json

-113
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"react": "^18.2.0",
1818
"react-avatar": "^5.0.3",
1919
"react-bootstrap": "^2.4.0",
20-
"react-cookie": "^4.1.1",
2120
"react-countup": "^6.2.0",
2221
"react-dom": "^18.2.0",
2322
"react-easy-swipe": "^0.0.22",

‎src/AppRouter.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ const AppRouter = () => {
8282
<main className='flex-auto w-full min-w-0 lg:static lg:max-h-full lg:overflow-visible min-h-screen'>
8383
<div className="w-full flex mt-0">
8484
<Routes>
85-
<Route path='/dept/:dept/Home/:id' element={<Homepage />} />
86-
<Route path='/dept/:dept/Home/' element={<Homepage />} />
85+
<Route path='/dept/:dept/Home' element={<Homepage />} />
8786
<Route path='/dept/:dept/Placement' element={<AllPlacement />} />
8887
<Route path='/*' element={<Error />} />
8988
{/* About us */}

‎src/components/Profile.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,11 @@ function Profile({ peopleType }) {
183183
<span title='Download Table in Excel Format' className={"w-12 cursor-pointer px-3 "}>
184184
<img src={Exceldownloadpdf} alt="Excel download" />
185185
</span>
186-
{isLogin && data?.validation?.status?.isFaculty &&
187-
<span className={"cursor-pointer px-3 " + (edit ? 'hidden ' : '') + (isLogin ? '' : 'hidden')}><i className="fa-solid fa-eye"></i></span>}
188-
{isLogin && data?.validation?.status?.isFaculty && <span title='View as Table' className={"cursor-pointer px-3 " + (edit ? '' : 'hidden ')} onClick={() => setview()}><i className="fa-solid fa-eye-slash"></i></span>}
189-
{isLogin && data?.validation?.status?.isFaculty && <span title='Add new data' className={'cursor-pointer px-3'} onClick={() => setedit()}><i className="fa-solid fa-pen-to-square"></i></span>}
186+
{isLogin && <>
187+
<span className={"cursor-pointer px-3 " + (edit ? 'hidden ' : '') + (isLogin ? '' : 'hidden')}><i className="fa-solid fa-eye"></i></span>
188+
<span title='View as Table' className={"cursor-pointer px-3 " + (edit ? '' : 'hidden ')} onClick={() => setview()}><i className="fa-solid fa-eye-slash"></i></span>
189+
<span title='Add new data' className={'cursor-pointer px-3'} onClick={() => setedit()}><i className="fa-solid fa-pen-to-square"></i></span>
190+
</>}
190191
</div>
191192
</div>
192193
<div className='p-2 mt-4'>

‎src/index.js

-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@ import React from 'react';
22
import ReactDOM from 'react-dom/client';
33
import './index.css';
44
import App from './App';
5-
import { CookiesProvider } from 'react-cookie';
65

76
const root = ReactDOM.createRoot(document.getElementById('root'));
87
root.render(
98
<React.StrictMode>
10-
<CookiesProvider>
119
<App />
12-
</CookiesProvider>
1310
</React.StrictMode>
1411
);
1512

‎src/pages/AfterForgotPass.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react";
22
import { Link, useLocation, useNavigate } from "react-router-dom";
3-
import { SERVER_URL } from '../config/server';
43

54
function AfterForgotPass() {
65
const url = useLocation();
@@ -25,7 +24,7 @@ function AfterForgotPass() {
2524
<form
2625
className="px-8 pt-6 pb-8 mb-4 bg-white rounded"
2726
method="post"
28-
action={`${SERVER_URL}/dept/${dept}/confirmation`}
27+
action={`http://localhost:8000/dept/${dept}/confirmation`}
2928
>
3029
<div className="mb-4">
3130
<label

‎src/pages/BaseTable.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import axios from 'axios';
22
import React, { useEffect, useState } from 'react'
33
import { useLocation } from 'react-router-dom';
4-
import { SERVER_URL } from '../config/server';
5-
64

75
function BaseTable({ edit, tablehead, data, Editfeild, HandleEdit,feild,isLogin ,faculty,title}) {
86
const [changedata, setChangedata] = useState(data);
@@ -36,7 +34,7 @@ function BaseTable({ edit, tablehead, data, Editfeild, HandleEdit,feild,isLogin
3634
data.push(newRow);
3735
else data[Editfeild] = newRow;
3836
try {
39-
await axios.put(`${SERVER_URL}/dept/${dept}/Faculty/${faculty._id}?q=${title}`,data);
37+
await axios.put(`http://localhost:8000/dept/${dept}/Faculty/${faculty._id}?q=${title}`,data);
4038
} catch (error) {
4139
console.log(error);
4240
}
@@ -46,7 +44,7 @@ function BaseTable({ edit, tablehead, data, Editfeild, HandleEdit,feild,isLogin
4644

4745
const newRow = data.filter((val,ind)=> ind!==index);
4846
try {
49-
await axios.put(`${SERVER_URL}/dept/${dept}/Faculty/${faculty._id}?q=${title}`,newRow);
47+
await axios.put(`http://localhost:8000/dept/${dept}/Faculty/${faculty._id}?q=${title}`,newRow);
5048
} catch (error) {
5149
console.log(error);
5250
}

‎src/pages/ChangePass.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import React, { useEffect } from "react";
22
import { useLocation, useNavigate } from "react-router-dom";
33
import useFetch from "../hooks/useFetch";
44
import Error from "./Errorpage";
5-
import { SERVER_URL } from '../config/server';
6-
75

86
function ChangePass() {
97
let url = useLocation();
@@ -29,7 +27,7 @@ function ChangePass() {
2927
</h1>
3028
<form
3129
className="space-y-4 md:space-y-6"
32-
action={`${SERVER_URL}/dept/${dept}/confirmation/submit/${token}`}
30+
action={`http://localhost:8000/dept/${dept}/confirmation/submit/${token}`}
3331
method="POST"
3432
>
3533
<div>

‎src/pages/Faculty.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ function Faculty() {
1313
)
1414
}
1515

16-
export default Faculty
16+
export default Faculty

‎src/pages/FacultyLogin.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function FacultyLogin() {
88
const dept = params?.dept;
99
const status = params?.status;
1010

11+
1112
return (
1213
<section className="bg-blue-50/60 w-full">
1314
<div className="flex flex-col items-center justify-center px-6 py-8 mx-auto md:h-screen lg:py-0">

‎src/pages/Homepage.js

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1-
import React, {useEffect} from 'react'
2-
import {useCookies} from "react-cookie";
3-
import {useParams} from 'react-router-dom';
1+
import React from 'react'
42
import { Department } from '../components/department'
53
import Imagesroll from '../components/Imagesroll'
64
import TopPlacement from '../components/TopPlacement'
75

86
function Homepage() {
9-
const params = useParams();
10-
const [cookies, setCookie, removeCookie] = useCookies(['session']);
11-
12-
useEffect(() => {
13-
const sessionID = params?.id;
14-
15-
if(sessionID != null){
16-
setCookie('session', sessionID, {maxAge: 90*24*60*60*100, path: '/'});
17-
}
18-
}, [])
19-
207
return (
218
<div className='flex items-center flex-col w-full h-full px-auto mt-0'>
229
<Imagesroll/>

0 commit comments

Comments
 (0)
Please sign in to comment.