refactor active account and clean up

This commit is contained in:
Ren Amamiya 2023-03-31 16:06:40 +07:00
parent c7e2b9430a
commit 5b88b335a1
15 changed files with 101 additions and 490 deletions

View File

@ -1,6 +1,8 @@
const removeImports = require('next-remove-imports')();
/**
* @type {import('next').NextConfig}
*/
module.exports = removeImports({
const nextConfig = {
reactStrictMode: false,
swcMinify: true,
images: {
@ -9,11 +11,10 @@ module.exports = removeImports({
typescript: {
ignoreBuildErrors: true,
},
experimental: {
scrollRestoration: true,
},
webpack: (config) => {
config.experiments = { ...config.experiments, topLevelAwait: true };
return config;
},
});
};
module.exports = nextConfig;

View File

@ -21,20 +21,14 @@
"@radix-ui/react-popover": "^1.0.5",
"@radix-ui/react-tabs": "^1.0.3",
"@supabase/supabase-js": "^2.13.0",
"@tanstack/query-core": "^4.27.0",
"@tanstack/react-query": "^4.28.0",
"@tanstack/react-virtual": "3.0.0-beta.54",
"@tauri-apps/api": "^1.2.0",
"boring-avatars": "^1.7.0",
"dayjs": "^1.11.7",
"destr": "^1.2.2",
"emoji-mart": "^5.5.2",
"framer-motion": "^9.1.7",
"jotai": "^2.0.3",
"jotai-cache": "^0.3.0",
"jotai-tanstack-query": "^0.6.0",
"next": "^13.2.4",
"next-remove-imports": "^1.0.10",
"nostr-relaypool": "^0.5.18",
"nostr-tools": "^1.8.1",
"react": "^18.2.0",

View File

@ -11,9 +11,6 @@ specifiers:
'@radix-ui/react-tabs': ^1.0.3
'@supabase/supabase-js': ^2.13.0
'@tailwindcss/typography': ^0.5.9
'@tanstack/query-core': ^4.27.0
'@tanstack/react-query': ^4.28.0
'@tanstack/react-virtual': 3.0.0-beta.54
'@tauri-apps/api': ^1.2.0
'@tauri-apps/cli': ^1.2.3
'@trivago/prettier-plugin-sort-imports': ^4.1.1
@ -23,7 +20,6 @@ specifiers:
'@typescript-eslint/eslint-plugin': ^5.57.0
'@typescript-eslint/parser': ^5.57.0
autoprefixer: ^10.4.14
boring-avatars: ^1.7.0
csstype: ^3.1.1
dayjs: ^1.11.7
destr: ^1.2.2
@ -37,10 +33,8 @@ specifiers:
husky: ^8.0.3
jotai: ^2.0.3
jotai-cache: ^0.3.0
jotai-tanstack-query: ^0.6.0
lint-staged: ^13.2.0
next: ^13.2.4
next-remove-imports: ^1.0.10
nostr-relaypool: ^0.5.18
nostr-tools: ^1.8.1
postcss: ^8.4.21
@ -69,20 +63,14 @@ dependencies:
'@radix-ui/react-popover': 1.0.5_6ayuu6vm2uqggsikytom4xssc4
'@radix-ui/react-tabs': 1.0.3_biqbaboplfbrettd7655fr4n2y
'@supabase/supabase-js': 2.13.0
'@tanstack/query-core': 4.27.0
'@tanstack/react-query': 4.28.0_biqbaboplfbrettd7655fr4n2y
'@tanstack/react-virtual': 3.0.0-beta.54_react@18.2.0
'@tauri-apps/api': 1.2.0
boring-avatars: 1.7.0
dayjs: 1.11.7
destr: 1.2.2
emoji-mart: 5.5.2
framer-motion: 9.1.7_biqbaboplfbrettd7655fr4n2y
jotai: 2.0.3_react@18.2.0
jotai-cache: 0.3.0_jotai@2.0.3
jotai-tanstack-query: 0.6.0_jqgumvl52k2nlr5n23qdneaa6y
next: 13.2.4_biqbaboplfbrettd7655fr4n2y
next-remove-imports: 1.0.10
nostr-relaypool: 0.5.18_ws@8.13.0
nostr-tools: 1.8.1
react: 18.2.0
@ -121,51 +109,13 @@ devDependencies:
typescript: 4.9.5
packages:
/@ampproject/remapping/2.2.0:
resolution:
{ integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== }
engines: { node: '>=6.0.0' }
dependencies:
'@jridgewell/gen-mapping': 0.1.1
'@jridgewell/trace-mapping': 0.3.17
dev: false
/@babel/code-frame/7.18.6:
resolution:
{ integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== }
engines: { node: '>=6.9.0' }
dependencies:
'@babel/highlight': 7.18.6
/@babel/compat-data/7.21.0:
resolution:
{ integrity: sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g== }
engines: { node: '>=6.9.0' }
dev: false
/@babel/core/7.21.3:
resolution:
{ integrity: sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw== }
engines: { node: '>=6.9.0' }
dependencies:
'@ampproject/remapping': 2.2.0
'@babel/code-frame': 7.18.6
'@babel/generator': 7.21.3
'@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.3
'@babel/helper-module-transforms': 7.21.2
'@babel/helpers': 7.21.0
'@babel/parser': 7.21.3
'@babel/template': 7.20.7
'@babel/traverse': 7.21.3
'@babel/types': 7.21.3
convert-source-map: 1.9.0
debug: 4.3.4
gensync: 1.0.0-beta.2
json5: 2.2.3
semver: 6.3.0
transitivePeerDependencies:
- supports-color
dev: false
dev: true
/@babel/generator/7.17.7:
resolution:
@ -177,36 +127,11 @@ packages:
source-map: 0.5.7
dev: true
/@babel/generator/7.21.3:
resolution:
{ integrity: sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA== }
engines: { node: '>=6.9.0' }
dependencies:
'@babel/types': 7.21.3
'@jridgewell/gen-mapping': 0.3.2
'@jridgewell/trace-mapping': 0.3.17
jsesc: 2.5.2
dev: false
/@babel/helper-compilation-targets/7.20.7_@babel+core@7.21.3:
resolution:
{ integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== }
engines: { node: '>=6.9.0' }
peerDependencies:
'@babel/core': ^7.0.0
dependencies:
'@babel/compat-data': 7.21.0
'@babel/core': 7.21.3
'@babel/helper-validator-option': 7.21.0
browserslist: 4.21.5
lru-cache: 5.1.1
semver: 6.3.0
dev: false
/@babel/helper-environment-visitor/7.18.9:
resolution:
{ integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== }
engines: { node: '>=6.9.0' }
dev: true
/@babel/helper-function-name/7.21.0:
resolution:
@ -215,6 +140,7 @@ packages:
dependencies:
'@babel/template': 7.20.7
'@babel/types': 7.21.3
dev: true
/@babel/helper-hoist-variables/7.18.6:
resolution:
@ -222,39 +148,7 @@ packages:
engines: { node: '>=6.9.0' }
dependencies:
'@babel/types': 7.21.3
/@babel/helper-module-imports/7.18.6:
resolution:
{ integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== }
engines: { node: '>=6.9.0' }
dependencies:
'@babel/types': 7.21.3
dev: false
/@babel/helper-module-transforms/7.21.2:
resolution:
{ integrity: sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ== }
engines: { node: '>=6.9.0' }
dependencies:
'@babel/helper-environment-visitor': 7.18.9
'@babel/helper-module-imports': 7.18.6
'@babel/helper-simple-access': 7.20.2
'@babel/helper-split-export-declaration': 7.18.6
'@babel/helper-validator-identifier': 7.19.1
'@babel/template': 7.20.7
'@babel/traverse': 7.21.3
'@babel/types': 7.21.3
transitivePeerDependencies:
- supports-color
dev: false
/@babel/helper-simple-access/7.20.2:
resolution:
{ integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== }
engines: { node: '>=6.9.0' }
dependencies:
'@babel/types': 7.21.3
dev: false
dev: true
/@babel/helper-split-export-declaration/7.18.6:
resolution:
@ -262,34 +156,19 @@ packages:
engines: { node: '>=6.9.0' }
dependencies:
'@babel/types': 7.21.3
dev: true
/@babel/helper-string-parser/7.19.4:
resolution:
{ integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== }
engines: { node: '>=6.9.0' }
dev: true
/@babel/helper-validator-identifier/7.19.1:
resolution:
{ integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== }
engines: { node: '>=6.9.0' }
/@babel/helper-validator-option/7.21.0:
resolution:
{ integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== }
engines: { node: '>=6.9.0' }
dev: false
/@babel/helpers/7.21.0:
resolution:
{ integrity: sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA== }
engines: { node: '>=6.9.0' }
dependencies:
'@babel/template': 7.20.7
'@babel/traverse': 7.21.3
'@babel/types': 7.21.3
transitivePeerDependencies:
- supports-color
dev: false
dev: true
/@babel/highlight/7.18.6:
resolution:
@ -299,6 +178,7 @@ packages:
'@babel/helper-validator-identifier': 7.19.1
chalk: 2.4.2
js-tokens: 4.0.0
dev: true
/@babel/parser/7.21.3:
resolution:
@ -307,6 +187,7 @@ packages:
hasBin: true
dependencies:
'@babel/types': 7.17.0
dev: true
/@babel/runtime/7.21.0:
resolution:
@ -323,6 +204,7 @@ packages:
'@babel/code-frame': 7.18.6
'@babel/parser': 7.21.3
'@babel/types': 7.21.3
dev: true
/@babel/traverse/7.17.3:
resolution:
@ -343,25 +225,6 @@ packages:
- supports-color
dev: true
/@babel/traverse/7.21.3:
resolution:
{ integrity: sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ== }
engines: { node: '>=6.9.0' }
dependencies:
'@babel/code-frame': 7.18.6
'@babel/generator': 7.21.3
'@babel/helper-environment-visitor': 7.18.9
'@babel/helper-function-name': 7.21.0
'@babel/helper-hoist-variables': 7.18.6
'@babel/helper-split-export-declaration': 7.18.6
'@babel/parser': 7.21.3
'@babel/types': 7.21.3
debug: 4.3.4
globals: 11.12.0
transitivePeerDependencies:
- supports-color
dev: false
/@babel/types/7.17.0:
resolution:
{ integrity: sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== }
@ -369,6 +232,7 @@ packages:
dependencies:
'@babel/helper-validator-identifier': 7.19.1
to-fast-properties: 2.0.0
dev: true
/@babel/types/7.21.3:
resolution:
@ -378,6 +242,7 @@ packages:
'@babel/helper-string-parser': 7.19.4
'@babel/helper-validator-identifier': 7.19.1
to-fast-properties: 2.0.0
dev: true
/@emoji-mart/data/1.1.2:
resolution:
@ -511,37 +376,12 @@ packages:
graceful-fs: 4.2.11
dev: false
/@jridgewell/gen-mapping/0.1.1:
resolution:
{ integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== }
engines: { node: '>=6.0.0' }
dependencies:
'@jridgewell/set-array': 1.1.2
'@jridgewell/sourcemap-codec': 1.4.14
dev: false
/@jridgewell/gen-mapping/0.3.2:
resolution:
{ integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== }
engines: { node: '>=6.0.0' }
dependencies:
'@jridgewell/set-array': 1.1.2
'@jridgewell/sourcemap-codec': 1.4.14
'@jridgewell/trace-mapping': 0.3.17
dev: false
/@jridgewell/resolve-uri/3.1.0:
resolution:
{ integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== }
engines: { node: '>=6.0.0' }
dev: false
/@jridgewell/set-array/1.1.2:
resolution:
{ integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== }
engines: { node: '>=6.0.0' }
dev: false
/@jridgewell/sourcemap-codec/1.4.14:
resolution:
{ integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== }
@ -1310,45 +1150,6 @@ packages:
tailwindcss: 3.3.1_postcss@8.4.21
dev: true
/@tanstack/query-core/4.27.0:
resolution:
{ integrity: sha512-sm+QncWaPmM73IPwFlmWSKPqjdTXZeFf/7aEmWh00z7yl2FjqophPt0dE1EHW9P1giMC5rMviv7OUbSDmWzXXA== }
dev: false
/@tanstack/react-query/4.28.0_biqbaboplfbrettd7655fr4n2y:
resolution:
{ integrity: sha512-8cGBV5300RHlvYdS4ea+G1JcZIt5CIuprXYFnsWggkmGoC0b5JaqG0fIX3qwDL9PTNkKvG76NGThIWbpXivMrQ== }
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
react-native: '*'
peerDependenciesMeta:
react-dom:
optional: true
react-native:
optional: true
dependencies:
'@tanstack/query-core': 4.27.0
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
use-sync-external-store: 1.2.0_react@18.2.0
dev: false
/@tanstack/react-virtual/3.0.0-beta.54_react@18.2.0:
resolution:
{ integrity: sha512-D1mDMf4UPbrtHRZZriCly5bXTBMhylslm4dhcHqTtDJ6brQcgGmk8YD9JdWBGWfGSWPKoh2x1H3e7eh+hgPXtQ== }
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
'@tanstack/virtual-core': 3.0.0-beta.54
react: 18.2.0
dev: false
/@tanstack/virtual-core/3.0.0-beta.54:
resolution:
{ integrity: sha512-jtkwqdP2rY2iCCDVAFuaNBH3fiEi29aTn2RhtIoky8DTTiCdc48plpHHreLwmv1PICJ4AJUUESaq3xa8fZH8+g== }
dev: false
/@tauri-apps/api/1.2.0:
resolution:
{ integrity: sha512-lsI54KI6HGf7VImuf/T9pnoejfgkNoXveP14pVV7XarrQ46rOejIVJLFqHI9sRReJMGdh2YuCoI3cc/yCWCsrw== }
@ -1486,6 +1287,7 @@ packages:
/@types/json-schema/7.0.11:
resolution:
{ integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== }
dev: true
/@types/json5/0.0.29:
resolution:
@ -1699,26 +1501,6 @@ packages:
indent-string: 4.0.0
dev: true
/ajv-formats/2.1.1:
resolution:
{ integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== }
peerDependenciesMeta:
ajv:
optional: true
dependencies:
ajv: 8.12.0
dev: false
/ajv-keywords/5.1.0_ajv@8.12.0:
resolution:
{ integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== }
peerDependencies:
ajv: ^8.8.2
dependencies:
ajv: 8.12.0
fast-deep-equal: 3.1.3
dev: false
/ajv/6.12.6:
resolution:
{ integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== }
@ -1729,16 +1511,6 @@ packages:
uri-js: 4.4.1
dev: true
/ajv/8.12.0:
resolution:
{ integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== }
dependencies:
fast-deep-equal: 3.1.3
json-schema-traverse: 1.0.0
require-from-string: 2.0.2
uri-js: 4.4.1
dev: false
/ansi-escapes/4.3.2:
resolution:
{ integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== }
@ -1765,6 +1537,7 @@ packages:
engines: { node: '>=4' }
dependencies:
color-convert: 1.9.3
dev: true
/ansi-styles/4.3.0:
resolution:
@ -1925,28 +1698,6 @@ packages:
deep-equal: 2.2.0
dev: true
/babel-loader/9.1.2_@babel+core@7.21.3:
resolution:
{ integrity: sha512-mN14niXW43tddohGl8HPu5yfQq70iUThvFL/4QzESA7GcZoC0eVOhvWdQ8+3UlSjaDE9MVtsW9mxDY07W7VpVA== }
engines: { node: '>= 14.15.0' }
peerDependencies:
'@babel/core': ^7.12.0
webpack: '>=5'
dependencies:
'@babel/core': 7.21.3
find-cache-dir: 3.3.2
schema-utils: 4.0.0
dev: false
/babel-plugin-transform-remove-imports/1.7.0_@babel+core@7.21.3:
resolution:
{ integrity: sha512-gprmWf6ry5qrnxMyiDaxZpXzZJP6R9FRA+p0AImLIWRmSEGtlKcFprHKeGMZYkII9rJR6Q1hYou+n1fk6rWf2g== }
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.21.3
dev: false
/balanced-match/1.0.2:
resolution:
{ integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== }
@ -1958,11 +1709,6 @@ packages:
engines: { node: '>=8' }
dev: true
/boring-avatars/1.7.0:
resolution:
{ integrity: sha512-ZNHd8J7C/V0IjQMGQowLJ5rScEFU23WxePigH6rqKcT2Esf0qhYvYxw8s9i3srmlfCnCV00ddBjaoGey1eNOfA== }
dev: false
/brace-expansion/1.1.11:
resolution:
{ integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== }
@ -1989,6 +1735,7 @@ packages:
electron-to-chromium: 1.4.347
node-releases: 2.0.10
update-browserslist-db: 1.0.10_browserslist@4.21.5
dev: true
/bufferutil/4.0.7:
resolution:
@ -2030,6 +1777,7 @@ packages:
ansi-styles: 3.2.1
escape-string-regexp: 1.0.5
supports-color: 5.5.0
dev: true
/chalk/4.1.2:
resolution:
@ -2104,6 +1852,7 @@ packages:
{ integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== }
dependencies:
color-name: 1.1.3
dev: true
/color-convert/2.0.1:
resolution:
@ -2116,6 +1865,7 @@ packages:
/color-name/1.1.3:
resolution:
{ integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== }
dev: true
/color-name/1.1.4:
resolution:
@ -2139,21 +1889,11 @@ packages:
engines: { node: '>= 6' }
dev: true
/commondir/1.0.1:
resolution:
{ integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== }
dev: false
/concat-map/0.0.1:
resolution:
{ integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== }
dev: true
/convert-source-map/1.9.0:
resolution:
{ integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== }
dev: false
/cross-fetch/3.1.5:
resolution:
{ integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== }
@ -2237,6 +1977,7 @@ packages:
optional: true
dependencies:
ms: 2.1.2
dev: true
/deep-equal/2.2.0:
resolution:
@ -2339,6 +2080,7 @@ packages:
/electron-to-chromium/1.4.347:
resolution:
{ integrity: sha512-LNi3+/9nV0vT6Bz1OsSoZ/w7IgNuWdefZ7mjKNjZxyRlI/ag6uMXxsxAy5Etvuixq3Q26exw2fc4bNYvYQqXSw== }
dev: true
/emoji-mart/5.5.2:
resolution:
@ -2479,11 +2221,13 @@ packages:
resolution:
{ integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== }
engines: { node: '>=6' }
dev: true
/escape-string-regexp/1.0.5:
resolution:
{ integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== }
engines: { node: '>=0.8.0' }
dev: true
/escape-string-regexp/4.0.0:
resolution:
@ -2829,6 +2573,7 @@ packages:
/fast-deep-equal/3.1.3:
resolution:
{ integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== }
dev: true
/fast-glob/3.2.12:
resolution:
@ -2875,25 +2620,6 @@ packages:
to-regex-range: 5.0.1
dev: true
/find-cache-dir/3.3.2:
resolution:
{ integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== }
engines: { node: '>=8' }
dependencies:
commondir: 1.0.1
make-dir: 3.1.0
pkg-dir: 4.2.0
dev: false
/find-up/4.1.0:
resolution:
{ integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== }
engines: { node: '>=8' }
dependencies:
locate-path: 5.0.0
path-exists: 4.0.0
dev: false
/find-up/5.0.0:
resolution:
{ integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== }
@ -2978,12 +2704,6 @@ packages:
{ integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== }
dev: true
/gensync/1.0.0-beta.2:
resolution:
{ integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== }
engines: { node: '>=6.9.0' }
dev: false
/get-intrinsic/1.2.0:
resolution:
{ integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q== }
@ -3075,6 +2795,7 @@ packages:
resolution:
{ integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== }
engines: { node: '>=4' }
dev: true
/globals/13.20.0:
resolution:
@ -3152,6 +2873,7 @@ packages:
resolution:
{ integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== }
engines: { node: '>=4' }
dev: true
/has-flag/4.0.0:
resolution:
@ -3518,17 +3240,6 @@ packages:
jotai: 2.0.3_react@18.2.0
dev: false
/jotai-tanstack-query/0.6.0_jqgumvl52k2nlr5n23qdneaa6y:
resolution:
{ integrity: sha512-87oD6MnjrgfLWeCJXB/dQt4xyCmyFYZeG9jw4Y2lIprtwLKS5s/vCEjNP5fnYG2nuPBkopiRECTEqtIysvHSxg== }
peerDependencies:
'@tanstack/query-core': '*'
jotai: '>=1.11.0'
dependencies:
'@tanstack/query-core': 4.27.0
jotai: 2.0.3_react@18.2.0
dev: false
/jotai/2.0.3_react@18.2.0:
resolution:
{ integrity: sha512-MMjhSPAL3RoeZD9WbObufRT2quThEAEknHHridf2ma8Ml7ZVQmUiHk0ssdbR3F0h3kcwhYqSGJ59OjhPge7RRg== }
@ -3564,17 +3275,13 @@ packages:
{ integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== }
engines: { node: '>=4' }
hasBin: true
dev: true
/json-schema-traverse/0.4.1:
resolution:
{ integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== }
dev: true
/json-schema-traverse/1.0.0:
resolution:
{ integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== }
dev: false
/json-stable-stringify-without-jsonify/1.0.1:
resolution:
{ integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== }
@ -3588,13 +3295,6 @@ packages:
minimist: 1.2.8
dev: true
/json5/2.2.3:
resolution:
{ integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== }
engines: { node: '>=6' }
hasBin: true
dev: false
/jsx-ast-utils/3.3.3:
resolution:
{ integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw== }
@ -3685,14 +3385,6 @@ packages:
{ integrity: sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA== }
dev: false
/locate-path/5.0.0:
resolution:
{ integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== }
engines: { node: '>=8' }
dependencies:
p-locate: 4.1.0
dev: false
/locate-path/6.0.0:
resolution:
{ integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== }
@ -3739,13 +3431,6 @@ packages:
dependencies:
js-tokens: 4.0.0
/lru-cache/5.1.1:
resolution:
{ integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== }
dependencies:
yallist: 3.1.1
dev: false
/lru-cache/6.0.0:
resolution:
{ integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== }
@ -3754,14 +3439,6 @@ packages:
yallist: 4.0.0
dev: true
/make-dir/3.1.0:
resolution:
{ integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== }
engines: { node: '>=8' }
dependencies:
semver: 6.3.0
dev: false
/memoize-one/5.2.1:
resolution:
{ integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q== }
@ -3819,6 +3496,7 @@ packages:
/ms/2.1.2:
resolution:
{ integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== }
dev: true
/ms/2.1.3:
resolution:
@ -3850,18 +3528,6 @@ packages:
{ integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== }
dev: true
/next-remove-imports/1.0.10:
resolution:
{ integrity: sha512-BTlwYD86PyU0YuO2/CVfm+82WZiUpkspH7YkzFBM/nua/d8zouw+/4eUhLl278dtZXIlarmhpH47cWwred4w6Q== }
dependencies:
'@babel/core': 7.21.3
babel-loader: 9.1.2_@babel+core@7.21.3
babel-plugin-transform-remove-imports: 1.7.0_@babel+core@7.21.3
transitivePeerDependencies:
- supports-color
- webpack
dev: false
/next-tick/1.1.0:
resolution:
{ integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== }
@ -3937,6 +3603,7 @@ packages:
/node-releases/2.0.10:
resolution:
{ integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== }
dev: true
/normalize-path/3.0.0:
resolution:
@ -4108,14 +3775,6 @@ packages:
word-wrap: 1.2.3
dev: true
/p-limit/2.3.0:
resolution:
{ integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== }
engines: { node: '>=6' }
dependencies:
p-try: 2.2.0
dev: false
/p-limit/3.1.0:
resolution:
{ integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== }
@ -4124,14 +3783,6 @@ packages:
yocto-queue: 0.1.0
dev: true
/p-locate/4.1.0:
resolution:
{ integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== }
engines: { node: '>=8' }
dependencies:
p-limit: 2.3.0
dev: false
/p-locate/5.0.0:
resolution:
{ integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== }
@ -4148,12 +3799,6 @@ packages:
aggregate-error: 3.1.0
dev: true
/p-try/2.2.0:
resolution:
{ integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== }
engines: { node: '>=6' }
dev: false
/parent-module/1.0.1:
resolution:
{ integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== }
@ -4166,6 +3811,7 @@ packages:
resolution:
{ integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== }
engines: { node: '>=8' }
dev: true
/path-is-absolute/1.0.1:
resolution:
@ -4225,14 +3871,6 @@ packages:
engines: { node: '>= 6' }
dev: true
/pkg-dir/4.2.0:
resolution:
{ integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== }
engines: { node: '>=8' }
dependencies:
find-up: 4.1.0
dev: false
/postcss-import/14.1.0_postcss@8.4.21:
resolution:
{ integrity: sha512-flwI+Vgm4SElObFVPpTIT7SU7R3qk2L7PyduMcokiaVKuWv9d/U+Gm/QAd8NDLuykTWTkcrjOeD2Pp1rMeBTGw== }
@ -4410,6 +4048,7 @@ packages:
resolution:
{ integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== }
engines: { node: '>=6' }
dev: true
/queue-microtask/1.2.3:
resolution:
@ -4576,12 +4215,6 @@ packages:
functions-have-names: 1.2.3
dev: true
/require-from-string/2.0.2:
resolution:
{ integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== }
engines: { node: '>=0.10.0' }
dev: false
/resolve-from/4.0.0:
resolution:
{ integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== }
@ -4672,21 +4305,11 @@ packages:
loose-envify: 1.4.0
dev: false
/schema-utils/4.0.0:
resolution:
{ integrity: sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg== }
engines: { node: '>= 12.13.0' }
dependencies:
'@types/json-schema': 7.0.11
ajv: 8.12.0
ajv-formats: 2.1.1
ajv-keywords: 5.1.0_ajv@8.12.0
dev: false
/semver/6.3.0:
resolution:
{ integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== }
hasBin: true
dev: true
/semver/7.3.8:
resolution:
@ -4925,6 +4548,7 @@ packages:
engines: { node: '>=4' }
dependencies:
has-flag: 3.0.0
dev: true
/supports-color/7.2.0:
resolution:
@ -5028,6 +4652,7 @@ packages:
resolution:
{ integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== }
engines: { node: '>=4' }
dev: true
/to-regex-range/5.0.1:
resolution:
@ -5156,12 +4781,14 @@ packages:
browserslist: 4.21.5
escalade: 3.1.1
picocolors: 1.0.0
dev: true
/uri-js/4.4.1:
resolution:
{ integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== }
dependencies:
punycode: 2.3.0
dev: true
/use-callback-ref/1.3.0_o2wclmlv6kymw75psj4clbbe6a:
resolution:
@ -5210,15 +4837,6 @@ packages:
tslib: 2.5.0
dev: false
/use-sync-external-store/1.2.0_react@18.2.0:
resolution:
{ integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== }
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
dependencies:
react: 18.2.0
dev: false
/utf-8-validate/5.0.10:
resolution:
{ integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ== }
@ -5355,11 +4973,6 @@ packages:
engines: { node: '>=0.10.32' }
dev: false
/yallist/3.1.1:
resolution:
{ integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== }
dev: false
/yallist/4.0.0:
resolution:
{ integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== }

View File

@ -15,7 +15,7 @@ import { useContext } from 'react';
export default function FormBase() {
const [pool, relays]: any = useContext(RelayContext);
const activeAccount = useAtomValue(activeAccountAtom);
const activeAccount: any = useAtomValue(activeAccountAtom);
const [value, setValue] = useAtom(noteContentAtom);
const resetValue = useResetAtom(noteContentAtom);

View File

@ -13,7 +13,7 @@ import { useContext, useState } from 'react';
export default function FormComment({ eventID }: { eventID: any }) {
const [pool, relays]: any = useContext(RelayContext);
const activeAccount = useAtomValue(activeAccountAtom);
const activeAccount: any = useAtomValue(activeAccountAtom);
const [value, setValue] = useState('');
const profile = destr(activeAccount.metadata);

View File

@ -16,7 +16,7 @@ export default function NoteConnector() {
const [pool, relays]: any = useContext(RelayContext);
const setHasNewerNote = useSetAtom(hasNewerNoteAtom);
const activeAccount = useAtomValue(activeAccountAtom);
const activeAccount: any = useAtomValue(activeAccountAtom);
const [isOnline] = useState(true);
const now = useRef(new Date());

View File

@ -33,7 +33,7 @@ export const NoteComment = memo(function NoteComment({
const router = useRouter();
const [pool, relays]: any = useContext(RelayContext);
const activeAccount = useAtomValue(activeAccountAtom);
const activeAccount: any = useAtomValue(activeAccountAtom);
const [open, setOpen] = useState(false);
const [value, setValue] = useState('');

View File

@ -22,7 +22,7 @@ export const NoteReaction = memo(function NoteReaction({
}) {
const [pool, relays]: any = useContext(RelayContext);
const activeAccount = useAtomValue(activeAccountAtom);
const activeAccount: any = useAtomValue(activeAccountAtom);
const [isReact, setIsReact] = useState(false);
const [like, setLike] = useState(0);

View File

@ -1,5 +1,7 @@
import { ImageWithFallback } from '@components/imageWithFallback';
import { DEFAULT_AVATAR } from '@stores/constants';
import { createCacheProfile } from '@utils/storage';
import { truncate } from '@utils/truncate';
@ -30,9 +32,12 @@ export const UserBase = memo(function UserBase({ pubkey }: { pubkey: string }) {
return (
<div className="flex items-center gap-2">
<div className="relative h-11 w-11 shrink overflow-hidden rounded-full border border-white/10">
{profile?.picture && (
<ImageWithFallback src={profile.picture} alt={pubkey} fill={true} className="rounded-full object-cover" />
)}
<ImageWithFallback
src={profile?.picture || DEFAULT_AVATAR}
alt={pubkey}
fill={true}
className="rounded-full object-cover"
/>
</div>
<div className="flex w-full flex-1 flex-col items-start text-start">
<span className="truncate font-medium leading-tight text-zinc-200">

View File

@ -1,11 +1,12 @@
import { ImageWithFallback } from '@components/imageWithFallback';
import { DEFAULT_AVATAR } from '@stores/constants';
import { createCacheProfile, getCacheProfile } from '@utils/storage';
import { truncate } from '@utils/truncate';
import { DotsHorizontalIcon } from '@radix-ui/react-icons';
import { fetch } from '@tauri-apps/api/http';
import Avatar from 'boring-avatars';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import destr from 'destr';
@ -52,22 +53,12 @@ export const UserExtend = memo(function UserExtend({ pubkey, time }: { pubkey: s
onClick={(e) => openUserPage(e)}
className="relative h-11 w-11 shrink overflow-hidden rounded-md bg-zinc-900 ring-fuchsia-500 ring-offset-1 ring-offset-zinc-900 group-hover:ring-1"
>
{profile?.picture ? (
<ImageWithFallback
src={profile.picture}
alt={pubkey}
fill={true}
className="rounded-md border border-white/10 object-cover"
/>
) : (
<Avatar
size={44}
name={pubkey}
variant="beam"
square={true}
colors={['#FEE2E2', '#FEF3C7', '#F59E0B', '#EC4899', '#D946EF', '#8B5CF6']}
/>
)}
<ImageWithFallback
src={profile?.picture || DEFAULT_AVATAR}
alt={pubkey}
fill={true}
className="rounded-md border border-white/10 object-cover"
/>
</div>
<div className="flex w-full flex-1 items-start justify-between">
<div className="flex w-full justify-between">

View File

@ -1,5 +1,7 @@
import { ImageWithFallback } from '@components/imageWithFallback';
import { DEFAULT_AVATAR } from '@stores/constants';
import { createCacheProfile } from '@utils/storage';
import { truncate } from '@utils/truncate';
@ -30,9 +32,12 @@ export const UserFollow = memo(function UserFollow({ pubkey }: { pubkey: string
return (
<div className="flex items-center gap-2">
<div className="relative h-11 w-11 shrink overflow-hidden rounded-full border border-white/10">
{profile?.picture && (
<ImageWithFallback src={profile.picture} alt={pubkey} fill={true} className="rounded-full object-cover" />
)}
<ImageWithFallback
src={profile?.picture || DEFAULT_AVATAR}
alt={pubkey}
fill={true}
className="rounded-full object-cover"
/>
</div>
<div className="flex w-full flex-1 flex-col items-start text-start">
<span className="truncate font-medium leading-tight text-zinc-200">

View File

@ -1,5 +1,7 @@
import { ImageWithFallback } from '@components/imageWithFallback';
import { DEFAULT_AVATAR } from '@stores/constants';
import { createCacheProfile, getCacheProfile } from '@utils/storage';
import { truncate } from '@utils/truncate';
@ -42,22 +44,12 @@ export const UserLarge = memo(function UserLarge({ pubkey, time }: { pubkey: str
return (
<div className="flex items-center gap-2">
<div className="relative h-11 w-11 shrink overflow-hidden rounded-md bg-zinc-900">
{profile?.picture ? (
<ImageWithFallback
src={profile.picture}
alt={pubkey}
fill={true}
className="rounded-md border border-white/10 object-cover"
/>
) : (
<Avatar
size={44}
name={pubkey}
variant="beam"
square={true}
colors={['#FEE2E2', '#FEF3C7', '#F59E0B', '#EC4899', '#D946EF', '#8B5CF6']}
/>
)}
<ImageWithFallback
src={profile?.picture || DEFAULT_AVATAR}
alt={pubkey}
fill={true}
className="rounded-md border border-white/10 object-cover"
/>
</div>
<div className="w-full flex-1">
<div className="flex w-full justify-between">

View File

@ -1,26 +1,33 @@
import BaseLayout from '@layouts/base';
import { getAccounts } from '@utils/storage';
import { activeAccountAtom } from '@stores/account';
import { getActiveAccount } from '@utils/storage';
import LumeSymbol from '@assets/icons/Lume';
import { useSetAtom } from 'jotai';
import { useRouter } from 'next/router';
import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal, useEffect } from 'react';
export default function Page() {
const router = useRouter();
const setActiveAccount = useSetAtom(activeAccountAtom);
useEffect(() => {
getAccounts()
getActiveAccount()
.then((res: any) => {
if (res.length > 0) {
if (res) {
// update local storage
setActiveAccount(res);
// redirect
router.replace('/init');
} else {
router.replace('/onboarding');
}
})
.catch(console.error);
}, [router]);
}, [router, setActiveAccount]);
return (
<div className="relative h-full overflow-hidden">

View File

@ -29,7 +29,7 @@ export default function Page() {
const router = useRouter();
const [pool, relays]: any = useContext(RelayContext);
const activeAccount = useAtomValue(activeAccountAtom);
const activeAccount: any = useAtomValue(activeAccountAtom);
const [done, setDone] = useState(false);
const now = useRef(new Date());

View File

@ -1,9 +1,12 @@
import { isSSR } from '@utils/ssr';
import { getActiveAccount } from '@utils/storage';
import { atomWithStorage, createJSONStorage } from 'jotai/utils';
import { atomWithCache } from 'jotai-cache';
const createMyJsonStorage = () => {
const storage = createJSONStorage(() => localStorage);
const getItem = (key) => {
const value = storage.getItem(key);
return value;
};
return { ...storage, getItem };
};
export const activeAccountAtom = atomWithCache(async () => {
const response = isSSR ? {} : await getActiveAccount();
return response;
});
export const activeAccountAtom = atomWithStorage('activeAccount', {}, createMyJsonStorage());