diff --git a/package.json b/package.json index 3c3593b..4410f1f 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,7 @@ }, "scripts": { "start": "react-scripts start", - "build": "react-scripts build", - "deploy": "ssh porto 'rm -r www/darkou.fr/carburants/static www/darkou.fr/carburants/precache-manifest*' && scp -r build/* porto:www/darkou.fr/carburants:", + "build": "react-scripts build && ssh porto 'rm -r www/darkou.fr/carburants/static www/darkou.fr/carburants/precache-manifest*' && scp -r build/* porto:www/darkou.fr/carburants", "test": "react-scripts test", "lint": "./node_modules/.bin/eslint . --fix", "eject": "react-scripts eject" diff --git a/src/App.js b/src/App.js index 4d286dc..5e376c3 100644 --- a/src/App.js +++ b/src/App.js @@ -105,8 +105,8 @@ class Application extends React.Component { { Prix carburant {' '} - est une application ayant pour objectif d'afficher facilement sur smartphone l'ensemble des stations services à proximité. + est une simple application ayant pour objectif d'afficher facilement sur smartphone l'ensemble des stations services à proximité.
Ce service est entièrement gratuit et libre.
diff --git a/src/Components/GasStation.js b/src/Components/GasStation.js index 97f93c1..54a753d 100644 --- a/src/Components/GasStation.js +++ b/src/Components/GasStation.js @@ -2,7 +2,6 @@ import React from 'react'; import { Modal, Button, ListGroup } from "react-bootstrap"; import PropTypes from 'prop-types'; import { FaWaze } from "react-icons/fa"; -import { GiPositionMarker } from "react-icons/gi"; import { gasTypes } from "../config"; import { capitalizeFirstLetter, lowerCaseString } from "../helpers"; @@ -25,61 +24,32 @@ class GasStation extends React.Component { /** * Méthode permettant de générer la liste des prix - * @return {string} + * return {string} */ renderPrices = () => { const { - gasType, - station, + selectedGasType, + selectedGasStation, } = this.props; return ( - {station.prices ? station.prices.map(price => { + {selectedGasStation.prices ? selectedGasStation.prices.map(price => { return ( - - {`${this.renderGasType(price.gasType)} : ${price.price.toString().replace('.', ',')} € `} - + + {`${this.renderGasType(price.gasType)} : ${price.price} € `} + ); }) : (null)} ) } - /** - * Méthode permettant de formater le titre de la modale en fonction des infos reçues - * @return {string} - */ - renderFormatTitle = () => { - const { - station, - } = this.props; - - if ( station.name ) { - return station.name; - } - return `${lowerCaseString(station.address)} - ${capitalizeFirstLetter(station.city)}`; - } - - renderAddress = () => { - const { - station, - } = this.props; - - return ( -

- - {lowerCaseString(station.address)} - {' - '} - {capitalizeFirstLetter(station.city)} -

- ); - } - render () { const { showModal, hideModal, + selectedGasStation, } = this.props; return ( @@ -92,11 +62,10 @@ class GasStation extends React.Component { > - {this.renderFormatTitle()} + {`${lowerCaseString(selectedGasStation.address)} - ${capitalizeFirstLetter(selectedGasStation.city)}`} - {this.renderAddress()} {this.renderPrices()} @@ -110,7 +79,7 @@ class GasStation extends React.Component { } GasStation.defaultProps = { - station: { + selectedGasStation: { address: null, city: null, prices: [] @@ -118,11 +87,10 @@ GasStation.defaultProps = { }; GasStation.propTypes = { - gasType: PropTypes.string.isRequired, + selectedGasType: PropTypes.string.isRequired, showModal: PropTypes.bool.isRequired, hideModal: PropTypes.func.isRequired, - station: PropTypes.shape({ - name: PropTypes.string, + selectedGasStation: PropTypes.shape({ address: PropTypes.string, city: PropTypes.string, prices: PropTypes.array diff --git a/src/Components/Map.js b/src/Components/Map.js index 84c4a85..a6b6dec 100644 --- a/src/Components/Map.js +++ b/src/Components/Map.js @@ -84,7 +84,7 @@ class Map extends React.Component { width: '100vw', latitude: position.coords.latitude, longitude: position.coords.longitude, - zoom: 11, + zoom: 10, }; this.setState({ viewport: newViewport,