diff --git a/.env.example b/.env.example new file mode 100644 index 0000000000..9da37d3f09 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +REACT_APP_MAPBOX_ACCESS_TOKEN= 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..0358311ed3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ app/app.js blockchain_explorer.db.gz reports .history -.env +.env.* 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 a125895975..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.eyJ1IjoibWFudWxpZ2h0Y3VydmUiLCJhIjoiY2xodWVjYW52MGM0cDNobzYzZGRkOGU0dyJ9.aOMEZq0mbD6C-DgwU_ib_A', + `https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=${REACT_APP_MAPBOX_ACCESS_TOKEN}`, { id: 'mapbox/streets-v11', tileSize: 512,