diff --git a/SP23.P03.Web/ClientApp/package-lock.json b/SP23.P03.Web/ClientApp/package-lock.json index 76d883c..2cf8d98 100644 --- a/SP23.P03.Web/ClientApp/package-lock.json +++ b/SP23.P03.Web/ClientApp/package-lock.json @@ -12,6 +12,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.3.4", "bootstrap": "^5.3.0-alpha1", "react": "^18.2.0", "react-bootstrap": "^2.7.2", @@ -5036,6 +5037,29 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz", + "integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", @@ -14073,6 +14097,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -20867,6 +20896,28 @@ "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.6.3.tgz", "integrity": "sha512-/BQzOX780JhsxDnPpH4ZiyrJAzcd8AfzFPkv+89veFSr1rcMjuq2JDCwypKaPeB6ljHp9KjXhPpjgCvQlWYuqg==" }, + "axios": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz", + "integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + }, + "dependencies": { + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, "axobject-query": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", @@ -27237,6 +27288,11 @@ } } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", diff --git a/SP23.P03.Web/ClientApp/package.json b/SP23.P03.Web/ClientApp/package.json index d7b550e..f71fb66 100644 --- a/SP23.P03.Web/ClientApp/package.json +++ b/SP23.P03.Web/ClientApp/package.json @@ -6,6 +6,7 @@ "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.3.4", "bootstrap": "^5.3.0-alpha1", "react": "^18.2.0", "react-bootstrap": "^2.7.2", diff --git a/SP23.P03.Web/ClientApp/src/App.js b/SP23.P03.Web/ClientApp/src/App.js index 74bf1d2..9f0c6e7 100644 --- a/SP23.P03.Web/ClientApp/src/App.js +++ b/SP23.P03.Web/ClientApp/src/App.js @@ -1,12 +1,13 @@ import React from 'react'; -//import logo from './logo.svg'; import './App.css'; import NavBar from './components/NavBar/NavBar'; +import Footer from './components/Footer/Footer'; function App() { return (
+
/*
diff --git a/SP23.P03.Web/ClientApp/src/components/Footer/Footer.js b/SP23.P03.Web/ClientApp/src/components/Footer/Footer.js new file mode 100644 index 0000000..b4cf440 --- /dev/null +++ b/SP23.P03.Web/ClientApp/src/components/Footer/Footer.js @@ -0,0 +1,25 @@ +import React from "react"; +import train from "./train.svg"; +function Footer() { + return ( +
+
+ +
+
+ ); +} + +export default Footer; \ No newline at end of file diff --git a/SP23.P03.Web/ClientApp/src/components/Footer/train.svg b/SP23.P03.Web/ClientApp/src/components/Footer/train.svg new file mode 100644 index 0000000..f0b89db --- /dev/null +++ b/SP23.P03.Web/ClientApp/src/components/Footer/train.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/SP23.P03.Web/ClientApp/src/components/Loading.js b/SP23.P03.Web/ClientApp/src/components/Loading.js new file mode 100644 index 0000000..5b5798b --- /dev/null +++ b/SP23.P03.Web/ClientApp/src/components/Loading.js @@ -0,0 +1,14 @@ +import React from "react"; +import Spinner from "react-bootstrap/Spinner"; +import Container from "react-bootstrap/Container"; + +function Loading() { + return ( + +

Loading...

+ +
+ ); +} + +export default Loading; \ No newline at end of file diff --git a/SP23.P03.Web/ClientApp/src/components/NavBar/NavBar.css b/SP23.P03.Web/ClientApp/src/components/NavBar/NavBar.css index 7351a19..c01944e 100644 --- a/SP23.P03.Web/ClientApp/src/components/NavBar/NavBar.css +++ b/SP23.P03.Web/ClientApp/src/components/NavBar/NavBar.css @@ -2,10 +2,6 @@ background-color: #d8b4fe; margin: 10px 40px 10px 40px; border-radius: 30px; - height: 60px; + height: 65px; } -/*a.navbar-brand, a.navbar-brand:hover { - color: white; - font-size: 50px; - font-family: 'Nunito', sans-serif; -}*/ + diff --git a/SP23.P03.Web/ClientApp/src/components/NavBar/NavBar.js b/SP23.P03.Web/ClientApp/src/components/NavBar/NavBar.js index c3d2d0f..ef419a3 100644 --- a/SP23.P03.Web/ClientApp/src/components/NavBar/NavBar.js +++ b/SP23.P03.Web/ClientApp/src/components/NavBar/NavBar.js @@ -1,34 +1,37 @@ import React from 'react'; import Container from 'react-bootstrap/Container'; import Navbar from 'react-bootstrap/Navbar'; -import Form from 'react-bootstrap/Form'; import Button from 'react-bootstrap/Button'; import Nav from 'react-bootstrap/Nav'; import Offcanvas from 'react-bootstrap/Offcanvas'; import './NavBar.css'; import burger from './hamburger.svg'; -import magnifyingglass from './search.svg'; +import train from './train.svg'; +import ticket from './ticket.svg'; import {useState} from 'react'; import { BrowserRouter as Router, Link, Route, Routes } from "react-router-dom"; -import TrainStations from '../../pages/TrainStations'; -import TrainRoutes from '../../pages/TrainRoutes'; -import Trips from '../../pages/Trips'; -import Tickets from '../../pages/Tickets'; +import TrainStations from '../../pages/Stations/TrainStations'; +import TrainRoutes from '../../pages/Route/TrainRoutes'; +import Trips from '../../pages/Trips/Trips'; +import TripBooking from '../../pages/TripBooking/TripBooking'; import Home from '../../pages/Home'; -import Profile from '../../pages/Profile'; +import Profile from '../../pages/Profile/Profile'; import SignedIn from '../User/SignedIn'; import NotSignedIn from '../User/NotSignedIn'; import NotFound from '../../pages/NotFound'; -import Trains from '../../pages/Trains'; +import Trains from '../../pages/Trains/Trains'; +import About from '../../pages/About'; +import Prices from '../../pages/PricesAndSeating/Prices'; +import AuthService from '../../services/AuthService'; +import Col from "react-bootstrap/Col"; function NavBar() { + const currentUser = AuthService.getCurrentUser(); const [show, setShow] = useState(false); const handleClose = () => setShow(false); - const handleShow = () => setShow(true); - - let userComponent; //test code, actually want to render based on backend authentication eventually - let isLoggedIn = false; - if (isLoggedIn) { + const handleShow = () => setShow(true); + let userComponent; + if (currentUser != null) { userComponent = } else { @@ -38,71 +41,64 @@ function NavBar() { return ( - - - + + a burger - - - - Menu - - - - - - + /> + EnTrack - -