From a8fa1b520552ba1bc03b6d60d4f66db406e5e7a8 Mon Sep 17 00:00:00 2001 From: rutug Date: Sun, 31 May 2020 14:27:08 +0530 Subject: [PATCH] Routes --- package-lock.json | 3 + placementfrontend/public/index.html | 2 +- placementfrontend/src/App.js | 31 +- .../src/components/AddComp_Companies.js | 46 ++ .../src/components/AddCompanies.js | 42 +- .../src/components/AddDets_Sidenav.js | 20 + .../{navbar2.js => AddDets_navbar.js} | 19 +- .../src/components/AddDets_navbar2.js | 34 + placementfrontend/src/components/Body.js | 26 +- placementfrontend/src/components/Companies.js | 16 +- .../src/components/CompanyNavbar.js | 18 +- .../src/components/CompanyPage.js | 50 +- .../src/components/CompanyStudentTab.js | 16 +- .../src/components/Department.js | 12 +- .../src/components/EditDetail.js | 34 +- placementfrontend/src/components/Modal.js | 35 +- placementfrontend/src/components/NavbarPC.js | 8 +- placementfrontend/src/components/Sidenav.js | 4 +- .../src/components/StudentDashboard.js | 36 +- .../src/components/StudentDashboardNavbar.js | 2 +- .../src/components/StudentDashboardTab.js | 18 +- placementfrontend/src/components/Students.js | 16 +- .../src/components/StudentsPC.js | 16 +- placementfrontend/src/components/navbar.js | 12 +- .../src/css_styling/Studentprofile.css | 32 +- placementfrontend/src/css_styling/Tpo2.css | 51 +- placementfrontend/src/css_styling/addComp.css | 682 +++++++++--------- placementfrontend/src/css_styling/display.css | 301 ++++---- .../src/css_stylings/CompanyMain.css | 43 +- .../src/css_stylings/CompanyNavbar.css | 20 +- .../src/css_stylings/CompanyPage.css | 47 +- .../src/css_stylings/CompanyStudentTab.css | 15 +- .../src/css_stylings/StudentDashboard.css | 46 +- .../src/css_stylings/StudentDashboardMain.css | 46 +- .../css_stylings/StudentDashboardNavbar.css | 8 +- .../src/css_stylings/StudentDashboardTab.css | 12 +- placementfrontend/src/pages/AddDetails.js | 18 +- placementfrontend/src/pages/CompanyMain.js | 10 +- placementfrontend/src/pages/DisplayDetails.js | 37 +- placementfrontend/src/pages/Login.js | 2 +- .../src/pages/PlacementCoDashboard.js | 10 +- placementfrontend/src/pages/StaffSU.js | 6 +- .../src/pages/StudentDashboardMain.js | 12 +- placementfrontend/src/pages/StudentSU.js | 6 +- placementfrontend/src/pages/Studentprofile.js | 2 +- placementfrontend/src/pages/Tpo2.js | 10 +- 46 files changed, 994 insertions(+), 938 deletions(-) create mode 100644 package-lock.json create mode 100644 placementfrontend/src/components/AddComp_Companies.js create mode 100644 placementfrontend/src/components/AddDets_Sidenav.js rename placementfrontend/src/components/{navbar2.js => AddDets_navbar.js} (52%) create mode 100644 placementfrontend/src/components/AddDets_navbar2.js diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..48e341a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3 @@ +{ + "lockfileVersion": 1 +} diff --git a/placementfrontend/public/index.html b/placementfrontend/public/index.html index 34cd071..8dd4888 100644 --- a/placementfrontend/public/index.html +++ b/placementfrontend/public/index.html @@ -25,7 +25,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - React App + Placement Portal diff --git a/placementfrontend/src/App.js b/placementfrontend/src/App.js index d246a71..7ec9a8d 100644 --- a/placementfrontend/src/App.js +++ b/placementfrontend/src/App.js @@ -7,7 +7,6 @@ import StudentSU from './pages/StudentSU.js' import StaffSU from './pages/StaffSU'; import AddDetails from './pages/AddDetails'; import DisplayDetails from './pages/DisplayDetails'; -import StaffSU from './pages/StaffSU.js' import Studentprofile from './pages/Studentprofile'; import PlacementCoDashboard from './pages/PlacementCoDashboard' import Tpo2 from './pages/Tpo2'; @@ -19,21 +18,23 @@ function App() { return (
- - {/* - - {/* - - - - - - */} - - - {/**/} - + + + + + + + + + + + + {/* Routes yet to be setup*/} + + + + {/* */}
diff --git a/placementfrontend/src/components/AddComp_Companies.js b/placementfrontend/src/components/AddComp_Companies.js new file mode 100644 index 0000000..8c654d7 --- /dev/null +++ b/placementfrontend/src/components/AddComp_Companies.js @@ -0,0 +1,46 @@ +import React from 'react'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faChevronDown } from '@fortawesome/free-solid-svg-icons' +import '../css_styling/addComp.css'; +import Empty from '../assets/empty.jpg'; + +const Companies = ({companies, showMore,showItems}) => { + const companyList = companies.length ? ( + companies.slice(0,showItems).map(company => { + return ( + +
+
+ default +
+
+

Name : {company.name}

+

Category : {company.category}

+

Link : {company.link}

+
+ + {/* {deleteCompany(company.id)}}>{company.content} */} +
+ ) + }) + ) : ( +

No companies to show

+ ); + + return ( +
+
+

COMPANIES

+
+ {companyList} +
+
+
+ +
+ +
+ ) +} + +export default Companies; diff --git a/placementfrontend/src/components/AddCompanies.js b/placementfrontend/src/components/AddCompanies.js index f079bd8..0ea8248 100644 --- a/placementfrontend/src/components/AddCompanies.js +++ b/placementfrontend/src/components/AddCompanies.js @@ -1,5 +1,6 @@ import React, { Component } from 'react'; -import '../css_styling/addComp.css' +import '../css_styling/addComp.css'; +import { withRouter} from 'react-router-dom'; class AddCompanies extends Component { state = { name: null, @@ -41,7 +42,7 @@ class AddCompanies extends Component { handleAddMore=(e)=> { - { + this.setState((prevState) =>({addFields:[...prevState.addFields,{ position:"", noOfPos:"", @@ -49,7 +50,7 @@ handleAddMore=(e)=> deadline:"", package:"", addDets:""}]})); - } + // e.preventDefault(); // var text= document.getElementById('wrapper').innerHTML // document.getElementById('wrapper').innerHTML += text; @@ -57,7 +58,8 @@ handleAddMore=(e)=> handleSubmit = (e) => { e.preventDefault(); this.props.addCompanies(this.state); - console.log(this.state) + console.log(this.state); + this.props.history.push('/display'); } onFocus= (e)=>{ e.currentTarget.type = "date"; @@ -68,18 +70,18 @@ onBlur=(e)=>{ } render() { return ( -
-

ADD COMPANY

+
+

ADD COMPANY

-
- +
+
-
+
{ this.state.addFields.map((field,index)=>{ let position = `position-${index}`, addDets = `addDets-${index}` ,packages = `packages-${index}`,deadline = `deadline-${index}`,Interviewdate = `Interviewdate-${index}` , noOfPos = `noOfPos-${index}` @@ -87,14 +89,14 @@ onBlur=(e)=>{
-
- - - - - +
+ + + + +
- +
@@ -106,9 +108,9 @@ onBlur=(e)=>{ }) } -
- - +
+ +
@@ -119,4 +121,4 @@ onBlur=(e)=>{ } } -export default AddCompanies; \ No newline at end of file +export default withRouter(AddCompanies); \ No newline at end of file diff --git a/placementfrontend/src/components/AddDets_Sidenav.js b/placementfrontend/src/components/AddDets_Sidenav.js new file mode 100644 index 0000000..78b5102 --- /dev/null +++ b/placementfrontend/src/components/AddDets_Sidenav.js @@ -0,0 +1,20 @@ +import React from 'react'; +import Profile from '../assets/default.png'; +import '../css_styling/addComp.css'; + + + +function SidenavR(){ + return( + +
+
+img +

ADMIN

+

........

+
+
+ + )} + + export default SidenavR; \ No newline at end of file diff --git a/placementfrontend/src/components/navbar2.js b/placementfrontend/src/components/AddDets_navbar.js similarity index 52% rename from placementfrontend/src/components/navbar2.js rename to placementfrontend/src/components/AddDets_navbar.js index 909122e..e255bb0 100644 --- a/placementfrontend/src/components/navbar2.js +++ b/placementfrontend/src/components/AddDets_navbar.js @@ -1,20 +1,20 @@ import React from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faSearch } from '@fortawesome/free-solid-svg-icons' -import '../css_styling/display.css' +import '../css_styling/addComp.css'; +import {Link} from 'react-router-dom'; -function Nav2(){ +function NavR(){ return( -
- NAME - APPLICANTS - +
+ RECRUITERS + STUDENTS
-
+
- +
@@ -30,4 +30,5 @@ function Nav2(){
)} - export default Nav2; \ No newline at end of file + export default NavR; + \ No newline at end of file diff --git a/placementfrontend/src/components/AddDets_navbar2.js b/placementfrontend/src/components/AddDets_navbar2.js new file mode 100644 index 0000000..c42f4e6 --- /dev/null +++ b/placementfrontend/src/components/AddDets_navbar2.js @@ -0,0 +1,34 @@ +import React from 'react'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faSearch } from '@fortawesome/free-solid-svg-icons' +import '../css_styling/display.css'; +import {Link} from 'react-router-dom'; + + +function NavR2(){ + return( +
+ NAME + APPLICANTS + +
+ +
+ + +
+
+ + {/*
+
+
+ + +
+ +
+
*/} +
+ + )} + export default NavR2; \ No newline at end of file diff --git a/placementfrontend/src/components/Body.js b/placementfrontend/src/components/Body.js index a184510..2c9035f 100644 --- a/placementfrontend/src/components/Body.js +++ b/placementfrontend/src/components/Body.js @@ -32,36 +32,36 @@ class Body extends Component{
-
-
- profile -

{student.fname} {student.lname}

+
+
+ profile +

{student.fname} {student.lname}

-
+
- +
- +
- +
- +
- +
- +
- + -

+

diff --git a/placementfrontend/src/components/Companies.js b/placementfrontend/src/components/Companies.js index 7ab3353..8423f5c 100644 --- a/placementfrontend/src/components/Companies.js +++ b/placementfrontend/src/components/Companies.js @@ -3,11 +3,11 @@ import React from 'react'; const Companies = ({ companies, showCompanies, handleShowMoreCompanies }) => { const list = companies.slice(0, showCompanies).map(company => { return ( -
-
- +
+
+
-
+

Name : {company.name}

Position : {company.pos}

@@ -15,14 +15,14 @@ const Companies = ({ companies, showCompanies, handleShowMoreCompanies }) => { ) }) return ( -
+

COMPANIES

-
+
{list}
-
- +
+
diff --git a/placementfrontend/src/components/CompanyNavbar.js b/placementfrontend/src/components/CompanyNavbar.js index 96c8b15..af87296 100644 --- a/placementfrontend/src/components/CompanyNavbar.js +++ b/placementfrontend/src/components/CompanyNavbar.js @@ -4,22 +4,22 @@ import 'bootstrap/dist/css/bootstrap.min.css'; const Navbar=() => { return(
-
-