From 0faf2359de6be83b0098b1e373f8071550d098c3 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Tue, 3 Mar 2020 10:10:00 +0100 Subject: [PATCH] Added button for getting user position --- public/gps.png | Bin 0 -> 649 bytes src/App.js | 18 +++++++++++++--- src/Components/Footer.js | 12 ++++++++++- src/Components/GasStation.js | 9 ++++++++ src/Components/Map.js | 40 ++++++++++++++++++++++++++++++++++- 5 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 public/gps.png diff --git a/public/gps.png b/public/gps.png new file mode 100644 index 0000000000000000000000000000000000000000..0ff3406af4df490eb9df6be900a5ad9827ab8f7e GIT binary patch literal 649 zcmV;40(Sk0P)Kq`bN zEW`&ybWz%Ll$3~q5)mp&q#)wT1ws@EQMhtJfl@fK6r3Wnu(8+n5^|-{N;`M%%p1)N z%s~htk+cpR0)60@Ssyr*v>rl8cq&@0mNVf2FkWB-N$agv%asz3<2Xp#%L()(ZFuk7 zX_{7>&1Thm-sWEOrZrXlX4dnp zE%xm?=T>XA+QYQeYPG~Uw+eJ8xIHUyv*;1W`6o*1JLk55lR4cvan5Z?>QA)zxQILe z#@_ojKpe+a;D*P!?*V6KJs$Vs#<*DQ*tDiF2F7Wc2CL=+a1HD-dk1!bYvW?EnGb*{ zmtX|s=eP}g3n6?SjYg}$7vQJ)s=!C{eKIZ+T2r{nw@A_&i?=vivbBj8T|G=;F2Q$z z`}_NMM*d1kWZWz^)A|dNRxEq3(P(6ee*i~ww2zE~#bjf;GR3Ud>k)9l#G;i&ZqY7G zYZ}hE_dN4dn8w^ncE}yOT)U=FaO`##Rue*~@@JWf&UHxBG!&g{;LKtd!+YNZE-5*t zz@^2Mhxh(9wi^rV%D7L5_x=@dK1clAIRB0)ie3Vz1>&dXdp;_aN&+0@#1HJ>|3i`_ jk)&-&+ewl{W#fJW2E5DR_TBRY00000NkvXXu0mjf4!|tP literal 0 HcmV?d00001 diff --git a/src/App.js b/src/App.js index 728316d..9681342 100644 --- a/src/App.js +++ b/src/App.js @@ -16,7 +16,8 @@ class Application extends React.Component { this.state = { showModal: false, selectedGasStation: {}, - selectedGasType: 'E85' + selectedGasType: 'E85', + needUpdateUserLocation: false }; } @@ -68,6 +69,15 @@ class Application extends React.Component { })); } + /** + * Méthode permettant de demander à l'app de géoloc ou non l'utilisateur + */ + setNeedUpdateUserLocation = (needUpdateUserLocation) => { + this.setState({ + needUpdateUserLocation + }) + } + /** * Méthode gérant le rendu de la vue */ @@ -76,6 +86,8 @@ class Application extends React.Component { selectedGasType, showModal, selectedGasStation, + userLocation, + needUpdateUserLocation, } = this.state; return ( @@ -87,8 +99,8 @@ class Application extends React.Component { selectedGasStation={selectedGasStation} selectedGasType={selectedGasType} /> - -