mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
Migrate to react-dom-router v6 (#422)
This commit is contained in:
parent
a16af276c5
commit
c2110d1620
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Copy node_modules if it doesn't exist
|
# Copy node_modules if it doesn't exist
|
||||||
if [ ! -f "/usr/src/frontend/node_modules" ]; then
|
if [ ! -d "/usr/src/frontend/node_modules" ]; then
|
||||||
echo "Looks like the first run of this container. Node modules were not detected on the attached volume, copying them into the attached volume."
|
echo "Looks like the first run of this container. Node modules were not detected on the attached volume, copying them into the attached volume."
|
||||||
cp -R /tmp/node_modules /usr/src/frontend/node_modules
|
cp -R /tmp/node_modules /usr/src/frontend/node_modules
|
||||||
fi
|
fi
|
||||||
|
193
frontend/package-lock.json
generated
193
frontend/package-lock.json
generated
@ -10,7 +10,6 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
||||||
"@date-io/date-fns": "^2.15.0",
|
|
||||||
"@emotion/react": "^11.7.1",
|
"@emotion/react": "^11.7.1",
|
||||||
"@emotion/styled": "^11.6.0",
|
"@emotion/styled": "^11.6.0",
|
||||||
"@mui/base": "^5.0.0-alpha.77",
|
"@mui/base": "^5.0.0-alpha.77",
|
||||||
@ -40,7 +39,7 @@
|
|||||||
"react-i18next": "^11.16.2",
|
"react-i18next": "^11.16.2",
|
||||||
"react-image": "^4.0.3",
|
"react-image": "^4.0.3",
|
||||||
"react-qr-code": "^2.0.3",
|
"react-qr-code": "^2.0.3",
|
||||||
"react-router-dom": "^5.2.0",
|
"react-router-dom": "^6.10.0",
|
||||||
"react-smooth-image": "^1.1.0",
|
"react-smooth-image": "^1.1.0",
|
||||||
"react-world-flags": "^1.4.0",
|
"react-world-flags": "^1.4.0",
|
||||||
"reconnecting-websocket": "^4.4.0",
|
"reconnecting-websocket": "^4.4.0",
|
||||||
@ -3733,6 +3732,14 @@
|
|||||||
"react-dom": "^16.8.0 || >=17.0.0 || >=18.0.0"
|
"react-dom": "^16.8.0 || >=17.0.0 || >=18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@remix-run/router": {
|
||||||
|
"version": "1.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.5.0.tgz",
|
||||||
|
"integrity": "sha512-bkUDCp8o1MvFO+qxkODcbhSqRa6P2GXgrGZVpt0dCXNW2HCSCqYI0ZoAqEOSAjRWmmlKcYgFvN4B4S+zo/f8kg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@sinonjs/commons": {
|
"node_modules/@sinonjs/commons": {
|
||||||
"version": "1.8.6",
|
"version": "1.8.6",
|
||||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz",
|
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz",
|
||||||
@ -7695,19 +7702,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/history": {
|
|
||||||
"version": "4.10.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
|
||||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/runtime": "^7.1.2",
|
|
||||||
"loose-envify": "^1.2.0",
|
|
||||||
"resolve-pathname": "^3.0.0",
|
|
||||||
"tiny-invariant": "^1.0.2",
|
|
||||||
"tiny-warning": "^1.0.0",
|
|
||||||
"value-equal": "^1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/hoist-non-react-statics": {
|
"node_modules/hoist-non-react-statics": {
|
||||||
"version": "3.3.2",
|
"version": "3.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||||
@ -8275,11 +8269,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/isarray": {
|
|
||||||
"version": "0.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
|
||||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
|
||||||
},
|
|
||||||
"node_modules/isexe": {
|
"node_modules/isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
@ -13236,14 +13225,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
||||||
},
|
},
|
||||||
"node_modules/path-to-regexp": {
|
|
||||||
"version": "1.8.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
|
||||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
|
||||||
"dependencies": {
|
|
||||||
"isarray": "0.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/path-type": {
|
"node_modules/path-type": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||||
@ -13640,46 +13621,35 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router": {
|
"node_modules/react-router": {
|
||||||
"version": "5.3.4",
|
"version": "6.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.10.0.tgz",
|
||||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
"integrity": "sha512-Nrg0BWpQqrC3ZFFkyewrflCud9dio9ME3ojHCF/WLsprJVzkq3q3UeEhMCAW1dobjeGbWgjNn/PVF6m46ANxXQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.12.13",
|
"@remix-run/router": "1.5.0"
|
||||||
"history": "^4.9.0",
|
},
|
||||||
"hoist-non-react-statics": "^3.1.0",
|
"engines": {
|
||||||
"loose-envify": "^1.3.1",
|
"node": ">=14"
|
||||||
"path-to-regexp": "^1.7.0",
|
|
||||||
"prop-types": "^15.6.2",
|
|
||||||
"react-is": "^16.6.0",
|
|
||||||
"tiny-invariant": "^1.0.2",
|
|
||||||
"tiny-warning": "^1.0.0"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": ">=15"
|
"react": ">=16.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router-dom": {
|
"node_modules/react-router-dom": {
|
||||||
"version": "5.3.4",
|
"version": "6.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.10.0.tgz",
|
||||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
"integrity": "sha512-E5dfxRPuXKJqzwSe/qGcqdwa18QiWC6f3H3cWXM24qj4N0/beCIf/CWTipop2xm7mR0RCS99NnaqPNjHtrAzCg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.12.13",
|
"@remix-run/router": "1.5.0",
|
||||||
"history": "^4.9.0",
|
"react-router": "6.10.0"
|
||||||
"loose-envify": "^1.3.1",
|
},
|
||||||
"prop-types": "^15.6.2",
|
"engines": {
|
||||||
"react-router": "5.3.4",
|
"node": ">=14"
|
||||||
"tiny-invariant": "^1.0.2",
|
|
||||||
"tiny-warning": "^1.0.0"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": ">=15"
|
"react": ">=16.8",
|
||||||
|
"react-dom": ">=16.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router/node_modules/react-is": {
|
|
||||||
"version": "16.13.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
|
||||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
|
||||||
},
|
|
||||||
"node_modules/react-smooth-image": {
|
"node_modules/react-smooth-image": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-smooth-image/-/react-smooth-image-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-smooth-image/-/react-smooth-image-1.1.0.tgz",
|
||||||
@ -13909,11 +13879,6 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/resolve-pathname": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
|
||||||
},
|
|
||||||
"node_modules/resolve.exports": {
|
"node_modules/resolve.exports": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.1.tgz",
|
||||||
@ -14588,16 +14553,6 @@
|
|||||||
"globrex": "^0.1.2"
|
"globrex": "^0.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tiny-invariant": {
|
|
||||||
"version": "1.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
|
|
||||||
"integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw=="
|
|
||||||
},
|
|
||||||
"node_modules/tiny-warning": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
|
||||||
},
|
|
||||||
"node_modules/tmpl": {
|
"node_modules/tmpl": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
|
||||||
@ -14984,11 +14939,6 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/value-equal": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
|
||||||
},
|
|
||||||
"node_modules/void-elements": {
|
"node_modules/void-elements": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
|
||||||
@ -17986,6 +17936,11 @@
|
|||||||
"@react-spring/types": "~9.4.5"
|
"@react-spring/types": "~9.4.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@remix-run/router": {
|
||||||
|
"version": "1.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.5.0.tgz",
|
||||||
|
"integrity": "sha512-bkUDCp8o1MvFO+qxkODcbhSqRa6P2GXgrGZVpt0dCXNW2HCSCqYI0ZoAqEOSAjRWmmlKcYgFvN4B4S+zo/f8kg=="
|
||||||
|
},
|
||||||
"@sinonjs/commons": {
|
"@sinonjs/commons": {
|
||||||
"version": "1.8.6",
|
"version": "1.8.6",
|
||||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz",
|
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.6.tgz",
|
||||||
@ -20991,19 +20946,6 @@
|
|||||||
"has-symbols": "^1.0.2"
|
"has-symbols": "^1.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"history": {
|
|
||||||
"version": "4.10.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
|
||||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
|
||||||
"requires": {
|
|
||||||
"@babel/runtime": "^7.1.2",
|
|
||||||
"loose-envify": "^1.2.0",
|
|
||||||
"resolve-pathname": "^3.0.0",
|
|
||||||
"tiny-invariant": "^1.0.2",
|
|
||||||
"tiny-warning": "^1.0.0",
|
|
||||||
"value-equal": "^1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"hoist-non-react-statics": {
|
"hoist-non-react-statics": {
|
||||||
"version": "3.3.2",
|
"version": "3.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||||
@ -21392,11 +21334,6 @@
|
|||||||
"is-docker": "^2.0.0"
|
"is-docker": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"isarray": {
|
|
||||||
"version": "0.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
|
||||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
|
||||||
},
|
|
||||||
"isexe": {
|
"isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
@ -24926,14 +24863,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
|
||||||
},
|
},
|
||||||
"path-to-regexp": {
|
|
||||||
"version": "1.8.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
|
||||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
|
||||||
"requires": {
|
|
||||||
"isarray": "0.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"path-type": {
|
"path-type": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||||
@ -25213,40 +25142,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-router": {
|
"react-router": {
|
||||||
"version": "5.3.4",
|
"version": "6.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.10.0.tgz",
|
||||||
"integrity": "sha512-Ys9K+ppnJah3QuaRiLxk+jDWOR1MekYQrlytiXxC1RyfbdsZkS5pvKAzCCr031xHixZwpnsYNT5xysdFHQaYsA==",
|
"integrity": "sha512-Nrg0BWpQqrC3ZFFkyewrflCud9dio9ME3ojHCF/WLsprJVzkq3q3UeEhMCAW1dobjeGbWgjNn/PVF6m46ANxXQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/runtime": "^7.12.13",
|
"@remix-run/router": "1.5.0"
|
||||||
"history": "^4.9.0",
|
|
||||||
"hoist-non-react-statics": "^3.1.0",
|
|
||||||
"loose-envify": "^1.3.1",
|
|
||||||
"path-to-regexp": "^1.7.0",
|
|
||||||
"prop-types": "^15.6.2",
|
|
||||||
"react-is": "^16.6.0",
|
|
||||||
"tiny-invariant": "^1.0.2",
|
|
||||||
"tiny-warning": "^1.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"react-is": {
|
|
||||||
"version": "16.13.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
|
|
||||||
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-router-dom": {
|
"react-router-dom": {
|
||||||
"version": "5.3.4",
|
"version": "6.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.4.tgz",
|
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.10.0.tgz",
|
||||||
"integrity": "sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==",
|
"integrity": "sha512-E5dfxRPuXKJqzwSe/qGcqdwa18QiWC6f3H3cWXM24qj4N0/beCIf/CWTipop2xm7mR0RCS99NnaqPNjHtrAzCg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/runtime": "^7.12.13",
|
"@remix-run/router": "1.5.0",
|
||||||
"history": "^4.9.0",
|
"react-router": "6.10.0"
|
||||||
"loose-envify": "^1.3.1",
|
|
||||||
"prop-types": "^15.6.2",
|
|
||||||
"react-router": "5.3.4",
|
|
||||||
"tiny-invariant": "^1.0.2",
|
|
||||||
"tiny-warning": "^1.0.0"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-smooth-image": {
|
"react-smooth-image": {
|
||||||
@ -25424,11 +25333,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
|
||||||
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
|
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
|
||||||
},
|
},
|
||||||
"resolve-pathname": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
|
||||||
},
|
|
||||||
"resolve.exports": {
|
"resolve.exports": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.1.tgz",
|
||||||
@ -25913,16 +25817,6 @@
|
|||||||
"globrex": "^0.1.2"
|
"globrex": "^0.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tiny-invariant": {
|
|
||||||
"version": "1.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.1.tgz",
|
|
||||||
"integrity": "sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw=="
|
|
||||||
},
|
|
||||||
"tiny-warning": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
|
||||||
},
|
|
||||||
"tmpl": {
|
"tmpl": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
|
||||||
@ -26202,11 +26096,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"value-equal": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
|
||||||
},
|
|
||||||
"void-elements": {
|
"void-elements": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
"react-i18next": "^11.16.2",
|
"react-i18next": "^11.16.2",
|
||||||
"react-image": "^4.0.3",
|
"react-image": "^4.0.3",
|
||||||
"react-qr-code": "^2.0.3",
|
"react-qr-code": "^2.0.3",
|
||||||
"react-router-dom": "^5.2.0",
|
"react-router-dom": "^6.10.0",
|
||||||
"react-smooth-image": "^1.1.0",
|
"react-smooth-image": "^1.1.0",
|
||||||
"react-world-flags": "^1.4.0",
|
"react-world-flags": "^1.4.0",
|
||||||
"reconnecting-websocket": "^4.4.0",
|
"reconnecting-websocket": "^4.4.0",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useContext, useEffect, useState } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button, Grid, ButtonGroup, Dialog, Box } from '@mui/material';
|
import { Button, Grid, ButtonGroup, Dialog, Box } from '@mui/material';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import DepthChart from '../../components/Charts/DepthChart';
|
import DepthChart from '../../components/Charts/DepthChart';
|
||||||
|
|
||||||
import { NoRobotDialog } from '../../components/Dialogs';
|
import { NoRobotDialog } from '../../components/Dialogs';
|
||||||
@ -26,7 +26,7 @@ const BookPage = (): JSX.Element => {
|
|||||||
setOrder,
|
setOrder,
|
||||||
} = useContext<AppContextProps>(AppContext);
|
} = useContext<AppContextProps>(AppContext);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const navigate = useNavigate();
|
||||||
const [view, setView] = useState<'list' | 'depth'>('list');
|
const [view, setView] = useState<'list' | 'depth'>('list');
|
||||||
const [openMaker, setOpenMaker] = useState<boolean>(false);
|
const [openMaker, setOpenMaker] = useState<boolean>(false);
|
||||||
const [openNoRobot, setOpenNoRobot] = useState<boolean>(false);
|
const [openNoRobot, setOpenNoRobot] = useState<boolean>(false);
|
||||||
@ -47,7 +47,7 @@ const BookPage = (): JSX.Element => {
|
|||||||
|
|
||||||
const onOrderClicked = function (id: number) {
|
const onOrderClicked = function (id: number) {
|
||||||
if (robot.avatarLoaded) {
|
if (robot.avatarLoaded) {
|
||||||
history.push('/order/' + id);
|
navigate('/order/' + id);
|
||||||
setPage('order');
|
setPage('order');
|
||||||
setCurrentOrder(id);
|
setCurrentOrder(id);
|
||||||
onViewOrder();
|
onViewOrder();
|
||||||
@ -97,7 +97,7 @@ const BookPage = (): JSX.Element => {
|
|||||||
clearOrder();
|
clearOrder();
|
||||||
setCurrentOrder(id);
|
setCurrentOrder(id);
|
||||||
setPage('order');
|
setPage('order');
|
||||||
history.push('/order/' + id);
|
navigate('/order/' + id);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { HashRouter, BrowserRouter, Switch, Route } from 'react-router-dom';
|
import { MemoryRouter, BrowserRouter, Routes, Route } from 'react-router-dom';
|
||||||
import { Box, Slide, Typography } from '@mui/material';
|
import { Box, Slide, Typography } from '@mui/material';
|
||||||
|
|
||||||
import RobotPage from './RobotPage';
|
import RobotPage from './RobotPage';
|
||||||
@ -16,6 +16,8 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import Notifications from '../components/Notifications';
|
import Notifications from '../components/Notifications';
|
||||||
import { AppContextProps, AppContext } from '../contexts/AppContext';
|
import { AppContextProps, AppContext } from '../contexts/AppContext';
|
||||||
|
|
||||||
|
const Router = window.NativeRobosats === undefined ? BrowserRouter : MemoryRouter;
|
||||||
|
|
||||||
const Main = (): JSX.Element => {
|
const Main = (): JSX.Element => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const {
|
const {
|
||||||
@ -33,11 +35,8 @@ const Main = (): JSX.Element => {
|
|||||||
navbarHeight,
|
navbarHeight,
|
||||||
} = useContext<AppContextProps>(AppContext);
|
} = useContext<AppContextProps>(AppContext);
|
||||||
|
|
||||||
const Router = window.NativeRobosats === undefined ? BrowserRouter : HashRouter;
|
|
||||||
const basename = window.NativeRobosats === undefined ? '' : window.location.pathname;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Router basename={basename}>
|
<Router>
|
||||||
<RobotAvatar
|
<RobotAvatar
|
||||||
style={{ display: 'none' }}
|
style={{ display: 'none' }}
|
||||||
nickname={robot.nickname}
|
nickname={robot.nickname}
|
||||||
@ -70,74 +69,87 @@ const Main = (): JSX.Element => {
|
|||||||
transform: `translate(-50%, -50%) translate(0, -${navbarHeight / 2}em`,
|
transform: `translate(-50%, -50%) translate(0, -${navbarHeight / 2}em`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Switch>
|
<Routes>
|
||||||
|
{['/robot/:refCode?', '/', ''].map((path, index) => {
|
||||||
|
return (
|
||||||
|
<Route
|
||||||
|
path={path}
|
||||||
|
element={
|
||||||
|
<Slide
|
||||||
|
direction={page === 'robot' ? slideDirection.in : slideDirection.out}
|
||||||
|
in={page === 'robot'}
|
||||||
|
appear={slideDirection.in != undefined}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<RobotPage />
|
||||||
|
</div>
|
||||||
|
</Slide>
|
||||||
|
}
|
||||||
|
key={index}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path={['/robot/:refCode?', '/']}
|
path={'/offers'}
|
||||||
exact
|
element={
|
||||||
render={(props: any) => (
|
|
||||||
<Slide
|
<Slide
|
||||||
direction={page === 'robot' ? slideDirection.in : slideDirection.out}
|
direction={page === 'offers' ? slideDirection.in : slideDirection.out}
|
||||||
in={page === 'robot'}
|
in={page === 'offers'}
|
||||||
appear={slideDirection.in != undefined}
|
appear={slideDirection.in != undefined}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<RobotPage />
|
<BookPage />
|
||||||
</div>
|
</div>
|
||||||
</Slide>
|
</Slide>
|
||||||
)}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route path={'/offers'}>
|
<Route
|
||||||
<Slide
|
path='/create'
|
||||||
direction={page === 'offers' ? slideDirection.in : slideDirection.out}
|
element={
|
||||||
in={page === 'offers'}
|
<Slide
|
||||||
appear={slideDirection.in != undefined}
|
direction={page === 'create' ? slideDirection.in : slideDirection.out}
|
||||||
>
|
in={page === 'create'}
|
||||||
<div>
|
appear={slideDirection.in != undefined}
|
||||||
<BookPage />
|
>
|
||||||
</div>
|
<div>
|
||||||
</Slide>
|
<MakerPage />
|
||||||
</Route>
|
</div>
|
||||||
|
</Slide>
|
||||||
<Route path='/create'>
|
}
|
||||||
<Slide
|
/>
|
||||||
direction={page === 'create' ? slideDirection.in : slideDirection.out}
|
|
||||||
in={page === 'create'}
|
|
||||||
appear={slideDirection.in != undefined}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<MakerPage />
|
|
||||||
</div>
|
|
||||||
</Slide>
|
|
||||||
</Route>
|
|
||||||
|
|
||||||
<Route
|
<Route
|
||||||
path='/order/:orderId'
|
path='/order/:orderId'
|
||||||
render={(props: any) => (
|
element={
|
||||||
<Slide
|
<Slide
|
||||||
direction={page === 'order' ? slideDirection.in : slideDirection.out}
|
direction={page === 'order' ? slideDirection.in : slideDirection.out}
|
||||||
in={page === 'order'}
|
in={page === 'order'}
|
||||||
appear={slideDirection.in != undefined}
|
appear={slideDirection.in != undefined}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<OrderPage locationOrderId={props.match.params.orderId} />
|
<OrderPage />
|
||||||
</div>
|
</div>
|
||||||
</Slide>
|
</Slide>
|
||||||
)}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Route path='/settings'>
|
<Route
|
||||||
<Slide
|
path='/settings'
|
||||||
direction={page === 'settings' ? slideDirection.in : slideDirection.out}
|
element={
|
||||||
in={page === 'settings'}
|
<Slide
|
||||||
appear={slideDirection.in != undefined}
|
direction={page === 'settings' ? slideDirection.in : slideDirection.out}
|
||||||
>
|
in={page === 'settings'}
|
||||||
<div>
|
appear={slideDirection.in != undefined}
|
||||||
<SettingsPage />
|
>
|
||||||
</div>
|
<div>
|
||||||
</Slide>
|
<SettingsPage />
|
||||||
</Route>
|
</div>
|
||||||
</Switch>
|
</Slide>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Routes>
|
||||||
</Box>
|
</Box>
|
||||||
<div style={{ alignContent: 'center', display: 'flex' }}>
|
<div style={{ alignContent: 'center', display: 'flex' }}>
|
||||||
<NavBar width={windowSize.width} height={navbarHeight} />
|
<NavBar width={windowSize.width} height={navbarHeight} />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useContext, useMemo, useState } from 'react';
|
import React, { useContext, useMemo, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { Grid, Paper, Collapse, Typography } from '@mui/material';
|
import { Grid, Paper, Collapse, Typography } from '@mui/material';
|
||||||
|
|
||||||
import { filterOrders } from '../../utils';
|
import { filterOrders } from '../../utils';
|
||||||
@ -26,7 +26,7 @@ const MakerPage = (): JSX.Element => {
|
|||||||
setDelay,
|
setDelay,
|
||||||
} = useContext<AppContextProps>(AppContext);
|
} = useContext<AppContextProps>(AppContext);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const maxHeight = (windowSize.height - navbarHeight) * 0.85 - 3;
|
const maxHeight = (windowSize.height - navbarHeight) * 0.85 - 3;
|
||||||
const [showMatches, setShowMatches] = useState<boolean>(false);
|
const [showMatches, setShowMatches] = useState<boolean>(false);
|
||||||
@ -57,7 +57,7 @@ const MakerPage = (): JSX.Element => {
|
|||||||
|
|
||||||
const onOrderClicked = function (id: number) {
|
const onOrderClicked = function (id: number) {
|
||||||
if (robot.avatarLoaded) {
|
if (robot.avatarLoaded) {
|
||||||
history.push('/order/' + id);
|
navigate('/order/' + id);
|
||||||
setPage('order');
|
setPage('order');
|
||||||
setCurrentOrder(id);
|
setCurrentOrder(id);
|
||||||
onViewOrder();
|
onViewOrder();
|
||||||
@ -105,7 +105,7 @@ const MakerPage = (): JSX.Element => {
|
|||||||
clearOrder();
|
clearOrder();
|
||||||
setCurrentOrder(id);
|
setCurrentOrder(id);
|
||||||
setPage('order');
|
setPage('order');
|
||||||
history.push('/order/' + id);
|
navigate('/order/' + id);
|
||||||
}}
|
}}
|
||||||
hasRobot={robot.avatarLoaded}
|
hasRobot={robot.avatarLoaded}
|
||||||
disableRequest={matches.length > 0 && !showMatches}
|
disableRequest={matches.length > 0 && !showMatches}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useContext, useEffect } from 'react';
|
import React, { useContext, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { Tabs, Tab, Paper, useTheme } from '@mui/material';
|
import { Tabs, Tab, Paper, useTheme } from '@mui/material';
|
||||||
import MoreTooltip from './MoreTooltip';
|
import MoreTooltip from './MoreTooltip';
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ const NavBar = ({ width, height }: NavBarProps): JSX.Element => {
|
|||||||
|
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const navigate = useNavigate();
|
||||||
const smallBar = width < 50;
|
const smallBar = width < 50;
|
||||||
|
|
||||||
const tabSx = smallBar
|
const tabSx = smallBar
|
||||||
@ -68,7 +68,7 @@ const NavBar = ({ width, height }: NavBarProps): JSX.Element => {
|
|||||||
setPage(newPage);
|
setPage(newPage);
|
||||||
const param = newPage === 'order' ? currentOrder ?? '' : '';
|
const param = newPage === 'order' ? currentOrder ?? '' : '';
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => history.push(`/${newPage}/${param}`),
|
() => navigate(`/${newPage}/${param}`),
|
||||||
theme.transitions.duration.leavingScreen * 3,
|
theme.transitions.duration.leavingScreen * 3,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useContext, useEffect, useState } from 'react';
|
import React, { useContext, useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Tab, Tabs, Paper, CircularProgress, Grid, Typography, Box } from '@mui/material';
|
import { Tab, Tabs, Paper, CircularProgress, Grid, Typography, Box } from '@mui/material';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
|
|
||||||
import TradeBox from '../../components/TradeBox';
|
import TradeBox from '../../components/TradeBox';
|
||||||
import OrderDetails from '../../components/OrderDetails';
|
import OrderDetails from '../../components/OrderDetails';
|
||||||
@ -9,11 +9,7 @@ import OrderDetails from '../../components/OrderDetails';
|
|||||||
import { apiClient } from '../../services/api';
|
import { apiClient } from '../../services/api';
|
||||||
import { AppContext, AppContextProps } from '../../contexts/AppContext';
|
import { AppContext, AppContextProps } from '../../contexts/AppContext';
|
||||||
|
|
||||||
interface OrderPageProps {
|
const OrderPage = (): JSX.Element => {
|
||||||
locationOrderId: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const OrderPage = ({ locationOrderId }: OrderPageProps): JSX.Element => {
|
|
||||||
const {
|
const {
|
||||||
windowSize,
|
windowSize,
|
||||||
info,
|
info,
|
||||||
@ -29,14 +25,15 @@ const OrderPage = ({ locationOrderId }: OrderPageProps): JSX.Element => {
|
|||||||
navbarHeight,
|
navbarHeight,
|
||||||
} = useContext<AppContextProps>(AppContext);
|
} = useContext<AppContextProps>(AppContext);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const navigate = useNavigate();
|
||||||
|
const params = useParams();
|
||||||
|
|
||||||
const doublePageWidth: number = 50;
|
const doublePageWidth: number = 50;
|
||||||
const maxHeight: number = (windowSize.height - navbarHeight) * 0.85 - 3;
|
const maxHeight: number = (windowSize.height - navbarHeight) * 0.85 - 3;
|
||||||
|
|
||||||
const [tab, setTab] = useState<'order' | 'contract'>('contract');
|
const [tab, setTab] = useState<'order' | 'contract'>('contract');
|
||||||
|
|
||||||
useEffect(() => setCurrentOrder(locationOrderId), []);
|
useEffect(() => setCurrentOrder(Number(params.orderId)), []);
|
||||||
|
|
||||||
const renewOrder = function () {
|
const renewOrder = function () {
|
||||||
if (order != undefined) {
|
if (order != undefined) {
|
||||||
@ -60,7 +57,7 @@ const OrderPage = ({ locationOrderId }: OrderPageProps): JSX.Element => {
|
|||||||
if (data.bad_request) {
|
if (data.bad_request) {
|
||||||
setBadOrder(data.bad_request);
|
setBadOrder(data.bad_request);
|
||||||
} else if (data.id) {
|
} else if (data.id) {
|
||||||
history.push('/order/' + data.id);
|
navigate('/order/' + data.id);
|
||||||
setCurrentOrder(data.id);
|
setCurrentOrder(data.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -68,7 +65,7 @@ const OrderPage = ({ locationOrderId }: OrderPageProps): JSX.Element => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const startAgain = function () {
|
const startAgain = function () {
|
||||||
history.push('/robot');
|
navigate('/robot');
|
||||||
setPage('robot');
|
setPage('robot');
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
Box,
|
Box,
|
||||||
@ -48,7 +48,7 @@ const Onboarding = ({
|
|||||||
baseUrl,
|
baseUrl,
|
||||||
}: OnboardingProps): JSX.Element => {
|
}: OnboardingProps): JSX.Element => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const [step, setStep] = useState<'1' | '2' | '3'>('1');
|
const [step, setStep] = useState<'1' | '2' | '3'>('1');
|
||||||
const [generatedToken, setGeneratedToken] = useState<boolean>(false);
|
const [generatedToken, setGeneratedToken] = useState<boolean>(false);
|
||||||
@ -63,7 +63,7 @@ const Onboarding = ({
|
|||||||
|
|
||||||
const changePage = function (newPage: Page) {
|
const changePage = function (newPage: Page) {
|
||||||
setPage(newPage);
|
setPage(newPage);
|
||||||
history.push(`/${newPage}`);
|
navigate(`/${newPage}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useState, useContext, useEffect } from 'react';
|
import React, { useState, useContext, useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Grid,
|
Grid,
|
||||||
@ -56,7 +56,7 @@ const RobotProfile = ({
|
|||||||
useContext<AppContextProps>(AppContext);
|
useContext<AppContextProps>(AppContext);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const history = useHistory();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const [loading, setLoading] = useState<boolean>(true);
|
const [loading, setLoading] = useState<boolean>(true);
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ const RobotProfile = ({
|
|||||||
<Grid item>
|
<Grid item>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
history.push('/order/' + robot.activeOrderId);
|
navigate('/order/' + robot.activeOrderId);
|
||||||
setPage('order');
|
setPage('order');
|
||||||
setCurrentOrder(robot.activeOrderId);
|
setCurrentOrder(robot.activeOrderId);
|
||||||
}}
|
}}
|
||||||
@ -172,7 +172,7 @@ const RobotProfile = ({
|
|||||||
<Grid item>
|
<Grid item>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
history.push('/order/' + robot.lastOrderId);
|
navigate('/order/' + robot.lastOrderId);
|
||||||
setPage('order');
|
setPage('order');
|
||||||
setCurrentOrder(robot.lastOrderId);
|
setCurrentOrder(robot.lastOrderId);
|
||||||
}}
|
}}
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
DialogContentText,
|
DialogContentText,
|
||||||
Button,
|
Button,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { AppContext, AppContextProps } from '../../contexts/AppContext';
|
import { AppContext, AppContextProps } from '../../contexts/AppContext';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -19,12 +19,12 @@ interface Props {
|
|||||||
const NoRobotDialog = ({ open, onClose }: Props): JSX.Element => {
|
const NoRobotDialog = ({ open, onClose }: Props): JSX.Element => {
|
||||||
const { setPage } = useContext<AppContextProps>(AppContext);
|
const { setPage } = useContext<AppContextProps>(AppContext);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const handleClickGenerate = function () {
|
const handleClickGenerate = function () {
|
||||||
onClose();
|
onClose();
|
||||||
setPage('robot');
|
setPage('robot');
|
||||||
history.push('/robot');
|
navigate('/robot');
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useTheme } from '@mui/material/styles';
|
import { useTheme } from '@mui/material/styles';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Badge,
|
Badge,
|
||||||
@ -62,7 +62,7 @@ const ProfileDialog = ({
|
|||||||
setCurrentOrder,
|
setCurrentOrder,
|
||||||
}: Props): JSX.Element => {
|
}: Props): JSX.Element => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const navigate = useNavigate();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const host = getHost();
|
const host = getHost();
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ const ProfileDialog = ({
|
|||||||
{robot.activeOrderId ? (
|
{robot.activeOrderId ? (
|
||||||
<ListItemButton
|
<ListItemButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
history.push('/order/' + robot.activeOrderId);
|
navigate('/order/' + robot.activeOrderId);
|
||||||
setPage('order');
|
setPage('order');
|
||||||
setCurrentOrder(robot.activeOrderId);
|
setCurrentOrder(robot.activeOrderId);
|
||||||
onClose();
|
onClose();
|
||||||
@ -200,7 +200,7 @@ const ProfileDialog = ({
|
|||||||
) : robot.lastOrderId ? (
|
) : robot.lastOrderId ? (
|
||||||
<ListItemButton
|
<ListItemButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
history.push('/order/' + robot.lastOrderId);
|
navigate('/order/' + robot.lastOrderId);
|
||||||
setPage('order');
|
setPage('order');
|
||||||
setCurrentOrder(robot.lastOrderId);
|
setCurrentOrder(robot.lastOrderId);
|
||||||
onClose();
|
onClose();
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
styled,
|
styled,
|
||||||
tooltipClasses,
|
tooltipClasses,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { Order } from '../../models';
|
import { Order } from '../../models';
|
||||||
import Close from '@mui/icons-material/Close';
|
import Close from '@mui/icons-material/Close';
|
||||||
import { Page } from '../../basic/NavBar';
|
import { Page } from '../../basic/NavBar';
|
||||||
@ -68,8 +68,7 @@ const Notifications = ({
|
|||||||
openProfile,
|
openProfile,
|
||||||
}: NotificationsProps): JSX.Element => {
|
}: NotificationsProps): JSX.Element => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
const navigate = useNavigate();
|
||||||
const history = useHistory();
|
|
||||||
|
|
||||||
const [message, setMessage] = useState<NotificationMessage>(emptyNotificationMessage);
|
const [message, setMessage] = useState<NotificationMessage>(emptyNotificationMessage);
|
||||||
const [inFocus, setInFocus] = useState<boolean>(true);
|
const [inFocus, setInFocus] = useState<boolean>(true);
|
||||||
@ -86,7 +85,7 @@ const Notifications = ({
|
|||||||
|
|
||||||
const moveToOrderPage = function () {
|
const moveToOrderPage = function () {
|
||||||
setPage('order');
|
setPage('order');
|
||||||
history.push(`/order/${order?.id}`);
|
navigate(`/order/${order?.id}`);
|
||||||
setShow(false);
|
setShow(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user