@@ -96,7 +97,7 @@ const Widget = ({
{(onClick || linkTo) && (
{externalLink ? (
-
+
) : (
)}
@@ -114,8 +115,10 @@ const Widget = ({
target="_blank"
rel="noopener noreferrer"
className={classNames(
- 'bg-gray-200 p-3 rounded-lg flex transition-all cursor-pointer hover:bg-gray-300',
+ 'flex cursor-pointer rounded-lg p-3 transition-all',
{
+ 'bg-gray-200': !transparent,
+ 'hover:bg-gray-300': !transparent,
'col-span-1': span === 1,
'col-span-2': span === 2,
},
@@ -131,8 +134,10 @@ const Widget = ({
return (
{
const stats = await client.stats.dcBurns()
return {
+ ...stats,
totalWeek: stats.lastWeek.total,
totalMonth: stats.lastMonth.total,
}
diff --git a/data/makers.js b/data/makers.js
index 8b29a9ba..6f7ee0fb 100644
--- a/data/makers.js
+++ b/data/makers.js
@@ -1,9 +1,10 @@
import Balance, { CurrencyType } from '@helium/currency'
+import qs from 'qs'
import { useEffect, useMemo, useState } from 'react'
import useApi from '../hooks/useApi'
-export const useMakers = () => {
- const { data: makersData } = useApi('/makers')
+export const useMakers = ({ type = 'lorawan' } = {}) => {
+ const { data: makersData } = useApi(`/makers?${qs.stringify({ type })}`)
const makers = useMemo(() => {
if (!makersData) return []
diff --git a/hooks/useSelectedCity.js b/hooks/useSelectedCity.js
index 0a095139..d36f7fb7 100644
--- a/hooks/useSelectedCity.js
+++ b/hooks/useSelectedCity.js
@@ -26,7 +26,7 @@ const useSelectedCity = () => {
type: SET_SELECTED_CITY,
payload: { ...city, geometry },
})
- history.push(`/hotspots/cities/${city.cityId}`)
+ history.push(`/iot/cities/${city.cityId}`)
},
[dispatch, history],
)
diff --git a/hooks/useSelectedHex.js b/hooks/useSelectedHex.js
index 66f49118..ac9ed5b9 100644
--- a/hooks/useSelectedHex.js
+++ b/hooks/useSelectedHex.js
@@ -25,7 +25,7 @@ const useSelectedHex = () => {
type: SET_SELECTED_HEX,
payload: { ...hex },
})
- history.push(`/hotspots/hex/${index}`)
+ history.push(`/iot/hex/${index}`)
},
[dispatch, history],
)
diff --git a/next.config.js b/next.config.js
index a279450a..8d22e077 100644
--- a/next.config.js
+++ b/next.config.js
@@ -11,6 +11,25 @@ module.exports = {
},
]
},
+ async redirects() {
+ return [
+ {
+ source: '/hotspots',
+ destination: '/iot',
+ permanent: false,
+ },
+ {
+ source: '/hotspots/hex/:index',
+ destination: '/iot/hex/:index',
+ permanent: false,
+ },
+ {
+ source: '/hotspots/cities/:cityid',
+ destination: '/iot/cities/:cityid',
+ permanent: false,
+ },
+ ]
+ },
webpack: (config, options) => {
config.module.rules.push({
test: /\.csv$/,
@@ -18,8 +37,8 @@ module.exports = {
options: {
dynamicTyping: true,
header: false,
- skipEmptyLines: true
- }
+ skipEmptyLines: true,
+ },
})
return config
diff --git a/package.json b/package.json
index f821356d..85e2b300 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,7 @@
"react-mapbox-gl": "^5.1.1",
"react-qr-code": "^2.0.0",
"react-responsive": "^9.0.0-beta.6",
- "react-router-dom": "^5.2.0",
+ "react-router-dom": "^5.3.3",
"react-router-i18n": "^1.1.0",
"react-time-ago": "^7.0.0",
"react-timestamp": "^5.1.0",
@@ -109,6 +109,7 @@
"husky": "^7.0.1",
"postcss": "^8.3.0",
"prettier": "2.5.1",
+ "prettier-plugin-tailwindcss": "^0.1.13",
"pretty-quick": "^3.1.0",
"tailwindcss": "^3.0.23",
"typescript": "^4.7.3"
diff --git a/prettier.config.js b/prettier.config.js
new file mode 100644
index 00000000..c16670dc
--- /dev/null
+++ b/prettier.config.js
@@ -0,0 +1,3 @@
+module.exports = {
+ plugins: [require('prettier-plugin-tailwindcss')],
+}
diff --git a/public/images/iot.svg b/public/images/iot.svg
new file mode 100644
index 00000000..f73cbb46
--- /dev/null
+++ b/public/images/iot.svg
@@ -0,0 +1,3 @@
+
diff --git a/public/images/mobile.svg b/public/images/mobile.svg
index 115cc353..9583202e 100644
--- a/public/images/mobile.svg
+++ b/public/images/mobile.svg
@@ -1,3 +1,3 @@
-