addressing comments by changing variable types and adding styles to home page title

This commit is contained in:
Drew Taylor
2021-07-22 11:47:46 -07:00
parent 293e1308fd
commit 2a186736c3
5 changed files with 323 additions and 320 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -28,16 +28,14 @@ const Home = () => {
useEffect(() => {
setTitle("");
setTitle("Home");
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
<div className={classes.paper}>
<Typography component="h1" variant="h5">
<Typography className={classes.homePageTitle} component="h1" variant="h5">
{greeting}
</Typography>
<br />
<VehicleMap />
</div>
);

View File

@@ -46,10 +46,10 @@ exports[`File Upload Form Should render 1`] = `
/>
<fieldset
aria-hidden="true"
class="PrivateNotchedOutline-root-38 MuiOutlinedInput-notchedOutline"
class="PrivateNotchedOutline-root-39 MuiOutlinedInput-notchedOutline"
>
<legend
class="PrivateNotchedOutline-legendLabelled-40"
class="PrivateNotchedOutline-legendLabelled-41"
>
<span>
Package name
@@ -92,10 +92,10 @@ exports[`File Upload Form Should render 1`] = `
/>
<fieldset
aria-hidden="true"
class="PrivateNotchedOutline-root-38 MuiOutlinedInput-notchedOutline"
class="PrivateNotchedOutline-root-39 MuiOutlinedInput-notchedOutline"
>
<legend
class="PrivateNotchedOutline-legendLabelled-40"
class="PrivateNotchedOutline-legendLabelled-41"
>
<span>
Version
@@ -138,10 +138,10 @@ exports[`File Upload Form Should render 1`] = `
/>
<fieldset
aria-hidden="true"
class="PrivateNotchedOutline-root-38 MuiOutlinedInput-notchedOutline"
class="PrivateNotchedOutline-root-39 MuiOutlinedInput-notchedOutline"
>
<legend
class="PrivateNotchedOutline-legendLabelled-40"
class="PrivateNotchedOutline-legendLabelled-41"
>
<span>
Description
@@ -185,10 +185,10 @@ exports[`File Upload Form Should render 1`] = `
/>
<fieldset
aria-hidden="true"
class="PrivateNotchedOutline-root-38 MuiOutlinedInput-notchedOutline"
class="PrivateNotchedOutline-root-39 MuiOutlinedInput-notchedOutline"
>
<legend
class="PrivateNotchedOutline-legendLabelled-40"
class="PrivateNotchedOutline-legendLabelled-41"
>
<span>
Release Notes URL

View File

@@ -44,7 +44,7 @@ const Component = () => {
return getLocations(token)
.then(result => {
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);
return points
}
@@ -57,7 +57,7 @@ const Component = () => {
if (markers == null) {
markers = []
}
var coord = markers.reduce((coord, marker) => {
const coord = markers.reduce((coord, marker) => {
coord[0] += marker[0] / markers.length;
coord[1] += marker[1] / markers.length;
return coord;
@@ -71,7 +71,7 @@ const Component = () => {
useEffect(() => {
if (markers.length > 0) {
var vins = markers.map(marker => marker[2]);
const vins = markers.map(marker => marker[2]);
getConnections(vins, token)
.then(connections => {
setConnections(connections);
@@ -112,7 +112,7 @@ const Component = () => {
};
function getCarIcon(vin) {
var icon = RedCarIcon;
let icon = RedCarIcon;
if (connections[vin]) {
icon = GreenCarIcon;

View File

@@ -179,6 +179,9 @@ const useStyles = makeStyles((theme) => ({
top: theme.spacing(1),
color: theme.palette.grey[500],
},
homePageTitle: {
marginBottom: 25,
},
markerTitle: {
margin: 5,
},