Last change
on this file since 364f27d was 364f27d, checked in by MetodiMladenovski <meto.18@…>, 14 months ago |
added projects and db scripts
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[364f27d] | 1 | import React from "react";
|
---|
| 2 | import { useLocation, Link } from 'react-router-dom'
|
---|
| 3 | import CenteredContainer from "../UtilComponents/CenteredContainer";
|
---|
| 4 | import '../UtilComponents/App.css'
|
---|
| 5 |
|
---|
| 6 | const Car = () => {
|
---|
| 7 | const location = useLocation();
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | let driverButton = <Link to={"/driver/profile"} className="myButton btn btn-primary" style={{backgroundColor: "darkcyan", borderColor: 'black'}}>Go back</Link>
|
---|
| 11 |
|
---|
| 12 | let adminButton = <a href="/unapproved-drivers" className="myButton btn btn-primary" style={{backgroundColor: "darkcyan", borderColor: 'black'}}>Go back</a>
|
---|
| 13 |
|
---|
| 14 | let button
|
---|
| 15 | if(localStorage.getItem("driverId")){
|
---|
| 16 | button = driverButton
|
---|
| 17 | } else {
|
---|
| 18 | button = adminButton
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | return (
|
---|
| 22 | <CenteredContainer>
|
---|
| 23 | <h2 style={{textAlign: "center", color: "#00CED1"}}>Car for driver</h2>
|
---|
| 24 | <div className="card text-center">
|
---|
| 25 | <div className="card-header">
|
---|
| 26 | {location.state.car.licensePlate}
|
---|
| 27 | </div>
|
---|
| 28 | <div className="card-body">
|
---|
| 29 | <h5>Model: {location.state.car.model}</h5>
|
---|
| 30 | <h5>Make: {location.state.car.make}</h5>
|
---|
| 31 | <h5>Year: {location.state.car.year}</h5>
|
---|
| 32 | </div>
|
---|
| 33 | <br></br>
|
---|
| 34 | {button}
|
---|
| 35 | </div>
|
---|
| 36 | </CenteredContainer>
|
---|
| 37 | )
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | export default Car; |
---|
Note:
See
TracBrowser
for help on using the repository browser.