Reorganize app pages (#73)
* Update layout and menus * Add breadcrumbs Add menu icons Add ECU drop down * Implement submenu Update download progress * revamped dashboard section - failing app.test.js * Clean up Co-authored-by: Drew Taylor <dtaylor@fiskerinc.com>
This commit is contained in:
@@ -7,8 +7,8 @@ import { Button } from "@material-ui/core";
|
||||
import { useUserContext } from "../Contexts/UserContext";
|
||||
import { useVehicleContext, VehicleProvider } from "../Contexts/VehicleContext";
|
||||
import { VehiclePopUp } from "./popup";
|
||||
import GreenCarIcon from "../../assets/green-car.png";
|
||||
import RedCarIcon from "../../assets/red-car.png";
|
||||
import GreenMarkerIcon from "../../assets/green-marker.png";
|
||||
import GrayMarkerIcon from "../../assets/gray-marker.png";
|
||||
|
||||
const Component = () => {
|
||||
const classes = useStyles();
|
||||
@@ -51,17 +51,17 @@ const Component = () => {
|
||||
}
|
||||
|
||||
const centerAroundMarkers = (markers) => {
|
||||
if (markers == null) {
|
||||
markers = []
|
||||
}
|
||||
const coord = markers.reduce((coord, marker) => {
|
||||
coord[0] += marker[0] / markers.length;
|
||||
coord[1] += marker[1] / markers.length;
|
||||
return coord;
|
||||
}, [0, 0])
|
||||
// if (markers == null) {
|
||||
// markers = []
|
||||
// }
|
||||
// const coord = markers.reduce((coord, marker) => {
|
||||
// coord[0] += marker[0] / markers.length;
|
||||
// coord[1] += marker[1] / markers.length;
|
||||
// return coord;
|
||||
// }, [0, 0])
|
||||
|
||||
setCenter(coord);
|
||||
setZoom(4);
|
||||
setCenter([37.0902, -95.7129]);
|
||||
setZoom(4.5);
|
||||
}
|
||||
|
||||
const [connections, setConnections] = useState({});
|
||||
@@ -109,17 +109,15 @@ const Component = () => {
|
||||
};
|
||||
|
||||
function getCarIcon(vin) {
|
||||
let icon = RedCarIcon;
|
||||
let icon = GrayMarkerIcon;
|
||||
|
||||
if (connections[vin]) {
|
||||
icon = GreenCarIcon;
|
||||
} else {
|
||||
icon = RedCarIcon;
|
||||
icon = GreenMarkerIcon;
|
||||
}
|
||||
|
||||
return new L.Icon({
|
||||
iconUrl: icon,
|
||||
iconAnchor: [15, 0]
|
||||
iconAnchor: [24, 42]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user