Resolve "Mettre en capitalize les adresses et ville des stations" #6
3 changed files with 11 additions and 7 deletions
|
@ -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 {
|
|||
>
|
||||
<Modal.Header closeButton>
|
||||
<Modal.Title>
|
||||
{`${selectedGasStation.address} - ${capitalizeFirstLetter(selectedGasStation.city)}`}
|
||||
{`${lowerCaseString(selectedGasStation.address)} - ${capitalizeFirstLetter(selectedGasStation.city)}`}
|
||||
</Modal.Title>
|
||||
</Modal.Header>
|
||||
<Modal.Body>
|
||||
|
|
|
@ -22,10 +22,7 @@ class Map extends React.Component {
|
|||
longitude: -0.57918,
|
||||
zoom: 11,
|
||||
},
|
||||
userLocation: {
|
||||
// latitude: 44.837789,
|
||||
// longitude: -0.57918,
|
||||
},
|
||||
userLocation: {},
|
||||
gasStations: [],
|
||||
};
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
Loading…
Reference in a new issue