diff --git a/front-end/package-lock.json b/front-end/package-lock.json index 3f83781..fddb663 100644 --- a/front-end/package-lock.json +++ b/front-end/package-lock.json @@ -8,14 +8,21 @@ "name": "front-end", "version": "0.1.0", "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.6.0", + "@fortawesome/free-brands-svg-icons": "^6.6.0", + "@fortawesome/free-regular-svg-icons": "^6.6.0", + "@fortawesome/free-solid-svg-icons": "^6.6.0", + "@fortawesome/react-fontawesome": "^0.2.2", "@reduxjs/toolkit": "^2.2.7", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.7.5", "react": "^18.3.1", "react-dom": "^18.3.1", "react-redux": "^9.1.2", "react-scripts": "5.0.1", + "react-tooltip": "^5.28.0", "web-vitals": "^2.1.4" }, "devDependencies": { @@ -2565,6 +2572,101 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@floating-ui/core": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.7.tgz", + "integrity": "sha512-yDzVT/Lm101nQ5TCVeK65LtdN7Tj4Qpr9RTXJ2vPFLqtLxwOrpoxAHAJI8J3yYWUc40J0BDBheaitK5SJmno2g==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.7" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.10", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.10.tgz", + "integrity": "sha512-fskgCFv8J8OamCmyun8MfjB1Olfn+uZKjOKZ0vhYF3gRmEUXcGOjxWL8bBr7i4kIuPZ2KD2S3EUIOxnjC8kl2A==", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.6.0", + "@floating-ui/utils": "^0.2.7" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.7.tgz", + "integrity": "sha512-X8R8Oj771YRl/w+c1HqAC1szL8zWQRwFvgDwT129k9ACdBoud/+/rX9V0qiMl6LWUdP9voC2nDVZYPMQQsb6eA==", + "license": "MIT" + }, + "node_modules/@fortawesome/fontawesome-common-types": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz", + "integrity": "sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/fontawesome-svg-core": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz", + "integrity": "sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg==", + "license": "MIT", + "dependencies": { + "@fortawesome/fontawesome-common-types": "6.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/free-brands-svg-icons": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.6.0.tgz", + "integrity": "sha512-1MPD8lMNW/earme4OQi1IFHtmHUwAKgghXlNwWi9GO7QkTfD+IIaYpIai4m2YJEzqfEji3jFHX1DZI5pbY/biQ==", + "license": "(CC-BY-4.0 AND MIT)", + "dependencies": { + "@fortawesome/fontawesome-common-types": "6.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/free-regular-svg-icons": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.6.0.tgz", + "integrity": "sha512-Yv9hDzL4aI73BEwSEh20clrY8q/uLxawaQ98lekBx6t9dQKDHcDzzV1p2YtBGTtolYtNqcWdniOnhzB+JPnQEQ==", + "license": "(CC-BY-4.0 AND MIT)", + "dependencies": { + "@fortawesome/fontawesome-common-types": "6.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/free-solid-svg-icons": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz", + "integrity": "sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA==", + "license": "(CC-BY-4.0 AND MIT)", + "dependencies": { + "@fortawesome/fontawesome-common-types": "6.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/react-fontawesome": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.2.tgz", + "integrity": "sha512-EnkrprPNqI6SXJl//m29hpaNzOp1bruISWaOiRtkMi/xSvHJlzc2j2JAYS7egxt/EbjSNV/k6Xy0AQI6vB2+1g==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.8.1" + }, + "peerDependencies": { + "@fortawesome/fontawesome-svg-core": "~1 || ~6", + "react": ">=16.3" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -5883,6 +5985,31 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.5.tgz", + "integrity": "sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "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==", + "license": "MIT", + "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", @@ -6618,6 +6745,12 @@ "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==", "license": "MIT" }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "license": "MIT" + }, "node_modules/clean-css": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz", @@ -15897,6 +16030,12 @@ "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==", + "license": "MIT" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -16379,6 +16518,20 @@ } } }, + "node_modules/react-tooltip": { + "version": "5.28.0", + "resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-5.28.0.tgz", + "integrity": "sha512-R5cO3JPPXk6FRbBHMO0rI9nkUG/JKfalBSQfZedZYzmqaZQgq7GLzF8vcCWx6IhUCKg0yPqJhXIzmIO5ff15xg==", + "license": "MIT", + "dependencies": { + "@floating-ui/dom": "^1.6.1", + "classnames": "^2.3.0" + }, + "peerDependencies": { + "react": ">=16.14.0", + "react-dom": ">=16.14.0" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", diff --git a/front-end/package.json b/front-end/package.json index 5436421..2365a3d 100644 --- a/front-end/package.json +++ b/front-end/package.json @@ -3,14 +3,21 @@ "version": "0.1.0", "private": true, "dependencies": { + "@fortawesome/fontawesome-svg-core": "^6.6.0", + "@fortawesome/free-brands-svg-icons": "^6.6.0", + "@fortawesome/free-regular-svg-icons": "^6.6.0", + "@fortawesome/free-solid-svg-icons": "^6.6.0", + "@fortawesome/react-fontawesome": "^0.2.2", "@reduxjs/toolkit": "^2.2.7", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "axios": "^1.7.5", "react": "^18.3.1", "react-dom": "^18.3.1", "react-redux": "^9.1.2", "react-scripts": "5.0.1", + "react-tooltip": "^5.28.0", "web-vitals": "^2.1.4" }, "scripts": { diff --git a/front-end/src/App.js b/front-end/src/App.js index 92beefb..411364d 100644 --- a/front-end/src/App.js +++ b/front-end/src/App.js @@ -1,19 +1,25 @@ -import React from "react"; +import React, {Component} from "react"; import './main.css' -import { useSelector } from "react-redux"; -import { selectAuthenticated } from "./stateSlicers/authenticationSlice"; - import FleetManager from "./components/FleetManager"; import Login from "./components/Login"; -function App () { - const authed = useSelector(selectAuthenticated); - return ( - (authed) - ? +export default class App extends Component { + constructor(props) { + super(props) + + this.state = { + authenticated: true, + userId: 1, + fullName: "Chris Lindelof" + } + } + + render() { + return ( + (this.state.authenticated) + ? : ) + } } - -export default App; diff --git a/front-end/src/components/FleetManager-Components/FuelPurchases.js b/front-end/src/components/FleetManager-Components/FuelPurchases.js new file mode 100644 index 0000000..6257b9e --- /dev/null +++ b/front-end/src/components/FleetManager-Components/FuelPurchases.js @@ -0,0 +1,110 @@ +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faChevronUp, faChevronDown, faClose } from "@fortawesome/free-solid-svg-icons"; +import React, { Component } from "react"; + +export default class FuelPurchases extends Component { + + constructor(props) { + super(props) + + this.state = { + expanded: false, + showModal: true + } + } + + toggleExpanded = () => { + this.setState({ + expanded: !this.state.expanded + }) + } + + setShowModal = (value) => { + this.setState({ + showModal: value + }) + } + render() { + return ( + <> +
+
Fuel Purchases
+
+
this.setShowModal(true)} className="mr-2 px-2 py-1 rounded bg-green-400 hover:cursor-pointer">Add
+
+ { + (this.state.expanded) + ? + : + } +
+
+
+ + { + (this.state.showModal) + ? ( + <> +
+
+ {/*content*/} +
+ {/*header*/} +
+

+ Add Fuel Purchase +

+ +
+ {/*body*/} +
+
+ +
Date
+
+
+ + Fuel Purchased +
+
+ + Total Cost +
+
+ {/*footer*/} +
+ + +
+
+
+
+
+ + ) : null + } + + ) + } +} \ No newline at end of file diff --git a/front-end/src/components/FleetManager-Components/Header.js b/front-end/src/components/FleetManager-Components/Header.js new file mode 100644 index 0000000..fa35dd7 --- /dev/null +++ b/front-end/src/components/FleetManager-Components/Header.js @@ -0,0 +1,18 @@ +import React, {Component} from "react"; + +export default class Header extends Component { + + render() { + return ( +
+
+ Fleet Management +
+ +
+ {this.props.user.fullName} +
+
+ ) + } +} \ No newline at end of file diff --git a/front-end/src/components/FleetManager-Components/Sidebar.js b/front-end/src/components/FleetManager-Components/Sidebar.js new file mode 100644 index 0000000..5fab916 --- /dev/null +++ b/front-end/src/components/FleetManager-Components/Sidebar.js @@ -0,0 +1,27 @@ +import React, {Component} from "react"; + +export default class Sidebar extends Component { + + constructor(props) { + super(props) + + this.state={ + + } + } + + render() { + + var vehicleList = this.props.companyVehicles.map((vehicle, index) => { + return ( +
this.props.selectVehicle(vehicle.id)} key={`vehicleList-${index}`} className={`py-2 border-b pl-4 hover:cursor-pointer ${(this.props.selectedVehicle === vehicle.id) ? 'bg-gray-400 text-white': ''}`}>Vehicle {vehicle.name}
+ ) + }) + + return ( +
+ {vehicleList} +
+ ) + } +} \ No newline at end of file diff --git a/front-end/src/components/FleetManager-Components/VehicleInformation.js b/front-end/src/components/FleetManager-Components/VehicleInformation.js new file mode 100644 index 0000000..c603d7e --- /dev/null +++ b/front-end/src/components/FleetManager-Components/VehicleInformation.js @@ -0,0 +1,33 @@ +import React, {Component} from "react"; + +import VehicleName from "./VehicleInformation/VehicleName"; +import VehicleImage from "./VehicleInformation/VehicleImage"; +import Registration from "./VehicleInformation/Registration"; +import VehicleDetails from "./VehicleInformation/VehicleDetails"; +import ServiceHistory from "./VehicleInformation/ServiceHistory"; +import FuelPurchases from "./FuelPurchases"; + +export default class VehicleInformation extends Component { + + render() { + return ( + +
+ + +
+ +
+ + +
+
+ + + + +
+ ) + } +} + diff --git a/front-end/src/components/FleetManager-Components/VehicleInformation/Registration.js b/front-end/src/components/FleetManager-Components/VehicleInformation/Registration.js new file mode 100644 index 0000000..93807ed --- /dev/null +++ b/front-end/src/components/FleetManager-Components/VehicleInformation/Registration.js @@ -0,0 +1,42 @@ +import React, {Component} from "react"; +import EditableTextDisplay from "../../Informational-Components/EditableTextDisplay"; + +export default class Registration extends Component { + + constructor(props){ + super(props) + + this.state = { + plate: '', + expiration: '', + locale: '' + } + } + + editFieldCallBack = (newValue, label) => { + this.setState({ + [label]: newValue + }) + } + + render() { + + return ( +
+
Registration
+
+
Locale:
+ +
+
+
Plate:
+ +
+
+
Expiration:
+ +
+
+ ) + } +} \ No newline at end of file diff --git a/front-end/src/components/FleetManager-Components/VehicleInformation/ServiceHistory.js b/front-end/src/components/FleetManager-Components/VehicleInformation/ServiceHistory.js new file mode 100644 index 0000000..32f5099 --- /dev/null +++ b/front-end/src/components/FleetManager-Components/VehicleInformation/ServiceHistory.js @@ -0,0 +1,47 @@ +import { faChevronUp, faChevronDown } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import React, {Component} from "react"; + +export default class ServiceHistory extends Component { + + constructor(props){ + super() + + this.state = { + expanded: false + } + } + + toggleExpanded = () => { + this.setState({ + expanded: !this.state.expanded + }) + } + + render() { + + return ( + <> +
+
Service History
+ +
+
Add
+
+ { + (this.state.expanded) + ? + : + } +
+
+
+ { + (this.state.expanded) + ?
Service History
+ : null + } + + ) + } +} \ No newline at end of file diff --git a/front-end/src/components/FleetManager-Components/VehicleInformation/VehicleDetails.js b/front-end/src/components/FleetManager-Components/VehicleInformation/VehicleDetails.js new file mode 100644 index 0000000..0380918 --- /dev/null +++ b/front-end/src/components/FleetManager-Components/VehicleInformation/VehicleDetails.js @@ -0,0 +1,46 @@ +import React, {Component} from "react"; +import EditableTextDisplay from "../../Informational-Components/EditableTextDisplay"; + +export default class VehicleDetails extends Component { + + constructor(props) { + super(props) + + this.state = { + vin: "1HGBH41JXMN109186", + year: 2017, + make: "Chevrolet", + model: "Silverado" + } + } + + editedTextCallback = (newValue, label) => { + this.setState({ + [label]: newValue + }) + } + + render() { + return ( +
+
Information
+
+
VIN:
+ +
+
+
Year:
+ +
+
+
Make:
+ +
+
+
Model:
+ +
+
+ ) + } +} diff --git a/front-end/src/components/FleetManager-Components/VehicleInformation/VehicleImage.js b/front-end/src/components/FleetManager-Components/VehicleInformation/VehicleImage.js new file mode 100644 index 0000000..d3d9afd --- /dev/null +++ b/front-end/src/components/FleetManager-Components/VehicleInformation/VehicleImage.js @@ -0,0 +1,35 @@ +import React, { Component } from "react"; +import { Tooltip } from 'react-tooltip' + +export default class VehicleImage extends Component { + + constructor(props) { + super(props) + + this.state = { + imageSet: false, + edit: true + } + } + + updateImage = () => { + + } + + render () { + return ( + <> +
+
{ + (this.state.imageSet) + ? Vehicle + :
Image Not Set
+ }
+
+ +
Click to Edit
+
+ + ) + } +} \ No newline at end of file diff --git a/front-end/src/components/FleetManager-Components/VehicleInformation/VehicleName.js b/front-end/src/components/FleetManager-Components/VehicleInformation/VehicleName.js new file mode 100644 index 0000000..9671432 --- /dev/null +++ b/front-end/src/components/FleetManager-Components/VehicleInformation/VehicleName.js @@ -0,0 +1,72 @@ +import React, { Component } from "react" +import Loading from "../../Informational-Components/Loading" +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" +import { faPenToSquare, faSave } from "@fortawesome/free-solid-svg-icons" + +import { Tooltip } from "react-tooltip" + +export default class VehicleName extends Component { + constructor(props) { + super(props) + + this.state = { + vehicleName: 'Temp Vehicle Name', + vehicleNameEdit: '', + loading: false, + editing: false + } + } + + editVehicleName = () => { + this.setState({ + vehicleNameEdit: this.state.vehicleName, + editing: true + }) + } + + updateVehicleName = (event) => { + this.setState({ + vehicleNameEdit: event.target.value + }) + } + + saveVehicleNameChange = () => { + this.setState({ + loading: true + }, () => this.setState({ + vehicleName: this.state.vehicleNameEdit, + editing: false + }, () => { + this.setState({ + loading: false + }) + })) + + } + + render() { + return ( +
+ { + (this.state.loading) + ? + : (this.state.editing) + ?
+ +
+ Save changes +
+ :
+ {this.state.vehicleName} +
+ + Edit vehicle name +
+
+ } + + +
+ ) + } +} \ No newline at end of file diff --git a/front-end/src/components/FleetManager.js b/front-end/src/components/FleetManager.js index 8d9d1cc..7c889b7 100644 --- a/front-end/src/components/FleetManager.js +++ b/front-end/src/components/FleetManager.js @@ -1,5 +1,36 @@ -export default function FleetManager() { - return ( -
- ) +import { Component } from "react"; +import Header from "./FleetManager-Components/Header"; +import Sidebar from "./FleetManager-Components/Sidebar"; +import VehicleInformation from "./FleetManager-Components/VehicleInformation"; + +export default class FleetManager extends Component { + constructor(props) { + super(props) + + this.state = { + companyVehicles: [ + {id: 1, name: "1"}, {id: 2, name: "2"}, {id: 3, name: "3"}, {id: 4, name: "4"}, {id: 5, name: "5"} + ], + selectedVehicle: 3 + } + } + + updateSelectedVehicle = (selected) => { + this.setState({ + selectedVehicle: selected + }) + } + + render () { + return ( +
+
+
+ + +
+
+ ) + } + } \ No newline at end of file diff --git a/front-end/src/components/Informational-Components/EditableTextDisplay.js b/front-end/src/components/Informational-Components/EditableTextDisplay.js new file mode 100644 index 0000000..c6e9c4a --- /dev/null +++ b/front-end/src/components/Informational-Components/EditableTextDisplay.js @@ -0,0 +1,76 @@ +import React, {Component} from "react"; +import Loading from "./Loading"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faCancel, faSave, faEdit } from "@fortawesome/free-solid-svg-icons"; +import { Tooltip } from "react-tooltip"; +export default class EditableTextDisplay extends Component { + + constructor(props) { + super(props) + + this.state = { + editValue: '', + loading: false, + edit: false + } + } + + edit = () => { + this.setState({ + editValue: this.props.defaultValue, + edit: true + }) + } + + handleChange = (event) => { + this.setState({ + editValue: event.target.value + }) + } + + cancel = () => { + this.setState({ + editValue: '', + edit: false + }) + } + + propagateChange = () => { + this.props.callback(this.state.editValue, this.props.label); + + this.setState({ + edit: false + }) + } + + render () { + return ( +
+ { + (this.state.loading) + ? + : (this.state.edit) + ?
+ +
+
+ + Save {this.props.label.toUpperCase()} + + + Cancel {this.props.label.toUpperCase()} Edit + +
+ :
+
{this.props.defaultValue}
+
+ + Edit {this.props.label.toUpperCase()} + +
+ + } +
+ ) + } +} \ No newline at end of file diff --git a/front-end/src/components/Informational-Components/Loading.js b/front-end/src/components/Informational-Components/Loading.js new file mode 100644 index 0000000..10bd3d4 --- /dev/null +++ b/front-end/src/components/Informational-Components/Loading.js @@ -0,0 +1,9 @@ +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' + +import { faSpinner } from '@fortawesome/free-solid-svg-icons' + +export default function Loading() { + return ( + + ) +} \ No newline at end of file diff --git a/front-end/src/images/car-silhouet-png-21300.png b/front-end/src/images/car-silhouet-png-21300.png new file mode 100644 index 0000000..28cd92d Binary files /dev/null and b/front-end/src/images/car-silhouet-png-21300.png differ diff --git a/front-end/src/index.js b/front-end/src/index.js index ba4beca..5d4fdcf 100644 --- a/front-end/src/index.js +++ b/front-end/src/index.js @@ -3,14 +3,11 @@ import ReactDOM from 'react-dom/client'; import App from './App'; import reportWebVitals from './reportWebVitals'; -import { Provider } from 'react-redux' -import store from './store' - const root = ReactDOM.createRoot(document.getElementById('root')); root.render( - + - + ); // If you want to start measuring performance in your app, pass a function diff --git a/front-end/src/main.css b/front-end/src/main.css index b5c61c9..bd6213e 100644 --- a/front-end/src/main.css +++ b/front-end/src/main.css @@ -1,3 +1,3 @@ @tailwind base; @tailwind components; -@tailwind utilities; +@tailwind utilities; \ No newline at end of file diff --git a/front-end/src/stateSlicers/authenticationSlice.js b/front-end/src/stateSlicers/authenticationSlice.js deleted file mode 100644 index 49dbeb7..0000000 --- a/front-end/src/stateSlicers/authenticationSlice.js +++ /dev/null @@ -1,29 +0,0 @@ -import { createSlice } from "@reduxjs/toolkit"; - -export const authenticationSlice = createSlice({ - name: 'auth', - initialState: { - authenticated: false, - userId: null, - fullName: null - }, - reducers: { - authenticated: (state, action) => { - state.authenticated = true; - state.userId = action.payload.userId; - state.fullName = action.payload.fullName; - }, - logout: (state) => { - state = { - authenticated: false, - userId: null, - fullName: null - } - } - } -}) - -export const {authenticated, logout} = authenticationSlice.actions -export const selectAuthenticated = (state) => state.authenticated - -export default authenticationSlice.reducer \ No newline at end of file diff --git a/front-end/src/store.js b/front-end/src/store.js deleted file mode 100644 index fdd6bdd..0000000 --- a/front-end/src/store.js +++ /dev/null @@ -1,7 +0,0 @@ -import { configureStore } from '@reduxjs/toolkit' - -import authenticationReducer from './stateSlicers/authenticationSlice' - -export default configureStore({ - reducer: {authenticationReducer}, -}) \ No newline at end of file