From 09e5f5d9eb37818d847131ac618e0e859a53b20d Mon Sep 17 00:00:00 2001 From: shrushtidoshi22 Date: Tue, 24 Sep 2024 11:31:44 +0530 Subject: [PATCH 1/6] Converted html to react Addbootcamp page --- ui/package-lock.json | 4 +- ui/src/App.js | 2 + ui/src/components/Header.jsx | 38 +++++-- ui/src/pages/AddBootcampPage.jsx | 170 +++++++++++++++++++++++++++++++ 4 files changed, 202 insertions(+), 12 deletions(-) create mode 100644 ui/src/pages/AddBootcampPage.jsx diff --git a/ui/package-lock.json b/ui/package-lock.json index 8c4fc8a..be46f73 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1,11 +1,11 @@ { - "name": "devCamper-ui", + "name": "devcamper-ui", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "devCamper-ui", + "name": "devcamper-ui", "version": "0.1.0", "dependencies": { "bootstrap": "^5.3.3", diff --git a/ui/src/App.js b/ui/src/App.js index 005635a..5db58bd 100644 --- a/ui/src/App.js +++ b/ui/src/App.js @@ -6,6 +6,7 @@ import LoginPage from './pages/LoginPage'; import RegisterPage from './pages/RegisterPage'; import AboutPage from './pages/AboutPage'; import BootcampsPage from './pages/BootcampsPage'; +import AddBootcampPage from './pages/AddBootcampPage'; function App() { return ( @@ -18,6 +19,7 @@ function App() { } /> } /> } /> + } /> diff --git a/ui/src/components/Header.jsx b/ui/src/components/Header.jsx index 4aa4234..0d5b56d 100644 --- a/ui/src/components/Header.jsx +++ b/ui/src/components/Header.jsx @@ -2,8 +2,9 @@ import { Link } from 'react-router-dom'; import Container from 'react-bootstrap/Container'; import Nav from 'react-bootstrap/Nav'; import Navbar from 'react-bootstrap/Navbar'; -import { FaGraduationCap, FaSignInAlt, FaUserPlus, FaLaptopCode, FaUser, FaSearch } from 'react-icons/fa'; +import { FaGraduationCap, FaSignInAlt, FaUserPlus, FaLaptopCode, FaUser, FaSearch,FaSignOutAlt } from 'react-icons/fa'; import { useEffect, useState } from 'react'; +import NavDropdown from 'react-bootstrap/NavDropdown'; import { Image } from 'react-bootstrap'; import "../styles/bootstrap.css"; @@ -12,7 +13,7 @@ function Header() { const [getHeader, SetHeader] = useState(false); useEffect(() => { - if (window.location.href.includes('browse')) { + if (window.location.href.includes('addboot')) { SetHeader(true); } else { SetHeader(false); @@ -23,7 +24,7 @@ function Header() { return ( <> {/* */} - {/* {getHeader == true ? + {/*{getHeader == true ? } */} + }*/} @@ -127,12 +128,28 @@ function Header() { } */} @@ -158,9 +158,8 @@ function Header() { - ); } -export default Header; +export default Header; \ No newline at end of file diff --git a/ui/src/pages/AddBootcampPage.jsx b/ui/src/pages/AddBootcampPage.jsx index 0c944ca..4560efb 100644 --- a/ui/src/pages/AddBootcampPage.jsx +++ b/ui/src/pages/AddBootcampPage.jsx @@ -1,5 +1,6 @@ const BrowseBootcampsPage = () => { return ( + //Addbootcamp

Add Bootcamp

From b7f24af27244351a11a3823e00772408521f8288 Mon Sep 17 00:00:00 2001 From: shrushtidoshi22 Date: Wed, 25 Sep 2024 13:43:03 +0530 Subject: [PATCH 3/6] converted addbootcamppage to react --- ui/src/App.js | 2 +- ui/src/components/Header.jsx | 33 ++++++++------------------------ ui/src/pages/AddBootcampPage.jsx | 1 - 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/ui/src/App.js b/ui/src/App.js index 9336ab6..5db58bd 100644 --- a/ui/src/App.js +++ b/ui/src/App.js @@ -19,7 +19,7 @@ function App() { } /> } /> } /> - } /> {/*Mapping*/} + } />
diff --git a/ui/src/components/Header.jsx b/ui/src/components/Header.jsx index a878c3e..d2db1c3 100644 --- a/ui/src/components/Header.jsx +++ b/ui/src/components/Header.jsx @@ -2,10 +2,9 @@ import { Link } from 'react-router-dom'; import Container from 'react-bootstrap/Container'; import Nav from 'react-bootstrap/Nav'; import Navbar from 'react-bootstrap/Navbar'; -import { FaGraduationCap, FaSignInAlt, FaUserPlus, FaLaptopCode,FaSignOutAlt, FaUser, FaSearch } from 'react-icons/fa'; +import { FaGraduationCap, FaSignInAlt, FaUserPlus, FaLaptopCode, FaUser, FaSearch } from 'react-icons/fa'; import "../styles/bootstrap.css"; import { useEffect, useState } from 'react'; -import NavDropdown from 'react-bootstrap/NavDropdown'; import { Image } from 'react-bootstrap'; function Header() { @@ -13,7 +12,7 @@ function Header() { const [getHeader, SetHeader] = useState(false); useEffect(() => { - if (window.location.href.includes('addboot')) { + if (window.location.href.includes('browse')) { SetHeader(true); } else { SetHeader(false); @@ -128,28 +127,12 @@ function Header() {
- } + + )} ); } -export default Header; \ No newline at end of file +export default Header;