diff --git a/src/Components/GasStation.js b/src/Components/GasStation.js index 7d3d387..54a753d 100644 --- a/src/Components/GasStation.js +++ b/src/Components/GasStation.js @@ -4,7 +4,7 @@ import PropTypes from 'prop-types'; import { FaWaze } from "react-icons/fa"; import { gasTypes } from "../config"; -import { capitalizeFirstLetter} from "../helpers"; +import { capitalizeFirstLetter, lowerCaseString } from "../helpers"; class GasStation extends React.Component { /** @@ -62,7 +62,7 @@ class GasStation extends React.Component { > - {`${selectedGasStation.address} - ${capitalizeFirstLetter(selectedGasStation.city)}`} + {`${lowerCaseString(selectedGasStation.address)} - ${capitalizeFirstLetter(selectedGasStation.city)}`} diff --git a/src/Components/Map.js b/src/Components/Map.js index 52ca3e6..a6b6dec 100644 --- a/src/Components/Map.js +++ b/src/Components/Map.js @@ -22,10 +22,7 @@ class Map extends React.Component { longitude: -0.57918, zoom: 11, }, - userLocation: { - // latitude: 44.837789, - // longitude: -0.57918, - }, + userLocation: {}, gasStations: [], }; diff --git a/src/helpers.js b/src/helpers.js index 21d4ee2..0e04e71 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -11,9 +11,16 @@ export const haveSelectedGas = (station, gas) => { return false; } +export const lowerCaseString = (string) => { + if ( !string){ + return ''; + } + return string.toLowerCase(); +} + export const capitalizeFirstLetter = (string) => { if ( !string){ return ''; } - return string.charAt(0).toUpperCase() + string.slice(1); + return string.charAt(0).toUpperCase() + lowerCaseString(string.slice(1)); } \ No newline at end of file