addressing comments by changing variable types and adding styles to home page title
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -28,16 +28,14 @@ const Home = () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTitle("");
|
setTitle("Home");
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<div className={classes.paper}>
|
<div className={classes.paper}>
|
||||||
<Typography component="h1" variant="h5">
|
<Typography className={classes.homePageTitle} component="h1" variant="h5">
|
||||||
{greeting}
|
{greeting}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
<br />
|
|
||||||
<VehicleMap />
|
<VehicleMap />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ exports[`File Upload Form Should render 1`] = `
|
|||||||
/>
|
/>
|
||||||
<fieldset
|
<fieldset
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="PrivateNotchedOutline-root-38 MuiOutlinedInput-notchedOutline"
|
class="PrivateNotchedOutline-root-39 MuiOutlinedInput-notchedOutline"
|
||||||
>
|
>
|
||||||
<legend
|
<legend
|
||||||
class="PrivateNotchedOutline-legendLabelled-40"
|
class="PrivateNotchedOutline-legendLabelled-41"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
Package name
|
Package name
|
||||||
@@ -92,10 +92,10 @@ exports[`File Upload Form Should render 1`] = `
|
|||||||
/>
|
/>
|
||||||
<fieldset
|
<fieldset
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="PrivateNotchedOutline-root-38 MuiOutlinedInput-notchedOutline"
|
class="PrivateNotchedOutline-root-39 MuiOutlinedInput-notchedOutline"
|
||||||
>
|
>
|
||||||
<legend
|
<legend
|
||||||
class="PrivateNotchedOutline-legendLabelled-40"
|
class="PrivateNotchedOutline-legendLabelled-41"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
Version
|
Version
|
||||||
@@ -138,10 +138,10 @@ exports[`File Upload Form Should render 1`] = `
|
|||||||
/>
|
/>
|
||||||
<fieldset
|
<fieldset
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="PrivateNotchedOutline-root-38 MuiOutlinedInput-notchedOutline"
|
class="PrivateNotchedOutline-root-39 MuiOutlinedInput-notchedOutline"
|
||||||
>
|
>
|
||||||
<legend
|
<legend
|
||||||
class="PrivateNotchedOutline-legendLabelled-40"
|
class="PrivateNotchedOutline-legendLabelled-41"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
Description
|
Description
|
||||||
@@ -185,10 +185,10 @@ exports[`File Upload Form Should render 1`] = `
|
|||||||
/>
|
/>
|
||||||
<fieldset
|
<fieldset
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="PrivateNotchedOutline-root-38 MuiOutlinedInput-notchedOutline"
|
class="PrivateNotchedOutline-root-39 MuiOutlinedInput-notchedOutline"
|
||||||
>
|
>
|
||||||
<legend
|
<legend
|
||||||
class="PrivateNotchedOutline-legendLabelled-40"
|
class="PrivateNotchedOutline-legendLabelled-41"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
Release Notes URL
|
Release Notes URL
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const Component = () => {
|
|||||||
return getLocations(token)
|
return getLocations(token)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (result.data != null) {
|
if (result.data != null) {
|
||||||
var points = result.data.map(point => [point.latitude, point.longitude, point.vin]);
|
const points = result.data.map(point => [point.latitude, point.longitude, point.vin]);
|
||||||
setMarkers(points);
|
setMarkers(points);
|
||||||
return points
|
return points
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ const Component = () => {
|
|||||||
if (markers == null) {
|
if (markers == null) {
|
||||||
markers = []
|
markers = []
|
||||||
}
|
}
|
||||||
var coord = markers.reduce((coord, marker) => {
|
const coord = markers.reduce((coord, marker) => {
|
||||||
coord[0] += marker[0] / markers.length;
|
coord[0] += marker[0] / markers.length;
|
||||||
coord[1] += marker[1] / markers.length;
|
coord[1] += marker[1] / markers.length;
|
||||||
return coord;
|
return coord;
|
||||||
@@ -71,7 +71,7 @@ const Component = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (markers.length > 0) {
|
if (markers.length > 0) {
|
||||||
var vins = markers.map(marker => marker[2]);
|
const vins = markers.map(marker => marker[2]);
|
||||||
getConnections(vins, token)
|
getConnections(vins, token)
|
||||||
.then(connections => {
|
.then(connections => {
|
||||||
setConnections(connections);
|
setConnections(connections);
|
||||||
@@ -112,7 +112,7 @@ const Component = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function getCarIcon(vin) {
|
function getCarIcon(vin) {
|
||||||
var icon = RedCarIcon;
|
let icon = RedCarIcon;
|
||||||
|
|
||||||
if (connections[vin]) {
|
if (connections[vin]) {
|
||||||
icon = GreenCarIcon;
|
icon = GreenCarIcon;
|
||||||
|
|||||||
@@ -179,6 +179,9 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
top: theme.spacing(1),
|
top: theme.spacing(1),
|
||||||
color: theme.palette.grey[500],
|
color: theme.palette.grey[500],
|
||||||
},
|
},
|
||||||
|
homePageTitle: {
|
||||||
|
marginBottom: 25,
|
||||||
|
},
|
||||||
markerTitle: {
|
markerTitle: {
|
||||||
margin: 5,
|
margin: 5,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user