diff --git a/web-admin/.env b/web-admin/.env new file mode 100644 index 0000000..ba7cc18 --- /dev/null +++ b/web-admin/.env @@ -0,0 +1 @@ +GENERATE_SOURCEMAP=false diff --git a/web-admin/package-lock.json b/web-admin/package-lock.json index 33455bf..f4fa3c8 100644 --- a/web-admin/package-lock.json +++ b/web-admin/package-lock.json @@ -5440,12 +5440,13 @@ "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.7.0.tgz", - "integrity": "sha512-8RTGBpNn5a9M628wBPrCbJ+v3YTEOE2qeZb7TDkGKTDXSj36KGRg92SpFFaR/0S3rSXQxM0Og/kV9EyadsYSBg==", + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.22.0.tgz", + "integrity": "sha512-YCiy5PUzpAeOPGQ7VSGDEY2NeYUV1B0swde2e0HzokRsHBYjSdF6DZ51OuRZxVPHx0032lXGLvOMls91D8FXlg==", "dependencies": { - "@typescript-eslint/experimental-utils": "5.7.0", - "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/scope-manager": "5.22.0", + "@typescript-eslint/type-utils": "5.22.0", + "@typescript-eslint/utils": "5.22.0", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", @@ -5470,6 +5471,50 @@ } } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.22.0.tgz", + "integrity": "sha512-yA9G5NJgV5esANJCO0oF15MkBO20mIskbZ8ijfmlKIvQKg0ynVKfHZ15/nhAJN5m8Jn3X5qkwriQCiUntC9AbA==", + "dependencies": { + "@typescript-eslint/types": "5.22.0", + "@typescript-eslint/visitor-keys": "5.22.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.22.0.tgz", + "integrity": "sha512-T7owcXW4l0v7NTijmjGWwWf/1JqdlWiBzPqzAWhobxft0SiEvMJB56QXmeCQjrPuM8zEfGUKyPQr/L8+cFUBLw==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.22.0.tgz", + "integrity": "sha512-DbgTqn2Dv5RFWluG88tn0pP6Ex0ROF+dpDO1TNNZdRtLjUr6bdznjA6f/qNqJLjd2PgguAES2Zgxh/JzwzETDg==", + "dependencies": { + "@typescript-eslint/types": "5.22.0", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { "version": "5.1.9", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", @@ -5563,6 +5608,31 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.22.0.tgz", + "integrity": "sha512-iqfLZIsZhK2OEJ4cQ01xOq3NaCuG5FQRKyHicA3xhZxMgaxQazLUHbH/B2k9y5i7l3+o+B5ND9Mf1AWETeMISA==", + "dependencies": { + "@typescript-eslint/utils": "5.22.0", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/@typescript-eslint/types": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.7.0.tgz", @@ -5601,6 +5671,119 @@ } } }, + "node_modules/@typescript-eslint/utils": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.22.0.tgz", + "integrity": "sha512-HodsGb037iobrWSUMS7QH6Hl1kppikjA1ELiJlNSTYf/UdMEwzgj0WIp+lBNb6WZ3zTwb0tEz51j0Wee3iJ3wQ==", + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.22.0", + "@typescript-eslint/types": "5.22.0", + "@typescript-eslint/typescript-estree": "5.22.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.22.0.tgz", + "integrity": "sha512-yA9G5NJgV5esANJCO0oF15MkBO20mIskbZ8ijfmlKIvQKg0ynVKfHZ15/nhAJN5m8Jn3X5qkwriQCiUntC9AbA==", + "dependencies": { + "@typescript-eslint/types": "5.22.0", + "@typescript-eslint/visitor-keys": "5.22.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.22.0.tgz", + "integrity": "sha512-T7owcXW4l0v7NTijmjGWwWf/1JqdlWiBzPqzAWhobxft0SiEvMJB56QXmeCQjrPuM8zEfGUKyPQr/L8+cFUBLw==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.22.0.tgz", + "integrity": "sha512-EyBEQxvNjg80yinGE2xdhpDYm41so/1kOItl0qrjIiJ1kX/L/L8WWGmJg8ni6eG3DwqmOzDqOhe6763bF92nOw==", + "dependencies": { + "@typescript-eslint/types": "5.22.0", + "@typescript-eslint/visitor-keys": "5.22.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.22.0.tgz", + "integrity": "sha512-DbgTqn2Dv5RFWluG88tn0pP6Ex0ROF+dpDO1TNNZdRtLjUr6bdznjA6f/qNqJLjd2PgguAES2Zgxh/JzwzETDg==", + "dependencies": { + "@typescript-eslint/types": "5.22.0", + "eslint-visitor-keys": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "engines": { + "node": ">=4.0" + } + }, "node_modules/@typescript-eslint/visitor-keys": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz", @@ -27465,12 +27648,13 @@ "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==" }, "@typescript-eslint/eslint-plugin": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.7.0.tgz", - "integrity": "sha512-8RTGBpNn5a9M628wBPrCbJ+v3YTEOE2qeZb7TDkGKTDXSj36KGRg92SpFFaR/0S3rSXQxM0Og/kV9EyadsYSBg==", + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.22.0.tgz", + "integrity": "sha512-YCiy5PUzpAeOPGQ7VSGDEY2NeYUV1B0swde2e0HzokRsHBYjSdF6DZ51OuRZxVPHx0032lXGLvOMls91D8FXlg==", "requires": { - "@typescript-eslint/experimental-utils": "5.7.0", - "@typescript-eslint/scope-manager": "5.7.0", + "@typescript-eslint/scope-manager": "5.22.0", + "@typescript-eslint/type-utils": "5.22.0", + "@typescript-eslint/utils": "5.22.0", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", @@ -27479,6 +27663,29 @@ "tsutils": "^3.21.0" }, "dependencies": { + "@typescript-eslint/scope-manager": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.22.0.tgz", + "integrity": "sha512-yA9G5NJgV5esANJCO0oF15MkBO20mIskbZ8ijfmlKIvQKg0ynVKfHZ15/nhAJN5m8Jn3X5qkwriQCiUntC9AbA==", + "requires": { + "@typescript-eslint/types": "5.22.0", + "@typescript-eslint/visitor-keys": "5.22.0" + } + }, + "@typescript-eslint/types": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.22.0.tgz", + "integrity": "sha512-T7owcXW4l0v7NTijmjGWwWf/1JqdlWiBzPqzAWhobxft0SiEvMJB56QXmeCQjrPuM8zEfGUKyPQr/L8+cFUBLw==" + }, + "@typescript-eslint/visitor-keys": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.22.0.tgz", + "integrity": "sha512-DbgTqn2Dv5RFWluG88tn0pP6Ex0ROF+dpDO1TNNZdRtLjUr6bdznjA6f/qNqJLjd2PgguAES2Zgxh/JzwzETDg==", + "requires": { + "@typescript-eslint/types": "5.22.0", + "eslint-visitor-keys": "^3.0.0" + } + }, "ignore": { "version": "5.1.9", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", @@ -27535,6 +27742,16 @@ "@typescript-eslint/visitor-keys": "5.7.0" } }, + "@typescript-eslint/type-utils": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.22.0.tgz", + "integrity": "sha512-iqfLZIsZhK2OEJ4cQ01xOq3NaCuG5FQRKyHicA3xhZxMgaxQazLUHbH/B2k9y5i7l3+o+B5ND9Mf1AWETeMISA==", + "requires": { + "@typescript-eslint/utils": "5.22.0", + "debug": "^4.3.2", + "tsutils": "^3.21.0" + } + }, "@typescript-eslint/types": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.7.0.tgz", @@ -27554,6 +27771,72 @@ "tsutils": "^3.21.0" } }, + "@typescript-eslint/utils": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.22.0.tgz", + "integrity": "sha512-HodsGb037iobrWSUMS7QH6Hl1kppikjA1ELiJlNSTYf/UdMEwzgj0WIp+lBNb6WZ3zTwb0tEz51j0Wee3iJ3wQ==", + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.22.0", + "@typescript-eslint/types": "5.22.0", + "@typescript-eslint/typescript-estree": "5.22.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "dependencies": { + "@typescript-eslint/scope-manager": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.22.0.tgz", + "integrity": "sha512-yA9G5NJgV5esANJCO0oF15MkBO20mIskbZ8ijfmlKIvQKg0ynVKfHZ15/nhAJN5m8Jn3X5qkwriQCiUntC9AbA==", + "requires": { + "@typescript-eslint/types": "5.22.0", + "@typescript-eslint/visitor-keys": "5.22.0" + } + }, + "@typescript-eslint/types": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.22.0.tgz", + "integrity": "sha512-T7owcXW4l0v7NTijmjGWwWf/1JqdlWiBzPqzAWhobxft0SiEvMJB56QXmeCQjrPuM8zEfGUKyPQr/L8+cFUBLw==" + }, + "@typescript-eslint/typescript-estree": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.22.0.tgz", + "integrity": "sha512-EyBEQxvNjg80yinGE2xdhpDYm41so/1kOItl0qrjIiJ1kX/L/L8WWGmJg8ni6eG3DwqmOzDqOhe6763bF92nOw==", + "requires": { + "@typescript-eslint/types": "5.22.0", + "@typescript-eslint/visitor-keys": "5.22.0", + "debug": "^4.3.2", + "globby": "^11.0.4", + "is-glob": "^4.0.3", + "semver": "^7.3.5", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.22.0.tgz", + "integrity": "sha512-DbgTqn2Dv5RFWluG88tn0pP6Ex0ROF+dpDO1TNNZdRtLjUr6bdznjA6f/qNqJLjd2PgguAES2Zgxh/JzwzETDg==", + "requires": { + "@typescript-eslint/types": "5.22.0", + "eslint-visitor-keys": "^3.0.0" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + } + } + }, "@typescript-eslint/visitor-keys": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.7.0.tgz", diff --git a/web-admin/package.json b/web-admin/package.json index a357f9b..7a1f7f0 100644 --- a/web-admin/package.json +++ b/web-admin/package.json @@ -65,7 +65,18 @@ "extends": [ "react-app", "react-app/jest" - ] + ], + "rules": { + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "destructuredArrayIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "argsIgnorePattern": "^_", + "ignoreRestSiblings": true + } + ] + } }, "browserslist": { "production": [ diff --git a/web-admin/src/auth/mutations/createAdmin.ts b/web-admin/src/auth/mutations/createAdmin.ts index c4f5783..01a31d1 100644 --- a/web-admin/src/auth/mutations/createAdmin.ts +++ b/web-admin/src/auth/mutations/createAdmin.ts @@ -1,7 +1,12 @@ import sensei from "../../utils/sensei"; -const createAdmin = async (username: string, alias: string, passphrase: string, start: boolean) => { - return sensei.init({username, alias, passphrase, start}) -} +const createAdmin = async ( + username: string, + alias: string, + passphrase: string, + start: boolean +) => { + return sensei.init({ username, alias, passphrase, start }); +}; -export default createAdmin \ No newline at end of file +export default createAdmin; diff --git a/web-admin/src/auth/pages/SetupPage.tsx b/web-admin/src/auth/pages/SetupPage.tsx index 17166d0..588dab6 100644 --- a/web-admin/src/auth/pages/SetupPage.tsx +++ b/web-admin/src/auth/pages/SetupPage.tsx @@ -4,7 +4,6 @@ import { useAuth } from "../../contexts/auth"; import logo from "../../images/Icon-Lightning@2x.png"; import Spinner from "src/components/Spinner"; - const UsernamePassphraseStep = () => { let [submitting, setSubmitting] = React.useState(false); let navigate = useNavigate(); @@ -12,20 +11,15 @@ const UsernamePassphraseStep = () => { async function handleSubmit(event: React.FormEvent) { event.preventDefault(); - setSubmitting(true) + setSubmitting(true); let formData = new FormData(event.currentTarget); let username = formData.get("username") as string; let passphrase = formData.get("passphrase") as string; let alias = formData.get("alias") as string; - await auth.create( - username, - alias, - passphrase, - true - ); - setSubmitting(false) + await auth.create(username, alias, passphrase, true); + setSubmitting(false); await navigate("/admin/chain"); } @@ -34,81 +28,77 @@ const UsernamePassphraseStep = () => {
- sensei logo - + sensei logo +

Setup your node

-
-
-
- -
- + +
+
+ +
+ +
+
+
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+
-
-
- -
diff --git a/web-admin/src/auth/queries/getStatus.ts b/web-admin/src/auth/queries/getStatus.ts index c43d80c..72fb274 100644 --- a/web-admin/src/auth/queries/getStatus.ts +++ b/web-admin/src/auth/queries/getStatus.ts @@ -1,7 +1,7 @@ import sensei from "../../utils/sensei"; const getStatus = async () => { - return await sensei.getStatus() -} + return await sensei.getStatus(); +}; -export default getStatus \ No newline at end of file +export default getStatus; diff --git a/web-admin/src/chain/components/OnChainBalance.tsx b/web-admin/src/chain/components/OnChainBalance.tsx index 7faeba2..6f6aefc 100644 --- a/web-admin/src/chain/components/OnChainBalance.tsx +++ b/web-admin/src/chain/components/OnChainBalance.tsx @@ -12,7 +12,10 @@ const OnChainBalance = () => { return (
-
{Intl.NumberFormat().format(balanceSatoshis)} sats
+
+ {Intl.NumberFormat().format(balanceSatoshis)}{" "} + sats +
); }; diff --git a/web-admin/src/chain/components/UnusedAddress.tsx b/web-admin/src/chain/components/UnusedAddress.tsx index a5076cb..1ec563d 100644 --- a/web-admin/src/chain/components/UnusedAddress.tsx +++ b/web-admin/src/chain/components/UnusedAddress.tsx @@ -2,7 +2,7 @@ import getUnusedAddress from "../queries/getUnusedAddress"; import { useQuery } from "react-query"; import QRCode from "react-qr-code"; -const UnusedAddress = ({}) => { +const UnusedAddress = () => { const { isLoading, isError, data } = useQuery( "unused_address", getUnusedAddress @@ -16,10 +16,21 @@ const UnusedAddress = ({}) => { return (
-
- +
+ +
+
+ {address}
-
{address}
); }; diff --git a/web-admin/src/chain/mutations/signMessage.ts b/web-admin/src/chain/mutations/signMessage.ts index 16b673a..7d143f3 100644 --- a/web-admin/src/chain/mutations/signMessage.ts +++ b/web-admin/src/chain/mutations/signMessage.ts @@ -1,7 +1,7 @@ import sensei from "../../utils/sensei"; const signMessage = async (message: string) => { - return await sensei.signMessage(message) -} + return await sensei.signMessage(message); +}; -export default signMessage \ No newline at end of file +export default signMessage; diff --git a/web-admin/src/chain/pages/FundPage.tsx b/web-admin/src/chain/pages/FundPage.tsx index b938f30..b9b8832 100644 --- a/web-admin/src/chain/pages/FundPage.tsx +++ b/web-admin/src/chain/pages/FundPage.tsx @@ -4,7 +4,9 @@ const FundPage = () => { return (
-

Fund Node

+

+ Fund Node +

diff --git a/web-admin/src/chain/queries/getBalance.ts b/web-admin/src/chain/queries/getBalance.ts index 2ee47da..4de21d7 100644 --- a/web-admin/src/chain/queries/getBalance.ts +++ b/web-admin/src/chain/queries/getBalance.ts @@ -1,7 +1,7 @@ import sensei from "../../utils/sensei"; const getBalance = async () => { - return await sensei.getBalance() -} + return await sensei.getBalance(); +}; -export default getBalance \ No newline at end of file +export default getBalance; diff --git a/web-admin/src/chain/queries/getUnusedAddress.ts b/web-admin/src/chain/queries/getUnusedAddress.ts index fc950c9..2d1ea63 100644 --- a/web-admin/src/chain/queries/getUnusedAddress.ts +++ b/web-admin/src/chain/queries/getUnusedAddress.ts @@ -1,7 +1,7 @@ import sensei from "../../utils/sensei"; const getUnusedAddress = async () => { - return await sensei.getUnusedAddress() -} + return await sensei.getUnusedAddress(); +}; -export default getUnusedAddress \ No newline at end of file +export default getUnusedAddress; diff --git a/web-admin/src/channels/components/ChannelsList.tsx b/web-admin/src/channels/components/ChannelsList.tsx index d0a6ef7..40a6897 100644 --- a/web-admin/src/channels/components/ChannelsList.tsx +++ b/web-admin/src/channels/components/ChannelsList.tsx @@ -2,53 +2,16 @@ import getChannels from "../queries/getChannels"; import { useQueryClient } from "react-query"; import { EyeOffIcon, - PlusIcon, SpeakerphoneIcon, StopIcon, TrashIcon, } from "@heroicons/react/outline"; -import { Link } from "react-router-dom"; import SearchableTable from "../../components/tables/SearchableTable"; import { truncateMiddle } from "../../utils/capitalize"; import { useConfirm } from "../../contexts/confirm"; import closeChannel from "../mutations/closeChannel"; import { Channel } from "@l2-technology/sensei-client"; -const NoChannels = () => { - return ( -
- -

No channels

-

- Open a channel to start sending and receiving over lightning. -

-
- -
-
- ); -}; - const StatusColumn = ({ value, className }) => { return ( { ); }; -const SimpleColumn = ({ channel, value, className }) => { +const SimpleColumn = ({ value, className }) => { return ( { ); }; -const AmountColumn = ({ channel, value, className }) => { +const AmountColumn = ({ value, className }) => { return ( { ); }; -const VisibilityColumn = ({ channel, value, className }) => { +const VisibilityColumn = ({ value, className }) => { let Icon = value ? SpeakerphoneIcon : EyeOffIcon; let displayValue = value ? "Public" : "Private"; return ( @@ -105,7 +68,7 @@ const VisibilityColumn = ({ channel, value, className }) => { ); }; -const ActionsColumn = ({ value, channel, className }) => { +const ActionsColumn = ({ channel, className }) => { const { showConfirm } = useConfirm(); const queryClient = useQueryClient(); @@ -151,7 +114,7 @@ const ActionsColumn = ({ value, channel, className }) => { ); }; -const AliasColumn = ({ channel, value, className }) => { +const AliasColumn = ({ value, className }) => { let displayValue = value || "Unknown"; return ( { return ( - {attributes.map(({ key, label, className }) => { + {attributes.map(({ key, className }) => { let value = result[key]; let ColumnComponent = columnKeyComponentMap[key] ? columnKeyComponentMap[key] @@ -250,7 +213,7 @@ const ChannelsList = () => { const queryFunction = async ({ queryKey }) => { const [_key, { page, searchTerm, take }] = queryKey; - const {channels, pagination } = await getChannels({ + const { channels, pagination } = await getChannels({ page, searchTerm, take, @@ -258,7 +221,7 @@ const ChannelsList = () => { return { results: transformResults(channels), hasMore: pagination.hasMore, - total: pagination.total + total: pagination.total, }; }; diff --git a/web-admin/src/channels/components/OpenChannelForm.tsx b/web-admin/src/channels/components/OpenChannelForm.tsx index 00bcd02..3ac5c32 100644 --- a/web-admin/src/channels/components/OpenChannelForm.tsx +++ b/web-admin/src/channels/components/OpenChannelForm.tsx @@ -1,8 +1,7 @@ import { useNavigate } from "react-router"; -import { Form, FORM_ERROR, Input, Select } from "../../components/form"; -import * as z from "zod"; +import { Form, Input, Select } from "../../components/form"; +import { z } from "zod"; import openChannel from "../mutations/openChannel"; -import { Field } from "react-final-form"; import { useSearchParams } from "react-router-dom"; export const OpenChannelInput = z.object({ @@ -13,7 +12,7 @@ export const OpenChannelInput = z.object({ const OpenChannelForm = () => { let navigate = useNavigate(); - let [searchParams, setSearchParams] = useSearchParams(); + let [searchParams, _setSearchParams] = useSearchParams(); let initialConnectionString = searchParams.get("connection") || ""; let visibilityOptions = [ diff --git a/web-admin/src/channels/mutations/closeChannel.ts b/web-admin/src/channels/mutations/closeChannel.ts index a60a99f..46b1df2 100644 --- a/web-admin/src/channels/mutations/closeChannel.ts +++ b/web-admin/src/channels/mutations/closeChannel.ts @@ -1,7 +1,7 @@ import sensei from "../../utils/sensei"; const closeChannel = async (channelId: string, force: boolean) => { - return await sensei.closeChannel(channelId, force) -} + return await sensei.closeChannel(channelId, force); +}; -export default closeChannel \ No newline at end of file +export default closeChannel; diff --git a/web-admin/src/channels/mutations/openChannel.ts b/web-admin/src/channels/mutations/openChannel.ts index 97d690b..e1dd2bd 100644 --- a/web-admin/src/channels/mutations/openChannel.ts +++ b/web-admin/src/channels/mutations/openChannel.ts @@ -1,7 +1,11 @@ import sensei from "../../utils/sensei"; -const openChannel = async (nodeConnectionString: string, amtSatoshis: number, isPublic: boolean) => { - return await sensei.openChannel(nodeConnectionString, amtSatoshis, isPublic) -} +const openChannel = async ( + nodeConnectionString: string, + amtSatoshis: number, + isPublic: boolean +) => { + return await sensei.openChannel(nodeConnectionString, amtSatoshis, isPublic); +}; -export default openChannel \ No newline at end of file +export default openChannel; diff --git a/web-admin/src/channels/pages/ChannelsPage.tsx b/web-admin/src/channels/pages/ChannelsPage.tsx index 98496fd..a2b6cca 100644 --- a/web-admin/src/channels/pages/ChannelsPage.tsx +++ b/web-admin/src/channels/pages/ChannelsPage.tsx @@ -10,10 +10,7 @@ const ChannelsPage = () => { Channels
- + Open Channel
diff --git a/web-admin/src/channels/pages/OpenChannelPage.tsx b/web-admin/src/channels/pages/OpenChannelPage.tsx index 1cced63..2c86812 100644 --- a/web-admin/src/channels/pages/OpenChannelPage.tsx +++ b/web-admin/src/channels/pages/OpenChannelPage.tsx @@ -11,10 +11,7 @@ const OpenChannelPage = () => {
- + Cancel
diff --git a/web-admin/src/channels/queries/getChannels.ts b/web-admin/src/channels/queries/getChannels.ts index 7f1b86e..cbae4a1 100644 --- a/web-admin/src/channels/queries/getChannels.ts +++ b/web-admin/src/channels/queries/getChannels.ts @@ -1,7 +1,7 @@ import sensei from "../../utils/sensei"; -const getChannels = async ({page, searchTerm, take}) => { - return await sensei.getChannels({ page, searchTerm, take }) -} +const getChannels = async ({ page, searchTerm, take }) => { + return await sensei.getChannels({ page, searchTerm, take }); +}; -export default getChannels \ No newline at end of file +export default getChannels; diff --git a/web-admin/src/components/ErrorAlert.tsx b/web-admin/src/components/ErrorAlert.tsx index 432c293..51042c2 100644 --- a/web-admin/src/components/ErrorAlert.tsx +++ b/web-admin/src/components/ErrorAlert.tsx @@ -40,10 +40,6 @@ export const AlertMsg = ({ ); }; - - - - type ErrorAlertProps = { message: String; className: String; diff --git a/web-admin/src/components/Spinner.js b/web-admin/src/components/Spinner.js index 7b853ba..7ec0f00 100644 --- a/web-admin/src/components/Spinner.js +++ b/web-admin/src/components/Spinner.js @@ -1,11 +1,27 @@ import React from "react"; -export default function Spinner({ className }) { +export default function Spinner() { return ( - - - - + + + + ); } diff --git a/web-admin/src/components/form/CheckboxSwitch.tsx b/web-admin/src/components/form/CheckboxSwitch.tsx index d9e4e35..746a89f 100644 --- a/web-admin/src/components/form/CheckboxSwitch.tsx +++ b/web-admin/src/components/form/CheckboxSwitch.tsx @@ -1,15 +1,13 @@ import { Switch } from "@headlessui/react"; -import { useState } from "react"; -import { useField } from "react-final-form"; function classNames(...classes) { return classes.filter(Boolean).join(" "); } -const CheckboxSwitch = ({ input: { onChange, value }, ...rest }) => { +const CheckboxSwitch = ({ input: { onChange, value } }) => { const isChecked = value as boolean; - const handleToggle = (e) => { + const handleToggle = () => { onChange(!isChecked); }; diff --git a/web-admin/src/components/form/Form.tsx b/web-admin/src/components/form/Form.tsx index c0269b7..3b44a38 100644 --- a/web-admin/src/components/form/Form.tsx +++ b/web-admin/src/components/form/Form.tsx @@ -10,7 +10,7 @@ import { Form as FinalForm, FormProps as FinalFormProps, } from "react-final-form"; -import * as z from "zod"; +import { z } from "zod"; import ErrorAlert from "../ErrorAlert"; import FooterSubmitButton from "./FooterSubmitButton"; import SubmitButton from "./SubmitButton"; diff --git a/web-admin/src/components/form/Input.tsx b/web-admin/src/components/form/Input.tsx index 231aae6..3830518 100644 --- a/web-admin/src/components/form/Input.tsx +++ b/web-admin/src/components/form/Input.tsx @@ -57,7 +57,7 @@ export const Input = React.forwardRef( const { input, - meta: { touched, dirty, error, submitFailed, submitError, submitting }, + meta: { touched, error, submitting }, } = useField(name, config); // const hasError = (dirty || submitFailed) && (error || submitError) diff --git a/web-admin/src/components/form/TextArea.tsx b/web-admin/src/components/form/TextArea.tsx index b61c791..5eac30a 100644 --- a/web-admin/src/components/form/TextArea.tsx +++ b/web-admin/src/components/form/TextArea.tsx @@ -28,7 +28,7 @@ export const TextArea = React.forwardRef( ({ name, label, extraClass, outerProps, className, ...props }, ref) => { const { input, - meta: { touched, dirty, error, submitFailed, submitError, submitting }, + meta: { dirty, error, submitFailed, submitError, submitting }, } = useField(name); const hasError = (dirty || submitFailed) && (error || submitError); @@ -51,7 +51,7 @@ export const TextArea = React.forwardRef( className={`form-input block border rounded-xl w-full bg-plum text-light-plum transition duration-150 ease-in-out sm:text-sm sm:leading-5 flex-1 ${ hasError ? "border-red-500 focus:border-red-500 focus:ring-red-500" - : "border-gray-plum-100 focus:border-orange focus:border-orange focus:ring-orange" + : "border-gray-plum-100 focus:border-orange focus:ring-orange" } ${extraClass}`} >
diff --git a/web-admin/src/components/icons/Sensei.tsx b/web-admin/src/components/icons/Sensei.tsx index 45ec1a1..de2f377 100644 --- a/web-admin/src/components/icons/Sensei.tsx +++ b/web-admin/src/components/icons/Sensei.tsx @@ -1,11 +1,28 @@ const SenseiLogo = (props) => { - return ( - - - - - - - ) -} -export default SenseiLogo \ No newline at end of file + return ( + + + + + + ); +}; +export default SenseiLogo; diff --git a/web-admin/src/components/layout/app/Dropdown.tsx b/web-admin/src/components/layout/app/Dropdown.tsx index 98042c1..032b1c4 100644 --- a/web-admin/src/components/layout/app/Dropdown.tsx +++ b/web-admin/src/components/layout/app/Dropdown.tsx @@ -33,7 +33,7 @@ export default function Dropdown({ > {button} - - - {items.map((item, i) => ( - - {item.path ? ( - - {item.icon} - {item.label} - - ) : ( - - )} - - ))} - {children} - + + {items.map((item, _i) => ( + + {item.path ? ( + + {item.icon} + {item.label} + + ) : ( + + )} + + ))} + {children} +
diff --git a/web-admin/src/components/layout/app/Logo.tsx b/web-admin/src/components/layout/app/Logo.tsx index a22d2a3..94dadf2 100644 --- a/web-admin/src/components/layout/app/Logo.tsx +++ b/web-admin/src/components/layout/app/Logo.tsx @@ -1,6 +1,6 @@ import React from "react"; -const Logo = ({ color }) => { +const Logo = () => { return (
ServerlessHQ diff --git a/web-admin/src/components/layout/app/PageTitle.tsx b/web-admin/src/components/layout/app/PageTitle.tsx index cb468ca..9f54c37 100644 --- a/web-admin/src/components/layout/app/PageTitle.tsx +++ b/web-admin/src/components/layout/app/PageTitle.tsx @@ -11,7 +11,7 @@ const PageTitle = ({ title, breadcrumbs, buttons }) => { {backButton && ( )} @@ -37,9 +37,9 @@ const PageTitle = ({ title, breadcrumbs, buttons }) => { return ( - + {includeSeparator && ( { return (
@@ -18,18 +17,18 @@ export const SearchBar = ({ query = "", setQuery, placeholder, title }) => { } flex w-full items-center space-x-1 rounded-xl border border-transparent bg-plum-200 px-2 focus-within:border-orange focus-within:text-orange md:space-x-2 md:px-5`} > - + - { - setQuery(e.target.value); - }} - placeholder={placeholder} - /> -
+ { + setQuery(e.target.value); + }} + placeholder={placeholder} + /> +
); }; @@ -37,7 +36,7 @@ export const SearchBar = ({ query = "", setQuery, placeholder, title }) => { export const SimpleRow = ({ result, extraClass, attributes }) => { return ( - {attributes.map(({ key, label, className }) => { + {attributes.map(({ key, className }) => { let value = result[key]; if (typeof value === "object") { value = format(value, "MM/dd/YYY"); @@ -66,7 +65,7 @@ export const ResultRow = ({ const linkClass = result.link ? "cursor-pointer hover:bg-plum-50" : ""; if (result.link) { - +
@@ -170,10 +169,7 @@ export const TableNavigation = ({

-