From 12ba0c6abcf549fb1cf326ab1b12c2312d9aef38 Mon Sep 17 00:00:00 2001 From: Ikemefuna Obioha Date: Mon, 25 Mar 2024 14:51:49 +0100 Subject: [PATCH 1/4] Updated Mapbox access token --- src/modules/network/components/map/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/network/components/map/index.js b/src/modules/network/components/map/index.js index a125895975..8e170cccb7 100644 --- a/src/modules/network/components/map/index.js +++ b/src/modules/network/components/map/index.js @@ -52,7 +52,7 @@ const getAttributionLinks = () => { const getTiles = () => L.tileLayer( - 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFudWxpZ2h0Y3VydmUiLCJhIjoiY2xodWVjYW52MGM0cDNobzYzZGRkOGU0dyJ9.aOMEZq0mbD6C-DgwU_ib_A', + 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFudWxpZ2h0Y3VydmUiLCJhIjoiY2x1Nm8ybTVmMG9zMDJqbnZzNWoyZzc0bSJ9.4upFBJwPjObUVkzNwChDEw', { id: 'mapbox/streets-v11', tileSize: 512, From 6f0dc6f9ad81271256f5713891d8a33e91e67349 Mon Sep 17 00:00:00 2001 From: Ikemefuna Obioha Date: Tue, 26 Mar 2024 17:14:14 +0100 Subject: [PATCH 2/4] Updated env variable setup for Mapbox access token --- .env | 1 + .eslintrc | 3 ++- .gitignore | 2 +- setup/config/webpack.config.react.js | 1 + setup/jest.config.js | 1 + src/modules/network/components/map/index.js | 2 +- 6 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000000..4003d54f70 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +REACT_APP_MAPBOX_ACCESS_TOKEN= \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 2dc3610e90..f04916053e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,7 +7,8 @@ "LISK_ENABLE_DEV_TOOL": true, "PRODUCTION": true, "LISK_DOMAIN": true, - "REACT_APP_DEFAULT_NETWORK": true + "REACT_APP_DEFAULT_NETWORK": true, + "REACT_APP_MAPBOX_ACCESS_TOKEN": true, }, "env": { "es2020": true, diff --git a/.gitignore b/.gitignore index 08105adf9b..b6d8c40faf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ app/app.js blockchain_explorer.db.gz reports .history -.env +.env.local yarn-error.log *.tgz diff --git a/setup/config/webpack.config.react.js b/setup/config/webpack.config.react.js index 1f522c0515..f35210180c 100644 --- a/setup/config/webpack.config.react.js +++ b/setup/config/webpack.config.react.js @@ -105,6 +105,7 @@ const config = { VERSION: `"${bundleVersion}"`, LISK_DOMAIN: '"https://lisk.com"', REACT_APP_DEFAULT_NETWORK: `"${process.env.DEFAULT_NETWORK}"`, + REACT_APP_MAPBOX_ACCESS_TOKEN: `"${process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}"`, }), new StyleLintPlugin({ context: `${path.resolve(__dirname, '../../src')}`, diff --git a/setup/jest.config.js b/setup/jest.config.js index 71b8a52c3f..5d7c518db3 100644 --- a/setup/jest.config.js +++ b/setup/jest.config.js @@ -346,6 +346,7 @@ module.exports = { TEST: true, VERSION: '', REACT_APP_DEFAULT_NETWORK: 'undefined', + REACT_APP_MAPBOX_ACCESS_TOKEN: 'pk.eyJ1Ij', LISK_ENABLE_DEV_TOOL: false, LISK_DOMAIN: 'https://lisk.com', }, diff --git a/src/modules/network/components/map/index.js b/src/modules/network/components/map/index.js index 8e170cccb7..dc0dd45462 100644 --- a/src/modules/network/components/map/index.js +++ b/src/modules/network/components/map/index.js @@ -52,7 +52,7 @@ const getAttributionLinks = () => { const getTiles = () => L.tileLayer( - 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFudWxpZ2h0Y3VydmUiLCJhIjoiY2x1Nm8ybTVmMG9zMDJqbnZzNWoyZzc0bSJ9.4upFBJwPjObUVkzNwChDEw', + `https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=${REACT_APP_MAPBOX_ACCESS_TOKEN}`, { id: 'mapbox/streets-v11', tileSize: 512, From a3cd38044b70b66c8576f8df0119d48b7449355a Mon Sep 17 00:00:00 2001 From: Ikemefuna Obioha Date: Wed, 27 Mar 2024 11:55:50 +0100 Subject: [PATCH 3/4] Updated env gitignore config --- .env | 2 +- .gitignore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 4003d54f70..9da37d3f09 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -REACT_APP_MAPBOX_ACCESS_TOKEN= \ No newline at end of file +REACT_APP_MAPBOX_ACCESS_TOKEN= diff --git a/.gitignore b/.gitignore index b6d8c40faf..0358311ed3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ app/app.js blockchain_explorer.db.gz reports .history -.env.local +.env.* yarn-error.log *.tgz From afb9399f8cde0973f7d452831e464095f9e1d949 Mon Sep 17 00:00:00 2001 From: Ikemefuna Obioha Date: Wed, 27 Mar 2024 12:10:48 +0100 Subject: [PATCH 4/4] Renamed exampl env file --- .env => .env.example | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .env => .env.example (100%) diff --git a/.env b/.env.example similarity index 100% rename from .env rename to .env.example