From 4d2b99d62137852693a50062d01a27f825b40f9d Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Thu, 6 Apr 2023 12:42:15 -0500 Subject: [PATCH] add copy and share --- package.json | 9 +- pnpm-lock.yaml | 244 ++++++++++++++++++++-------------- src/components/BalanceBox.tsx | 3 +- src/components/Button.tsx | 2 +- src/components/SafeArea.tsx | 4 +- src/routes/Receive.tsx | 43 +++++- src/routes/Settings.tsx | 13 ++ src/routes/index.tsx | 1 - src/utils/useCopy.ts | 21 +++ 9 files changed, 225 insertions(+), 115 deletions(-) create mode 100644 src/utils/useCopy.ts diff --git a/package.json b/package.json index d979d11..e462295 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "esbuild": "^0.14.54", "eslint": "^8.37.0", "postcss": "^8.4.21", - "solid-start-node": "^0.2.24", + "solid-start-node": "^0.2.26", "tailwindcss": "^3.3.1", "typescript": "^4.9.5", "vite": "^4.2.1", @@ -30,10 +30,11 @@ "@solidjs/meta": "^0.28.4", "@solidjs/router": "^0.8.2", "class-variance-authority": "^0.4.0", - "nostr-tools": "^1.8.1", + "nostr-tools": "^1.8.2", "qr-scanner": "^1.4.2", - "solid-js": "^1.7.1", - "solid-start": "^0.2.24", + "solid-js": "^1.7.2", + "solid-qr-code": "^0.0.8", + "solid-start": "^0.2.26", "undici": "^5.21.0" }, "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f1678ee..2b972ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,7 +3,7 @@ lockfileVersion: '6.0' dependencies: '@motionone/solid': specifier: ^10.16.0 - version: 10.16.0(solid-js@1.7.1) + version: 10.16.0(solid-js@1.7.2) '@mutinywallet/node-manager': specifier: ^0.2.2 version: 0.2.2 @@ -12,25 +12,28 @@ dependencies: version: 0.0.13(typescript@4.9.5) '@solidjs/meta': specifier: ^0.28.4 - version: 0.28.4(solid-js@1.7.1) + version: 0.28.4(solid-js@1.7.2) '@solidjs/router': specifier: ^0.8.2 - version: 0.8.2(solid-js@1.7.1) + version: 0.8.2(solid-js@1.7.2) class-variance-authority: specifier: ^0.4.0 version: 0.4.0(typescript@4.9.5) nostr-tools: - specifier: ^1.8.1 - version: 1.8.1 + specifier: ^1.8.2 + version: 1.8.2 qr-scanner: specifier: ^1.4.2 version: 1.4.2 solid-js: - specifier: ^1.7.1 - version: 1.7.1 + specifier: ^1.7.2 + version: 1.7.2 + solid-qr-code: + specifier: ^0.0.8 + version: 0.0.8(qr.js@0.0.0)(solid-js@1.7.2) solid-start: - specifier: ^0.2.24 - version: 0.2.24(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.1)(solid-start-node@0.2.24)(vite@4.2.1) + specifier: ^0.2.26 + version: 0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.2)(solid-start-node@0.2.26)(vite@4.2.1) undici: specifier: ^5.21.0 version: 5.21.0 @@ -58,8 +61,8 @@ devDependencies: specifier: ^8.4.21 version: 8.4.21 solid-start-node: - specifier: ^0.2.24 - version: 0.2.24(solid-start@0.2.24)(undici@5.21.0)(vite@4.2.1) + specifier: ^0.2.26 + version: 0.2.26(solid-start@0.2.26)(undici@5.21.0)(vite@4.2.1) tailwindcss: specifier: ^3.3.1 version: 3.3.1(postcss@8.4.21) @@ -208,7 +211,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 debug: 4.3.4 lodash.debounce: 4.0.8 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 transitivePeerDependencies: - supports-color @@ -1286,6 +1289,7 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-loong64@0.17.15: @@ -1515,17 +1519,17 @@ packages: tslib: 2.5.0 dev: false - /@motionone/solid@10.16.0(solid-js@1.7.1): + /@motionone/solid@10.16.0(solid-js@1.7.2): resolution: {integrity: sha512-pxE5qQEtwv42bAllHFVapZevX5T4YTYzFe7vo0+Lljqyx+7+jP1NT0fosBUAOhDNdJNANNMldXwyh+qGBW5BrA==} peerDependencies: solid-js: ^1.5.0 dependencies: '@motionone/dom': 10.15.5 '@motionone/utils': 10.15.1 - '@solid-primitives/props': 3.1.4(solid-js@1.7.1) - '@solid-primitives/refs': 1.0.2(solid-js@1.7.1) - '@solid-primitives/transition-group': 1.0.1(solid-js@1.7.1) - solid-js: 1.7.1 + '@solid-primitives/props': 3.1.4(solid-js@1.7.2) + '@solid-primitives/refs': 1.0.2(solid-js@1.7.2) + '@solid-primitives/transition-group': 1.0.1(solid-js@1.7.2) + solid-js: 1.7.2 dev: false /@motionone/types@10.15.1: @@ -1593,7 +1597,7 @@ packages: eventemitter3: 5.0.0 light-bolt11-decoder: 3.0.0 node-fetch: 3.3.1 - nostr-tools: 1.8.1 + nostr-tools: 1.8.2 utf8-buffer: 1.0.0 websocket-polyfill: 0.0.3 transitivePeerDependencies: @@ -1663,22 +1667,25 @@ packages: builtin-modules: 3.3.0 deepmerge: 4.3.1 is-module: 1.0.0 - resolve: 1.22.1 + resolve: 1.22.2 rollup: 2.79.1 dev: true - /@rollup/plugin-node-resolve@13.3.0(rollup@3.20.2): - resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} - engines: {node: '>= 10.0.0'} + /@rollup/plugin-node-resolve@15.0.2(rollup@3.20.2): + resolution: {integrity: sha512-Y35fRGUjC3FaurG722uhUuG8YHOJRJQbI6/CkbRkdPotSpDj9NtIN85z1zrcyDcCQIW4qp5mgG72U+gJ0TAFEg==} + engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^2.42.0 + rollup: ^2.78.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true dependencies: - '@rollup/pluginutils': 3.1.0(rollup@3.20.2) - '@types/resolve': 1.17.1 + '@rollup/pluginutils': 5.0.2(rollup@3.20.2) + '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-builtin-module: 3.2.1 is-module: 1.0.0 - resolve: 1.22.1 + resolve: 1.22.2 rollup: 3.20.2 /@rollup/plugin-replace@2.4.2(rollup@2.79.1): @@ -1717,17 +1724,6 @@ packages: rollup: 2.79.1 dev: true - /@rollup/pluginutils@3.1.0(rollup@3.20.2): - resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} - engines: {node: '>= 8.0.0'} - peerDependencies: - rollup: ^1.20.0||^2.0.0 - dependencies: - '@types/estree': 0.0.39 - estree-walker: 1.0.1 - picomatch: 2.3.1 - rollup: 3.20.2 - /@rollup/pluginutils@5.0.2(rollup@3.20.2): resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} engines: {node: '>=14.0.0'} @@ -1772,53 +1768,53 @@ packages: /@sideway/pinpoint@2.0.0: resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} - /@solid-primitives/props@3.1.4(solid-js@1.7.1): + /@solid-primitives/props@3.1.4(solid-js@1.7.2): resolution: {integrity: sha512-RiwOZXbqb3RMmkznyfI63gwAB/iVHPk8AWN55oIEBRkjzgpuqRXIzdbsSQVy23jMbkRs91tRtzxQ/g6eoWLnuQ==} peerDependencies: solid-js: ^1.6.12 dependencies: - '@solid-primitives/utils': 6.0.0(solid-js@1.7.1) - solid-js: 1.7.1 + '@solid-primitives/utils': 6.0.0(solid-js@1.7.2) + solid-js: 1.7.2 dev: false - /@solid-primitives/refs@1.0.2(solid-js@1.7.1): + /@solid-primitives/refs@1.0.2(solid-js@1.7.2): resolution: {integrity: sha512-qnqQRdYbsENlVx86QCfftRKGZ/9zUJMGK9U85xDRymocEyeUXxdxgq0FeyGhvgg4A25spJVwHmuZUGY0aMBBLA==} peerDependencies: solid-js: ^1.6.12 dependencies: - '@solid-primitives/utils': 6.0.0(solid-js@1.7.1) - solid-js: 1.7.1 + '@solid-primitives/utils': 6.0.0(solid-js@1.7.2) + solid-js: 1.7.2 dev: false - /@solid-primitives/transition-group@1.0.1(solid-js@1.7.1): + /@solid-primitives/transition-group@1.0.1(solid-js@1.7.2): resolution: {integrity: sha512-StVQs7BVGQa1uo6dD19wqOgfGMxu3gL/bvPHUV/NBJaiNX5R5e7dPb6lz6zR1RdTho3M+3Mv8jUHKd/aKuhL4w==} peerDependencies: solid-js: ^1.6.12 dependencies: - solid-js: 1.7.1 + solid-js: 1.7.2 dev: false - /@solid-primitives/utils@6.0.0(solid-js@1.7.1): + /@solid-primitives/utils@6.0.0(solid-js@1.7.2): resolution: {integrity: sha512-SSu12+vvU6J8SVWW9eGV+dqiMsc0WG1Oy8YYY9AWzRzssmzNXg/uexaW+0eqTuj8JcRAaGplMDjhraB01HOidA==} peerDependencies: solid-js: ^1.6.12 dependencies: - solid-js: 1.7.1 + solid-js: 1.7.2 dev: false - /@solidjs/meta@0.28.4(solid-js@1.7.1): + /@solidjs/meta@0.28.4(solid-js@1.7.2): resolution: {integrity: sha512-1USElsQuGVcJnmZ6CxPfUVmKvCsVdBQoGrUyMxLtFw36Ytt90dPs/qLyXLvPR/ZPD16/qauWqg6APEkbrDOLcA==} peerDependencies: solid-js: '>=1.4.0' dependencies: - solid-js: 1.7.1 + solid-js: 1.7.2 - /@solidjs/router@0.8.2(solid-js@1.7.1): + /@solidjs/router@0.8.2(solid-js@1.7.2): resolution: {integrity: sha512-gUKW+LZqxtX6y/Aw6JKyy4gQ9E7dLqp513oB9pSYJR1HM5c56Pf7eijzyXX+b3WuXig18Cxqah4tMtF0YGu80w==} peerDependencies: solid-js: ^1.5.3 dependencies: - solid-js: 1.7.1 + solid-js: 1.7.2 /@surma/rollup-plugin-off-main-thread@2.2.3: resolution: {integrity: sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ==} @@ -1859,6 +1855,7 @@ packages: /@types/estree@0.0.39: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} + dev: true /@types/estree@1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} @@ -1881,6 +1878,10 @@ packages: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: '@types/node': 18.15.11 + dev: true + + /@types/resolve@1.20.2: + resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} /@types/semver@7.3.13: resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} @@ -2139,7 +2140,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.21.5 - caniuse-lite: 1.0.30001473 + caniuse-lite: 1.0.30001474 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -2158,8 +2159,8 @@ packages: transitivePeerDependencies: - debug - /babel-plugin-jsx-dom-expressions@0.36.6(@babel/core@7.21.4): - resolution: {integrity: sha512-O7R0wl6uROhswAcg12sq/HuMQZIhXgjSgkQB83lu5hQWxVMcxZSX0avYXR0PGZxcK6zX6ke7Du1d6rwy+BssWg==} + /babel-plugin-jsx-dom-expressions@0.36.8(@babel/core@7.21.4): + resolution: {integrity: sha512-hWG9WOa0gAxD1CKtzBxXMZoDMfn0Fxv8pYrl4y8znOpaS0vLuyNsclLH/w4hv+VBpv1yt9Rn4Gm/ImLBcqUfKA==} peerDependencies: '@babel/core': ^7.20.12 dependencies: @@ -2203,13 +2204,13 @@ packages: transitivePeerDependencies: - supports-color - /babel-preset-solid@1.7.1(@babel/core@7.21.4): - resolution: {integrity: sha512-a4TSLrEKIscsTIEBVo9fuWSdBQjEBrkQmNzIvXd26MO1Zyqdts+VEMy2k/OhfH0/L9ZY0ELLrTcij1IMDxVldQ==} + /babel-preset-solid@1.7.2(@babel/core@7.21.4): + resolution: {integrity: sha512-2SVcLTk6RXgXv3ebbm4iKiAPTPhQ/+3zd1KUOnMq/qBMr9ZshzdtIS4dMr9orWPHwDTdvJ2ZAadyGf3ZfTwWjg==} peerDependencies: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.21.4 - babel-plugin-jsx-dom-expressions: 0.36.6(@babel/core@7.21.4) + babel-plugin-jsx-dom-expressions: 0.36.8(@babel/core@7.21.4) /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -2240,8 +2241,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001473 - electron-to-chromium: 1.4.349 + caniuse-lite: 1.0.30001474 + electron-to-chromium: 1.4.353 node-releases: 2.0.10 update-browserslist-db: 1.0.10(browserslist@4.21.5) @@ -2285,8 +2286,8 @@ packages: engines: {node: '>= 6'} dev: true - /caniuse-lite@1.0.30001473: - resolution: {integrity: sha512-ewDad7+D2vlyy+E4UJuVfiBsU69IL+8oVmTuZnH5Q6CIUbxNfI50uVpRHbUPDD6SUaN2o0Lh4DhTrvLG/Tn1yg==} + /caniuse-lite@1.0.30001474: + resolution: {integrity: sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q==} /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} @@ -2541,8 +2542,8 @@ packages: jake: 10.8.5 dev: true - /electron-to-chromium@1.4.349: - resolution: {integrity: sha512-34LBfVDiL6byWorSmQOPwq4gD5wpN8Mhh5yPGQr67FbcxsfUS0BDJP9y6RykSgeWVUfSkN/2dChywnsrmKVyUg==} + /electron-to-chromium@1.4.353: + resolution: {integrity: sha512-IdJVpMHJoBT/nn0GQ02wPfbhogDVpd1ud95lP//FTf5l35wzxKJwibB4HBdY7Q+xKPA1nkZ0UDLOMyRj5U5IAQ==} /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -2646,6 +2647,7 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: true optional: true /esbuild-android-arm64@0.14.54: @@ -2654,6 +2656,7 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: true optional: true /esbuild-darwin-64@0.14.54: @@ -2662,6 +2665,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true optional: true /esbuild-darwin-arm64@0.14.54: @@ -2670,6 +2674,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true optional: true /esbuild-freebsd-64@0.14.54: @@ -2678,6 +2683,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: true optional: true /esbuild-freebsd-arm64@0.14.54: @@ -2686,6 +2692,7 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: true optional: true /esbuild-linux-32@0.14.54: @@ -2694,6 +2701,7 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: true optional: true /esbuild-linux-64@0.14.54: @@ -2702,6 +2710,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true /esbuild-linux-arm64@0.14.54: @@ -2710,6 +2719,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true /esbuild-linux-arm@0.14.54: @@ -2718,6 +2728,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: true optional: true /esbuild-linux-mips64le@0.14.54: @@ -2726,6 +2737,7 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: true optional: true /esbuild-linux-ppc64le@0.14.54: @@ -2734,6 +2746,7 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: true optional: true /esbuild-linux-riscv64@0.14.54: @@ -2742,6 +2755,7 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: true optional: true /esbuild-linux-s390x@0.14.54: @@ -2750,6 +2764,7 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: true optional: true /esbuild-netbsd-64@0.14.54: @@ -2758,6 +2773,7 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: true optional: true /esbuild-openbsd-64@0.14.54: @@ -2766,19 +2782,20 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: true optional: true - /esbuild-plugin-solid@0.4.2(esbuild@0.14.54)(solid-js@1.7.1): - resolution: {integrity: sha512-T5GphLoud3RumjeNYO3K9WVjWDzVKG5evlS7hUEUI0n9tiCL+CnbvJh3SSwFi3xeeXpZRrnZc1gd6FWQsVobTg==} + /esbuild-plugin-solid@0.5.0(esbuild@0.17.15)(solid-js@1.7.2): + resolution: {integrity: sha512-ITK6n+0ayGFeDVUZWNMxX+vLsasEN1ILrg4pISsNOQ+mq4ljlJJiuXotInd+HE0MzwTcA9wExT1yzDE2hsqPsg==} peerDependencies: esbuild: '>=0.12' solid-js: '>= 1.0' dependencies: '@babel/core': 7.21.4 '@babel/preset-typescript': 7.21.4(@babel/core@7.21.4) - babel-preset-solid: 1.7.1(@babel/core@7.21.4) - esbuild: 0.14.54 - solid-js: 1.7.1 + babel-preset-solid: 1.7.2(@babel/core@7.21.4) + esbuild: 0.17.15 + solid-js: 1.7.2 transitivePeerDependencies: - supports-color @@ -2788,6 +2805,7 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: true optional: true /esbuild-windows-32@0.14.54: @@ -2796,6 +2814,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: true optional: true /esbuild-windows-64@0.14.54: @@ -2804,6 +2823,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true optional: true /esbuild-windows-arm64@0.14.54: @@ -2812,6 +2832,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: true optional: true /esbuild@0.14.54: @@ -2841,6 +2862,7 @@ packages: esbuild-windows-32: 0.14.54 esbuild-windows-64: 0.14.54 esbuild-windows-arm64: 0.14.54 + dev: true /esbuild@0.17.15: resolution: {integrity: sha512-LBUV2VsUIc/iD9ME75qhT4aJj0r75abCVS0jakhFzOtR7TQsqQA5w0tZ+KTKnwl3kXE0MhskNdHDh/I5aCR1Zw==} @@ -2900,7 +2922,7 @@ packages: dependencies: debug: 3.2.7 is-core-module: 2.11.0 - resolve: 1.22.1 + resolve: 1.22.2 transitivePeerDependencies: - supports-color dev: false @@ -2958,7 +2980,7 @@ packages: is-glob: 4.0.3 minimatch: 3.1.2 object.values: 1.1.6 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 tsconfig-paths: 3.14.2 transitivePeerDependencies: @@ -3063,6 +3085,7 @@ packages: /estree-walker@1.0.1: resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} + dev: true /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -3870,8 +3893,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /nostr-tools@1.8.1: - resolution: {integrity: sha512-/2IUe5xINUYT5hYBoEz51dfRaodbRHnyF8n+ZbKWCoh0ZRX6AL88OoDNrWaWWo7tP5j5OyzSL9g/z4TP7bshEA==} + /nostr-tools@1.8.2: + resolution: {integrity: sha512-r9erqxO96E2BqvOvR/5W0usY7GlcO9fVLKc1Q8b/LCBgISVaMWD2VFmjdSUcHSGPMWHLvB6k4Jui+FTi5KAprw==} dependencies: '@noble/hashes': 1.0.0 '@noble/secp256k1': 1.7.1 @@ -4027,7 +4050,7 @@ packages: postcss: 8.4.21 postcss-value-parser: 4.2.0 read-cache: 1.0.0 - resolve: 1.22.1 + resolve: 1.22.2 dev: true /postcss-js@4.0.1(postcss@8.4.21): @@ -4117,6 +4140,10 @@ packages: '@types/offscreencanvas': 2019.7.0 dev: false + /qr.js@0.0.0: + resolution: {integrity: sha512-c4iYnWb+k2E+vYpRimHqSu575b1/wKl4XFeJGpFmrJQz5I88v9aY2czh7s0w36srfCM1sXgC/xpoJz5dJfq+OQ==} + dev: false + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -4202,8 +4229,8 @@ packages: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} - /resolve@1.22.1: - resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} + /resolve@1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} hasBin: true dependencies: is-core-module: 2.11.0 @@ -4360,13 +4387,24 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - /solid-js@1.7.1: - resolution: {integrity: sha512-G7wPaRsxY+Mr6GTVSHIqrpHoJNM5YHX6V/X03mPo9RmsuVZU6ZA2O+jVJty6mOyGME24WR30E55L0IQsxxO/vg==} + /solid-js@1.7.2: + resolution: {integrity: sha512-01f8GIc+HTTlfDXtK+TFku3AllHyJ3hNsIpxM2qpObRP4VbEGVIP6VbULnThPlpse+J1y/I/1N9QeQ9MNkE8Ow==} dependencies: csstype: 3.1.2 seroval: 0.5.1 - /solid-refresh@0.5.2(solid-js@1.7.1): + /solid-qr-code@0.0.8(qr.js@0.0.0)(solid-js@1.7.2): + resolution: {integrity: sha512-K7LC3IKvyRag6WW7/ijJl32pBmoC3EzZ7AuydyaAVKSmlwukJmqvrFkrxaA1bOWabYJhzP9qwLbjDVlCUP2BwQ==} + engines: {node: '>=10', yarn: '>=1.22.5'} + peerDependencies: + qr.js: ^0.0.0 + solid-js: ^1.4.8 + dependencies: + qr.js: 0.0.0 + solid-js: 1.7.2 + dev: false + + /solid-refresh@0.5.2(solid-js@1.7.2): resolution: {integrity: sha512-I69HmFj0LsGRJ3n8CEMVjyQFgVtuM2bSjznu2hCnsY+i5oOxh8ioWj00nnHBv0UYD3WpE/Sq4Q3TNw2IKmKN7A==} peerDependencies: solid-js: ^1.3 @@ -4374,10 +4412,10 @@ packages: '@babel/generator': 7.21.4 '@babel/helper-module-imports': 7.21.4 '@babel/types': 7.21.4 - solid-js: 1.7.1 + solid-js: 1.7.2 - /solid-start-node@0.2.24(solid-start@0.2.24)(undici@5.21.0)(vite@4.2.1): - resolution: {integrity: sha512-7IqgPbuOLNlSEsbuvx3/4Zeihk2oqHR3qNMAhaKeSwqksrmtXyrzM694f3Y26IqqVcQQhLBbQjM45NwPWK4iAw==} + /solid-start-node@0.2.26(solid-start@0.2.26)(undici@5.21.0)(vite@4.2.1): + resolution: {integrity: sha512-8vciTGoQV+lIlCUSVHJPazlaoKDRfBowDkPeBr/EZdmtbcMOKoJYf/APPQWFspylF+nhzunMf0+zJP90VtMEYg==} peerDependencies: solid-start: '*' undici: ^5.8.0 @@ -4385,20 +4423,20 @@ packages: dependencies: '@rollup/plugin-commonjs': 24.0.1(rollup@3.20.2) '@rollup/plugin-json': 6.0.0(rollup@3.20.2) - '@rollup/plugin-node-resolve': 13.3.0(rollup@3.20.2) + '@rollup/plugin-node-resolve': 15.0.2(rollup@3.20.2) compression: 1.7.4 polka: 1.0.0-next.22 rollup: 3.20.2 sirv: 2.0.2 - solid-start: 0.2.24(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.1)(solid-start-node@0.2.24)(vite@4.2.1) + solid-start: 0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.2)(solid-start-node@0.2.26)(vite@4.2.1) terser: 5.16.8 undici: 5.21.0 vite: 4.2.1(@types/node@18.15.11) transitivePeerDependencies: - supports-color - /solid-start@0.2.24(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.1)(solid-start-node@0.2.24)(vite@4.2.1): - resolution: {integrity: sha512-7nbl4mRiWwts7KN4ep1vT4eRcjacB6StdP/JalaCWtovpX0EctcEwXpJQeHKkGCL+J0n3M+aph0qkzUyJ5tD6Q==} + /solid-start@0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.2)(solid-start-node@0.2.26)(vite@4.2.1): + resolution: {integrity: sha512-kne2HZlnSMzsirdnvNs1CsDqBl0L0uvKKt1t4de1CH7JIngyqoMcER97jTE0Ejr84KknANaKAdvJAzZcL7Ueng==} hasBin: true peerDependencies: '@solidjs/meta': ^0.28.0 @@ -4437,8 +4475,8 @@ packages: '@babel/preset-env': 7.21.4(@babel/core@7.21.4) '@babel/preset-typescript': 7.21.4(@babel/core@7.21.4) '@babel/template': 7.20.7 - '@solidjs/meta': 0.28.4(solid-js@1.7.1) - '@solidjs/router': 0.8.2(solid-js@1.7.1) + '@solidjs/meta': 0.28.4(solid-js@1.7.2) + '@solidjs/router': 0.8.2(solid-js@1.7.2) '@types/cookie': 0.5.1 chokidar: 3.5.3 compression: 1.7.4 @@ -4447,8 +4485,8 @@ packages: dequal: 2.0.3 dotenv: 16.0.3 es-module-lexer: 1.2.1 - esbuild: 0.14.54 - esbuild-plugin-solid: 0.4.2(esbuild@0.14.54)(solid-js@1.7.1) + esbuild: 0.17.15 + esbuild-plugin-solid: 0.5.0(esbuild@0.17.15)(solid-js@1.7.2) fast-glob: 3.2.12 get-port: 6.1.2 parse-multipart-data: 1.5.0 @@ -4459,13 +4497,13 @@ packages: sade: 1.8.1 set-cookie-parser: 2.6.0 sirv: 2.0.2 - solid-js: 1.7.1 - solid-start-node: 0.2.24(solid-start@0.2.24)(undici@5.21.0)(vite@4.2.1) + solid-js: 1.7.2 + solid-start-node: 0.2.26(solid-start@0.2.26)(undici@5.21.0)(vite@4.2.1) terser: 5.16.8 undici: 5.21.0 vite: 4.2.1(@types/node@18.15.11) - vite-plugin-inspect: 0.7.18(rollup@3.20.2)(vite@4.2.1) - vite-plugin-solid: 2.6.1(solid-js@1.7.1)(vite@4.2.1) + vite-plugin-inspect: 0.7.19(rollup@3.20.2)(vite@4.2.1) + vite-plugin-solid: 2.7.0(solid-js@1.7.2)(vite@4.2.1) wait-on: 6.0.1(debug@4.3.4) transitivePeerDependencies: - supports-color @@ -4638,7 +4676,7 @@ packages: postcss-selector-parser: 6.0.11 postcss-value-parser: 4.2.0 quick-lru: 5.1.1 - resolve: 1.22.1 + resolve: 1.22.2 sucrase: 3.31.0 transitivePeerDependencies: - ts-node @@ -4883,8 +4921,8 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - /vite-plugin-inspect@0.7.18(rollup@3.20.2)(vite@4.2.1): - resolution: {integrity: sha512-hyIxg2qJaRs0LoB3Tqy9ML8yEublIzTzFVXmNhgw2jsjETJUXeR6iQ4YPHk3Q6kTbbiwgoPPyXimlAfEwektnA==} + /vite-plugin-inspect@0.7.19(rollup@3.20.2)(vite@4.2.1): + resolution: {integrity: sha512-OdKObJGdzOMR7SuqykN/Rb6rVtMK1wp4EmUTM3xhTCuSR1K/oM7fi4CKeBWhpYSkqop7O4gVB/MOUk7+RO7gIQ==} engines: {node: '>=14'} peerDependencies: vite: ^3.1.0 || ^4.0.0 @@ -4920,19 +4958,19 @@ packages: - supports-color dev: true - /vite-plugin-solid@2.6.1(solid-js@1.7.1)(vite@4.2.1): - resolution: {integrity: sha512-/khM/ha3B5/pTWQWVJd/0n6ODPIrOcajwhbrD8Gnv37XmJJssu+KA8ssN73raMIicf2eiQKiTAV39w7dSl4Irg==} + /vite-plugin-solid@2.7.0(solid-js@1.7.2)(vite@4.2.1): + resolution: {integrity: sha512-avp/Jl5zOp/Itfo67xtDB2O61U7idviaIp4mLsjhCa13PjKNasz+IID0jYTyqUp9SFx6/PmBr6v4KgDppqompg==} peerDependencies: - solid-js: ^1.3.17 || ^1.4.0 || ^1.5.0 || ^1.6.0 + solid-js: ^1.7.2 vite: ^3.0.0 || ^4.0.0 dependencies: '@babel/core': 7.21.4 '@babel/preset-typescript': 7.21.4(@babel/core@7.21.4) '@types/babel__core': 7.20.0 - babel-preset-solid: 1.7.1(@babel/core@7.21.4) + babel-preset-solid: 1.7.2(@babel/core@7.21.4) merge-anything: 5.1.4 - solid-js: 1.7.1 - solid-refresh: 0.5.2(solid-js@1.7.1) + solid-js: 1.7.2 + solid-refresh: 0.5.2(solid-js@1.7.2) vite: 4.2.1(@types/node@18.15.11) vitefu: 0.2.4(vite@4.2.1) transitivePeerDependencies: @@ -4974,7 +5012,7 @@ packages: '@types/node': 18.15.11 esbuild: 0.17.15 postcss: 8.4.21 - resolve: 1.22.1 + resolve: 1.22.2 rollup: 3.20.2 optionalDependencies: fsevents: 2.3.2 diff --git a/src/components/BalanceBox.tsx b/src/components/BalanceBox.tsx index 1f70eae..f087d2e 100644 --- a/src/components/BalanceBox.tsx +++ b/src/components/BalanceBox.tsx @@ -9,7 +9,7 @@ function prettyPrintAmount(n?: number | bigint): string { if (!n || n.valueOf() === 0) { return "0" } - return n.toLocaleString().replaceAll(",", "_") + return n.toLocaleString() } function prettyPrintBalance(b: MutinyBalance): string { @@ -21,6 +21,7 @@ export default function BalanceBox() { const fetchBalance = async () => { console.log("Refetching balance"); + await nodeManager()?.sync(); const balance = await nodeManager()?.get_balance(); return balance }; diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 009e563..515e384 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -60,7 +60,7 @@ export const ButtonLink: ParentComponent = props => { href={local.href} {...attrs} class={button({ - class: local.class || "", + class: `flex justify-center no-underline ${local.class || ""}`, intent: local.intent, layout: local.layout, })} diff --git a/src/components/SafeArea.tsx b/src/components/SafeArea.tsx index 0b24a9a..af411b2 100644 --- a/src/components/SafeArea.tsx +++ b/src/components/SafeArea.tsx @@ -1,4 +1,6 @@ -export default function SafeArea(props) { +import { JSX } from "solid-js"; + +export default function SafeArea(props: { children: JSX.Element }) { return (
diff --git a/src/routes/Receive.tsx b/src/routes/Receive.tsx index 23387db..81f9140 100644 --- a/src/routes/Receive.tsx +++ b/src/routes/Receive.tsx @@ -1,8 +1,10 @@ import { createResource, Show } from "solid-js"; +import { QRCodeSVG } from "solid-qr-code"; import { Button } from "~/components/Button"; import NavBar from "~/components/NavBar"; import SafeArea from "~/components/SafeArea"; import { useNodeManager } from "~/state/nodeManagerState"; +import { useCopy } from "~/utils/useCopy"; export default function Receive() { const { nodeManager } = useNodeManager(); @@ -16,16 +18,49 @@ export default function Receive() { const [address, { refetch: refetchAddress }] = createResource(nodeManager, getNewAddress); + const [copy, copied] = useCopy({ copiedTimeout: 1000 }); + + async function share() { + // If the browser doesn't support share we can just copy the address + if (!navigator.share) { + copy(address() ?? ""); + copied(); + + } + let shareData: ShareData = { + title: "Mutiny Wallet", + text: address(), + } + + try { + await navigator.share(shareData) + } catch (e) { + console.error(e) + } + } + return ( -
+
-

{address()}

- +
+ +
+
+ + +
+
+
+ Address / Invoice +
+ {address()} + +
- + ) } \ No newline at end of file diff --git a/src/routes/Settings.tsx b/src/routes/Settings.tsx index 1a30016..5828dc0 100644 --- a/src/routes/Settings.tsx +++ b/src/routes/Settings.tsx @@ -15,11 +15,24 @@ export default function Settings() { window.location.reload(); } + function resetNode() { + Object.keys(localStorage).forEach(function (key) { + if (key.startsWith('waitlist_id')) { + // Don't do anything because it's annoying to set my waitlist_id every time + } else { + localStorage.removeItem(key); + } + }); + // reload the window + window.location.reload(); + } + return (
+
diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 9f9b441..93170e8 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -4,7 +4,6 @@ import { Accessor, createEffect, createResource, Setter, createSignal, Switch, M import { WaitlistAlreadyIn } from "~/components/waitlist/WaitlistAlreadyIn"; import WaitlistForm from "~/components/waitlist/WaitlistForm"; import ReloadPrompt from "~/components/Reload"; -import { NodeManagerProvider } from "~/state/nodeManagerState"; function createWaitListSignal(): [Accessor, Setter] { const [state, setState] = createSignal(""); diff --git a/src/utils/useCopy.ts b/src/utils/useCopy.ts new file mode 100644 index 0000000..69c826f --- /dev/null +++ b/src/utils/useCopy.ts @@ -0,0 +1,21 @@ +// Thanks you https://soorria.com/snippets/use-copy-solidjs +import type { Accessor } from 'solid-js' +import { createSignal } from 'solid-js' +export type UseCopyProps = { + copiedTimeout?: number +} +type CopyFn = (text: string) => Promise +export const useCopy = ({ copiedTimeout = 2000 }: UseCopyProps = {}): [ + copy: CopyFn, + copied: Accessor +] => { + const [copied, setCopied] = createSignal(false) + let timeout: NodeJS.Timeout + const copy: CopyFn = async text => { + await navigator.clipboard.writeText(text) + setCopied(true) + if (timeout) clearTimeout(timeout) + timeout = setTimeout(() => setCopied(false), copiedTimeout) + } + return [copy, copied] +} \ No newline at end of file