From c8f643198e3c9a9a3e74363c92ce0c74487da949 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 29 May 2023 22:04:50 +0700 Subject: [PATCH] update channel --- package.json | 18 +- pnpm-lock.yaml | 281 +++++++++--------- .../components/{miniMember.tsx => member.tsx} | 2 +- src/app/channel/components/members.tsx | 47 +-- src/app/channel/components/messageList.tsx | 6 +- src/app/channel/components/messages/form.tsx | 42 +-- .../components/messages/hideButton.tsx | 46 ++- src/app/channel/components/messages/item.tsx | 58 +++- .../components/messages/muteButton.tsx | 47 ++- .../components/messages/replyButton.tsx | 14 +- src/app/channel/components/messages/user.tsx | 9 +- src/app/channel/components/metadata.tsx | 16 +- src/app/channel/pages/index.page.tsx | 33 +- src/app/chat/components/messages/item.tsx | 8 + src/shared/form/imagePicker.tsx | 102 ------- src/stores/channel.tsx | 31 -- src/stores/channels.tsx | 36 ++- src/utils/storage.tsx | 11 +- 18 files changed, 340 insertions(+), 467 deletions(-) rename src/app/channel/components/{miniMember.tsx => member.tsx} (89%) delete mode 100644 src/shared/form/imagePicker.tsx delete mode 100644 src/stores/channel.tsx diff --git a/package.json b/package.json index efa633a9..27232c99 100644 --- a/package.json +++ b/package.json @@ -15,19 +15,19 @@ "dependencies": { "@floating-ui/react": "^0.23.1", "@headlessui/react": "^1.7.14", - "@tanstack/react-query": "^4.29.7", + "@tanstack/react-query": "^4.29.11", "@tanstack/react-virtual": "3.0.0-beta.54", "@tauri-apps/api": "^1.3.0", "@vidstack/react": "^0.4.5", "dayjs": "^1.11.7", "destr": "^1.2.2", - "jotai": "^2.1.0", + "immer": "^10.0.2", "light-bolt11-decoder": "^3.0.0", - "nostr-relaypool": "^0.6.27", + "nostr-relaypool": "^0.6.28", "nostr-tools": "^1.11.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-hook-form": "^7.43.9", + "react-hook-form": "^7.44.2", "react-markdown": "^8.0.7", "react-virtuoso": "^4.3.8", "remark-gfm": "^3.0.1", @@ -43,8 +43,8 @@ "devDependencies": { "@tailwindcss/typography": "^0.5.9", "@tauri-apps/cli": "^1.3.1", - "@types/node": "^18.16.14", - "@types/react": "^18.2.6", + "@types/node": "^18.16.16", + "@types/react": "^18.2.7", "@types/react-dom": "^18.2.4", "@types/youtube-player": "^5.5.7", "@vitejs/plugin-react-swc": "^3.3.1", @@ -54,13 +54,13 @@ "encoding": "^0.1.13", "husky": "^8.0.3", "lint-staged": "^13.2.2", - "postcss": "^8.4.23", + "postcss": "^8.4.24", "prop-types": "^15.8.1", "rome": "12.1.0", "tailwindcss": "^3.3.2", "typescript": "^4.9.5", - "vite": "^4.3.8", - "vite-plugin-ssr": "^0.4.126", + "vite": "^4.3.9", + "vite-plugin-ssr": "^0.4.130", "vite-plugin-top-level-await": "^1.3.1", "vite-tsconfig-paths": "^4.2.0", "ws": "^8.13.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8d8c83d7..05da6bd9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,8 +8,8 @@ dependencies: specifier: ^1.7.14 version: 1.7.14(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query': - specifier: ^4.29.7 - version: 4.29.7(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.29.11 + version: 4.29.11(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-virtual': specifier: 3.0.0-beta.54 version: 3.0.0-beta.54(react@18.2.0) @@ -18,22 +18,22 @@ dependencies: version: 1.3.0 '@vidstack/react': specifier: ^0.4.5 - version: 0.4.5(@types/react@18.2.6)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5) + version: 0.4.5(@types/react@18.2.7)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5) dayjs: specifier: ^1.11.7 version: 1.11.7 destr: specifier: ^1.2.2 version: 1.2.2 - jotai: - specifier: ^2.1.0 - version: 2.1.0(react@18.2.0) + immer: + specifier: ^10.0.2 + version: 10.0.2 light-bolt11-decoder: specifier: ^3.0.0 version: 3.0.0 nostr-relaypool: - specifier: ^0.6.27 - version: 0.6.27(ws@8.13.0) + specifier: ^0.6.28 + version: 0.6.28(ws@8.13.0) nostr-tools: specifier: ^1.11.1 version: 1.11.1 @@ -44,11 +44,11 @@ dependencies: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) react-hook-form: - specifier: ^7.43.9 - version: 7.43.9(react@18.2.0) + specifier: ^7.44.2 + version: 7.44.2(react@18.2.0) react-markdown: specifier: ^8.0.7 - version: 8.0.7(@types/react@18.2.6)(react@18.2.0) + version: 8.0.7(@types/react@18.2.7)(react@18.2.0) react-virtuoso: specifier: ^4.3.8 version: 4.3.8(react-dom@18.2.0)(react@18.2.0) @@ -78,7 +78,7 @@ dependencies: version: 0.4.5 zustand: specifier: ^4.3.8 - version: 4.3.8(react@18.2.0) + version: 4.3.8(immer@10.0.2)(react@18.2.0) devDependencies: '@tailwindcss/typography': @@ -88,11 +88,11 @@ devDependencies: specifier: ^1.3.1 version: 1.3.1 '@types/node': - specifier: ^18.16.14 - version: 18.16.14 + specifier: ^18.16.16 + version: 18.16.16 '@types/react': - specifier: ^18.2.6 - version: 18.2.6 + specifier: ^18.2.7 + version: 18.2.7 '@types/react-dom': specifier: ^18.2.4 version: 18.2.4 @@ -101,10 +101,10 @@ devDependencies: version: 5.5.7 '@vitejs/plugin-react-swc': specifier: ^3.3.1 - version: 3.3.1(vite@4.3.8) + version: 3.3.1(vite@4.3.9) autoprefixer: specifier: ^10.4.14 - version: 10.4.14(postcss@8.4.23) + version: 10.4.14(postcss@8.4.24) cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -121,8 +121,8 @@ devDependencies: specifier: ^13.2.2 version: 13.2.2 postcss: - specifier: ^8.4.23 - version: 8.4.23 + specifier: ^8.4.24 + version: 8.4.24 prop-types: specifier: ^15.8.1 version: 15.8.1 @@ -136,17 +136,17 @@ devDependencies: specifier: ^4.9.5 version: 4.9.5 vite: - specifier: ^4.3.8 - version: 4.3.8(@types/node@18.16.14) + specifier: ^4.3.9 + version: 4.3.9(@types/node@18.16.16) vite-plugin-ssr: - specifier: ^0.4.126 - version: 0.4.126(vite@4.3.8) + specifier: ^0.4.130 + version: 0.4.130(vite@4.3.9) vite-plugin-top-level-await: specifier: ^1.3.1 - version: 1.3.1(vite@4.3.8) + version: 1.3.1(vite@4.3.9) vite-tsconfig-paths: specifier: ^4.2.0 - version: 4.2.0(typescript@4.9.5)(vite@4.3.8) + version: 4.2.0(typescript@4.9.5)(vite@4.3.9) ws: specifier: ^8.13.0 version: 8.13.0 @@ -378,8 +378,8 @@ packages: resolution: {integrity: sha512-EvYTiXet5XqweYGClEmpu3BoxmsQ4hkj3QaYA6qEnigCWffTP3vNRwBReTdrwDwo7OoJ3wM8Uoe9Uk4n+d4hfg==} dev: false - /@floating-ui/dom@1.2.8: - resolution: {integrity: sha512-XLwhYV90MxiHDq6S0rzFZj00fnDM+A1R9jhSioZoMsa7G0Q0i+Q4x40ajR8FHSdYDE1bgjG45mIWe6jtv9UPmg==} + /@floating-ui/dom@1.2.9: + resolution: {integrity: sha512-sosQxsqgxMNkV3C+3UqTS6LxP7isRLwX8WMepp843Rb3/b0Wz8+MdUkxJksByip3C2WwLugLHN1b4ibn//zKwQ==} dependencies: '@floating-ui/core': 1.2.6 dev: false @@ -390,7 +390,7 @@ packages: react: '>=16.8.0' react-dom: '>=16.8.0' dependencies: - '@floating-ui/dom': 1.2.8 + '@floating-ui/dom': 1.2.9 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -580,8 +580,8 @@ packages: '@scure/base': 1.1.1 dev: false - /@swc/core-darwin-arm64@1.3.59: - resolution: {integrity: sha512-AnqWFBgEKHP0jb4iZqx7eVQT9/rX45+DE4Ox7GpwCahUKxxrsDLyXzKhwLwQuAjUvtu5JcSB77szKpPGDM49fQ==} + /@swc/core-darwin-arm64@1.3.60: + resolution: {integrity: sha512-oCDKWGdSO1WyErduGfiITRDoq7ZBt9PXETlhi8BGKH/wCc/3mfSNI9wXAg3Stn8mrT0lUJtdsnwMI/eZp6dK+A==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] @@ -589,8 +589,8 @@ packages: dev: true optional: true - /@swc/core-darwin-x64@1.3.59: - resolution: {integrity: sha512-iqDs+yii9mOsmpJez82SEi4d4prWDRlapHxKnDVJ0x1AqRo41vIq8t3fujrvCHYU5VQgOYGh4ooXQpaP2H3B2A==} + /@swc/core-darwin-x64@1.3.60: + resolution: {integrity: sha512-pcE/1oUlmN/BkKndOPtViqTkaM5pomagXATo+Muqn4QNMnkSOEVcmF9T3Lr3nB1A7O/fwCew3/aHwZ5B2TZ1tA==} engines: {node: '>=10'} cpu: [x64] os: [darwin] @@ -598,8 +598,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm-gnueabihf@1.3.59: - resolution: {integrity: sha512-PB0PP+SgkCSd/kYmltnPiGv42cOSaih1OjXCEjxvNwUFEmWqluW6uGdWaNiR1LoYMxhcHZTc336jL2+O3l6p0Q==} + /@swc/core-linux-arm-gnueabihf@1.3.60: + resolution: {integrity: sha512-Moc+86SWcbPr06PaQYUb0Iwli425F7QgjwTCNEPYA6OYUsjaJhXMaHViW2WdGIXue2+eaQbg31BHQd14jXcoBg==} engines: {node: '>=10'} cpu: [arm] os: [linux] @@ -607,8 +607,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-gnu@1.3.59: - resolution: {integrity: sha512-Ol/JPszWZ+OZ44FOdJe35TfJ1ckG4pYaisZJ4E7PzfwfVe2ygX85C5WWR4e5L0Y1zFvzpcI7gdyC2wzcXk4Cig==} + /@swc/core-linux-arm64-gnu@1.3.60: + resolution: {integrity: sha512-pPGZrTgSXBvp6IrXPXz8UJr82AElf8hMuK4rNHmLGDCqrWnRIFLUpiAsc2WCFIgdwqitZNQoM+F2vbceA/bkKg==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -616,8 +616,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-musl@1.3.59: - resolution: {integrity: sha512-PtTTtGbj9GiY5gJdoSFL2A0vL6BRaS1haAhp6g3hZvLDkTTg+rJURmzwBMMjaQlnGC62x/lLf6MoszHG/05//Q==} + /@swc/core-linux-arm64-musl@1.3.60: + resolution: {integrity: sha512-HSFQaVUkjWYNsQeymAQ3IPX3csRQvHe6MFyqPfvCCQ4dFlxPvlS7VvNaLnGG+ZW1ek7Lc+hEX+4NGzZKsxDIHA==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -625,8 +625,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-gnu@1.3.59: - resolution: {integrity: sha512-XBW9AGi0YsIN76IfesnDSBn/5sjR69J75KUNte8sH6seYlHJ0/kblqUMbUcfr0CiGoJadbzAZeKZZmfN7EsHpg==} + /@swc/core-linux-x64-gnu@1.3.60: + resolution: {integrity: sha512-WJt/X6HHM3/TszckRA7UKMXec3FHYsB9xswQbIYxN4bfTQodu3Rc8bmpHYtFO7ScMLrhY+RljHLK6wclPvaEXw==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -634,8 +634,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-musl@1.3.59: - resolution: {integrity: sha512-Cy5E939SdWPQ34cg6UABNO0RyEe0FuWqzZ/GLKtK11Ir4fjttVlucZiY59uQNyUVUc8T2qE0VBFCyD/zYGuHtg==} + /@swc/core-linux-x64-musl@1.3.60: + resolution: {integrity: sha512-DGGBqAPUXy/aPMBKokL3osZC9kM97HchiDPuprzwgTMP40YQ3hGCzNJ5jK7sOk9Tc4PEdZ2Igfr9sBHmCrxxQw==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -643,8 +643,8 @@ packages: dev: true optional: true - /@swc/core-win32-arm64-msvc@1.3.59: - resolution: {integrity: sha512-z5ZJxizRvRoSAaevRIi3YjQh74OFWEIhonSDWNdqDL7RbjEivcatYcG7OikH6s+rtPhOcwNm3PbGV2Prcgh/gg==} + /@swc/core-win32-arm64-msvc@1.3.60: + resolution: {integrity: sha512-wQg/BZPJvp5WpUbsBp7VHjhUh0DfYOPhP6dH67WO9QQ07+DvOk2DR2Bfh0z0ts1k7H/FsAqExWtTDCWMCRJiRQ==} engines: {node: '>=10'} cpu: [arm64] os: [win32] @@ -652,8 +652,8 @@ packages: dev: true optional: true - /@swc/core-win32-ia32-msvc@1.3.59: - resolution: {integrity: sha512-vxpsn+hrKAhi5YusQfB/JXUJJVX40rIRE/L49ilBEqdbH8Khkoego6AD+2vWqTdJcUHo1WiAIAEZ0rTsjyorLQ==} + /@swc/core-win32-ia32-msvc@1.3.60: + resolution: {integrity: sha512-nqkd0XIVyGbnBwAxP4GIfx6n45/hAPETpmQYpDSGnucOKFJfvGdFGL81GDG1acPCq/oFtR3tIyTbPpKmJ0N6xQ==} engines: {node: '>=10'} cpu: [ia32] os: [win32] @@ -661,8 +661,8 @@ packages: dev: true optional: true - /@swc/core-win32-x64-msvc@1.3.59: - resolution: {integrity: sha512-Ris/cJbURylcLwqz4RZUUBCEGsuaIHOJsvf69W5pGKHKBryVoOTNhBKpo3Km2hoAi5qFQ/ou0trAT4hBsVPZvQ==} + /@swc/core-win32-x64-msvc@1.3.60: + resolution: {integrity: sha512-ouw+s22i9PYQpSE7Xc+ZittEyA87jElXABesviSpP+jgHt10sM5KFUpVAeV8DRlxJCXMJJ5AhOdCf4TAtFr+6A==} engines: {node: '>=10'} cpu: [x64] os: [win32] @@ -670,8 +670,8 @@ packages: dev: true optional: true - /@swc/core@1.3.59: - resolution: {integrity: sha512-ZBw31zd2E5SXiodwGvjQdx5ZC90b2uyX/i2LeMMs8LKfXD86pfOfQac+JVrnyEKDhASXj9icgsF9NXBhaMr3Kw==} + /@swc/core@1.3.60: + resolution: {integrity: sha512-dWfic7sVjnrStzGcMWakHd2XPau8UXGPmFUTkx6xGX+DOVtfAQVzG6ZW7ohw/yNcTqI05w6Ser26XMTMGBgXdA==} engines: {node: '>=10'} requiresBuild: true peerDependencies: @@ -680,16 +680,16 @@ packages: '@swc/helpers': optional: true optionalDependencies: - '@swc/core-darwin-arm64': 1.3.59 - '@swc/core-darwin-x64': 1.3.59 - '@swc/core-linux-arm-gnueabihf': 1.3.59 - '@swc/core-linux-arm64-gnu': 1.3.59 - '@swc/core-linux-arm64-musl': 1.3.59 - '@swc/core-linux-x64-gnu': 1.3.59 - '@swc/core-linux-x64-musl': 1.3.59 - '@swc/core-win32-arm64-msvc': 1.3.59 - '@swc/core-win32-ia32-msvc': 1.3.59 - '@swc/core-win32-x64-msvc': 1.3.59 + '@swc/core-darwin-arm64': 1.3.60 + '@swc/core-darwin-x64': 1.3.60 + '@swc/core-linux-arm-gnueabihf': 1.3.60 + '@swc/core-linux-arm64-gnu': 1.3.60 + '@swc/core-linux-arm64-musl': 1.3.60 + '@swc/core-linux-x64-gnu': 1.3.60 + '@swc/core-linux-x64-musl': 1.3.60 + '@swc/core-win32-arm64-msvc': 1.3.60 + '@swc/core-win32-ia32-msvc': 1.3.60 + '@swc/core-win32-x64-msvc': 1.3.60 dev: true /@tailwindcss/typography@0.5.9(tailwindcss@3.3.2): @@ -704,12 +704,12 @@ packages: tailwindcss: 3.3.2 dev: true - /@tanstack/query-core@4.29.7: - resolution: {integrity: sha512-GXG4b5hV2Loir+h2G+RXhJdoZhJLnrBWsuLB2r0qBRyhWuXq9w/dWxzvpP89H0UARlH6Mr9DiVj4SMtpkF/aUA==} + /@tanstack/query-core@4.29.11: + resolution: {integrity: sha512-8C+hF6SFAb/TlFZyS9FItgNwrw4PMa7YeX+KQYe2ZAiEz6uzg6yIr+QBzPkUwZ/L0bXvGd1sufTm3wotoz+GwQ==} dev: false - /@tanstack/react-query@4.29.7(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-ijBWEzAIo09fB1yd22slRZzprrZ5zMdWYzBnCg5qiXuFbH78uGN1qtGz8+Ed4MuhaPaYSD+hykn+QEKtQviEtg==} + /@tanstack/react-query@4.29.11(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-aLaOAhBnCr12YKPjDsZOc0fAtkyaW7f9KfVfw49oYpfe0H9EPXBUgDBIKJ8qdHF3uGzTVSMcmpiw1Za41BLZlw==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -720,7 +720,7 @@ packages: react-native: optional: true dependencies: - '@tanstack/query-core': 4.29.7 + '@tanstack/query-core': 4.29.11 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) use-sync-external-store: 1.2.0(react@18.2.0) @@ -857,8 +857,8 @@ packages: resolution: {integrity: sha512-yB5C7zcOM7idwYZZ1wKQ3pTfjA9BbvFqRWvKB46GFddxnJtHwi/b9y84ykQtxQPg5qhdpg4Q/kWU3EGoCTmLzQ==} dev: false - /@types/lodash@4.14.194: - resolution: {integrity: sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==} + /@types/lodash@4.14.195: + resolution: {integrity: sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==} dev: false /@types/mdast@3.0.11: @@ -871,8 +871,8 @@ packages: resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} dev: false - /@types/node@18.16.14: - resolution: {integrity: sha512-+ImzUB3mw2c5ISJUq0punjDilUQ5GnUim0ZRvchHIWJmOC0G+p0kzhXBqj6cDjK0QdPFwzrHWgrJp3RPvCG5qg==} + /@types/node@18.16.16: + resolution: {integrity: sha512-NpaM49IGQQAUlBhHMF82QH80J08os4ZmyF9MkpCzWAGuOHqE4gTEbhzd7L3l5LmWuZ6E0OiC1FweQ4tsiW35+g==} dev: true /@types/prop-types@15.7.5: @@ -881,11 +881,11 @@ packages: /@types/react-dom@18.2.4: resolution: {integrity: sha512-G2mHoTMTL4yoydITgOGwWdWMVd8sNgyEP85xVmMKAPUBwQWm9wBPQUmvbeF4V3WBY1P7mmL4BkjQ0SqUpf1snw==} dependencies: - '@types/react': 18.2.6 + '@types/react': 18.2.7 dev: true - /@types/react@18.2.6: - resolution: {integrity: sha512-wRZClXn//zxCFW+ye/D2qY65UsYP1Fpex2YXorHc8awoNamkMZSvBxwxdYVInsHOZZd2Ppq8isnSzJL5Mpf8OA==} + /@types/react@18.2.7: + resolution: {integrity: sha512-ojrXpSH2XFCmHm7Jy3q44nXDyN54+EYKP2lBhJ2bqfyPj6cIUW/FZW/Csdia34NQgq7KYcAlHi5184m4X88+yw==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.3 @@ -902,7 +902,7 @@ packages: resolution: {integrity: sha512-W8F4eoTIvzXeNrT3JroQPimZLXnlJA8smYygHZUKFPVoYwgs/OhJkA1VBhL3iSs57OQkuINqHlY4SmMT5wtnJg==} dev: true - /@vidstack/react@0.4.5(@types/react@18.2.6)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5): + /@vidstack/react@0.4.5(@types/react@18.2.7)(maverick.js@0.33.1)(media-icons@0.4.2)(react@18.2.0)(vidstack@0.4.5): resolution: {integrity: sha512-spcim3+p1fMzkhHRKn5PS54YQjfThW5M3F2+R8tCT+wpsxbbCDa/TGdLBoIy2oC0LNziPkn0vlBWIZko9F5iig==} engines: {node: '>=16'} peerDependencies: @@ -912,20 +912,20 @@ packages: react: ^18.0.0 vidstack: 0.4.5 dependencies: - '@types/react': 18.2.6 + '@types/react': 18.2.7 maverick.js: 0.33.1 media-icons: 0.4.2 react: 18.2.0 vidstack: 0.4.5 dev: false - /@vitejs/plugin-react-swc@3.3.1(vite@4.3.8): + /@vitejs/plugin-react-swc@3.3.1(vite@4.3.9): resolution: {integrity: sha512-ZoYjGxMniXP7X+5ry/W1tpY7w0OeLUEsBF5RHFPmAhpgwwNWie8OF4056MRXRi9QgvYYoZPDzdOXGK3wlCoTfQ==} peerDependencies: vite: ^4 dependencies: - '@swc/core': 1.3.59 - vite: 4.3.8(@types/node@18.16.14) + '@swc/core': 1.3.60 + vite: 4.3.9(@types/node@18.16.16) transitivePeerDependencies: - '@swc/helpers' dev: true @@ -1001,19 +1001,19 @@ packages: engines: {node: '>=8'} dev: true - /autoprefixer@10.4.14(postcss@8.4.23): + /autoprefixer@10.4.14(postcss@8.4.24): resolution: {integrity: sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==} engines: {node: ^10 || ^12 || >=14} hasBin: true peerDependencies: postcss: ^8.1.0 dependencies: - browserslist: 4.21.5 + browserslist: 4.21.6 caniuse-lite: 1.0.30001489 fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 - postcss: 8.4.23 + postcss: 8.4.24 postcss-value-parser: 4.2.0 dev: true @@ -1044,15 +1044,15 @@ packages: fill-range: 7.0.1 dev: true - /browserslist@4.21.5: - resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + /browserslist@4.21.6: + resolution: {integrity: sha512-PF07dKGXKR+/bljJzCB6rAYtHEu21TthLxmJagtQizx+rwiqdRDBO5971Xu1N7MgcMLi4+mr4Cnl76x7O3DHtA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: caniuse-lite: 1.0.30001489 - electron-to-chromium: 1.4.405 + electron-to-chromium: 1.4.411 node-releases: 2.0.12 - update-browserslist-db: 1.0.11(browserslist@4.21.5) + update-browserslist-db: 1.0.11(browserslist@4.21.6) dev: true /cac@6.7.14: @@ -1249,8 +1249,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.405: - resolution: {integrity: sha512-JdDgnwU69FMZURoesf9gNOej2Cms1XJFfLk24y1IBtnAdhTcJY/mXnokmpmxHN59PcykBP4bgUU98vLY44Lhuw==} + /electron-to-chromium@1.4.411: + resolution: {integrity: sha512-5VXLW4Qw89vM2WTICHua/y8v7fKGDRVa2VPOtBB9IpLvW316B+xd8yD1wTmLPY2ot/00P/qt87xdolj4aG/Lzg==} dev: true /emoji-regex@8.0.0: @@ -1441,6 +1441,10 @@ packages: safer-buffer: 2.1.2 dev: true + /immer@10.0.2: + resolution: {integrity: sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA==} + dev: false + /immer@9.0.21: resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==} dev: false @@ -1546,18 +1550,6 @@ packages: hasBin: true dev: true - /jotai@2.1.0(react@18.2.0): - resolution: {integrity: sha512-fR82PtHAmEQrc/daMEYGc4EteW96/b6wodtDSCzLvoJA/6y4YG70er4hh2f8CYwYjqwQ0eZUModGfG4DmwkTyQ==} - engines: {node: '>=12.20.0'} - peerDependencies: - react: '>=17.0.0' - peerDependenciesMeta: - react: - optional: true - dependencies: - react: 18.2.0 - dev: false - /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -1598,7 +1590,7 @@ packages: object-inspect: 1.12.3 pidtree: 0.6.0 string-argv: 0.3.2 - yaml: 2.3.0 + yaml: 2.3.1 transitivePeerDependencies: - enquirer - supports-color @@ -2134,8 +2126,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /nostr-relaypool@0.6.27(ws@8.13.0): - resolution: {integrity: sha512-YtQxb8z9VHsPEQfC4rkxztqyGvWM1kcwiLhp/N8PpZX1+9mJhoIFctgpGxWB1LXhZgRiyJfY5Ml4EklvtWELuw==} + /nostr-relaypool@0.6.28(ws@8.13.0): + resolution: {integrity: sha512-kyLChBunf6IB2O3MSPHBe9iSokBGyqZHvAJXZ5+eh9C4znAu7iY8L/yh0V4Ta/P9TtzDna3QTEgFWVan4m0vBA==} dependencies: '@jest/source-map': 29.4.3 isomorphic-ws: 5.0.0(ws@8.13.0) @@ -2246,29 +2238,29 @@ packages: engines: {node: '>= 6'} dev: true - /postcss-import@15.1.0(postcss@8.4.23): + /postcss-import@15.1.0(postcss@8.4.24): resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} peerDependencies: postcss: ^8.0.0 dependencies: - postcss: 8.4.23 + postcss: 8.4.24 postcss-value-parser: 4.2.0 read-cache: 1.0.0 resolve: 1.22.2 dev: true - /postcss-js@4.0.1(postcss@8.4.23): + /postcss-js@4.0.1(postcss@8.4.24): resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} engines: {node: ^12 || ^14 || >= 16} peerDependencies: postcss: ^8.4.21 dependencies: camelcase-css: 2.0.1 - postcss: 8.4.23 + postcss: 8.4.24 dev: true - /postcss-load-config@4.0.1(postcss@8.4.23): + /postcss-load-config@4.0.1(postcss@8.4.24): resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} peerDependencies: @@ -2281,17 +2273,17 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - postcss: 8.4.23 - yaml: 2.3.0 + postcss: 8.4.24 + yaml: 2.3.1 dev: true - /postcss-nested@6.0.1(postcss@8.4.23): + /postcss-nested@6.0.1(postcss@8.4.24): resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.2.14 dependencies: - postcss: 8.4.23 + postcss: 8.4.24 postcss-selector-parser: 6.0.13 dev: true @@ -2315,8 +2307,8 @@ packages: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: true - /postcss@8.4.23: - resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} + /postcss@8.4.24: + resolution: {integrity: sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.6 @@ -2349,8 +2341,8 @@ packages: scheduler: 0.23.0 dev: false - /react-hook-form@7.43.9(react@18.2.0): - resolution: {integrity: sha512-AUDN3Pz2NSeoxQ7Hs6OhQhDr6gtF9YRuutGDwPQqhSUAHJSgGl2VeY3qN19MG0SucpjgDiuMJ4iC5T5uB+eaNQ==} + /react-hook-form@7.44.2(react@18.2.0): + resolution: {integrity: sha512-IyihmIbCwzDI/iqlecTRa7+4BCnzNx40upSlGvIU7qwENhTf6APatm4bmL9ANtWKPYlD67SIlxfls7GwCUe+Lg==} engines: {node: '>=12.22.0'} peerDependencies: react: ^16.8.0 || ^17 || ^18 @@ -2365,7 +2357,7 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: false - /react-markdown@8.0.7(@types/react@18.2.6)(react@18.2.0): + /react-markdown@8.0.7(@types/react@18.2.7)(react@18.2.0): resolution: {integrity: sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==} peerDependencies: '@types/react': '>=16' @@ -2373,7 +2365,7 @@ packages: dependencies: '@types/hast': 2.3.4 '@types/prop-types': 15.7.5 - '@types/react': 18.2.6 + '@types/react': 18.2.7 '@types/unist': 2.0.6 comma-separated-tokens: 2.0.3 hast-util-whitespace: 2.0.1 @@ -2584,7 +2576,7 @@ packages: dependencies: '@juggle/resize-observer': 3.4.0 '@types/is-hotkey': 0.1.7 - '@types/lodash': 4.14.194 + '@types/lodash': 4.14.195 direction: 1.0.4 is-hotkey: 0.1.8 is-plain-object: 5.0.0 @@ -2659,7 +2651,7 @@ packages: dependencies: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 - strip-ansi: 7.0.1 + strip-ansi: 7.1.0 dev: true /strip-ansi@6.0.1: @@ -2669,8 +2661,8 @@ packages: ansi-regex: 5.0.1 dev: true - /strip-ansi@7.0.1: - resolution: {integrity: sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==} + /strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} dependencies: ansi-regex: 6.0.1 @@ -2742,11 +2734,11 @@ packages: normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.0 - postcss: 8.4.23 - postcss-import: 15.1.0(postcss@8.4.23) - postcss-js: 4.0.1(postcss@8.4.23) - postcss-load-config: 4.0.1(postcss@8.4.23) - postcss-nested: 6.0.1(postcss@8.4.23) + postcss: 8.4.24 + postcss-import: 15.1.0(postcss@8.4.24) + postcss-js: 4.0.1(postcss@8.4.24) + postcss-load-config: 4.0.1(postcss@8.4.24) + postcss-nested: 6.0.1(postcss@8.4.24) postcss-selector-parser: 6.0.13 postcss-value-parser: 4.2.0 resolve: 1.22.2 @@ -2885,13 +2877,13 @@ packages: unist-util-visit-parents: 5.1.3 dev: false - /update-browserslist-db@1.0.11(browserslist@4.21.5): + /update-browserslist-db@1.0.11(browserslist@4.21.6): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.5 + browserslist: 4.21.6 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -2950,8 +2942,8 @@ packages: type-fest: 3.11.0 dev: false - /vite-plugin-ssr@0.4.126(vite@4.3.8): - resolution: {integrity: sha512-mQr9vFiiIh49KST8iCodwr8x6c9+ldu+LFAVJQJiQdW7Z7WgjyiF7833pVSsDFfw0bIFHoxtN2eoY75bxUQHHA==} + /vite-plugin-ssr@0.4.130(vite@4.3.9): + resolution: {integrity: sha512-EYyTeOviS6P7bFod1FxV+mglRckEh+jWdFYMMnoT7zz2MQyCSQQs/mZ/EXPyeqPY4PwvwAY3MzPbb0bPdUA+PA==} engines: {node: '>=12.19.0'} hasBin: true peerDependencies: @@ -2971,24 +2963,24 @@ packages: esbuild: 0.17.19 fast-glob: 3.2.12 sirv: 2.0.3 - vite: 4.3.8(@types/node@18.16.14) + vite: 4.3.9(@types/node@18.16.16) dev: true - /vite-plugin-top-level-await@1.3.1(vite@4.3.8): + /vite-plugin-top-level-await@1.3.1(vite@4.3.9): resolution: {integrity: sha512-55M1h4NAwkrpxPNOJIBzKZFihqLUzIgnElLSmPNPMR2Fn9+JHKaNg3sVX1Fq+VgvuBksQYxiD3OnwQAUu7kaPQ==} peerDependencies: vite: '>=2.8' dependencies: '@rollup/plugin-virtual': 3.0.1 - '@swc/core': 1.3.59 + '@swc/core': 1.3.60 uuid: 9.0.0 - vite: 4.3.8(@types/node@18.16.14) + vite: 4.3.9(@types/node@18.16.16) transitivePeerDependencies: - '@swc/helpers' - rollup dev: true - /vite-tsconfig-paths@4.2.0(typescript@4.9.5)(vite@4.3.8): + /vite-tsconfig-paths@4.2.0(typescript@4.9.5)(vite@4.3.9): resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} peerDependencies: vite: '*' @@ -2999,14 +2991,14 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@4.9.5) - vite: 4.3.8(@types/node@18.16.14) + vite: 4.3.9(@types/node@18.16.16) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.3.8(@types/node@18.16.14): - resolution: {integrity: sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==} + /vite@4.3.9(@types/node@18.16.16): + resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -3030,9 +3022,9 @@ packages: terser: optional: true dependencies: - '@types/node': 18.16.14 + '@types/node': 18.16.16 esbuild: 0.17.19 - postcss: 8.4.23 + postcss: 8.4.24 rollup: 3.23.0 optionalDependencies: fsevents: 2.3.2 @@ -3080,12 +3072,12 @@ packages: utf-8-validate: optional: true - /yaml@2.3.0: - resolution: {integrity: sha512-8/1wgzdKc7bc9E6my5wZjmdavHLvO/QOmLG1FBugblEvY4IXrLjlViIOmL24HthU042lWTDRO90Fz1Yp66UnMw==} - engines: {node: '>= 14', npm: '>= 7'} + /yaml@2.3.1: + resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} + engines: {node: '>= 14'} dev: true - /zustand@4.3.8(react@18.2.0): + /zustand@4.3.8(immer@10.0.2)(react@18.2.0): resolution: {integrity: sha512-4h28KCkHg5ii/wcFFJ5Fp+k1J3gJoasaIbppdgZFO4BPJnsNxL0mQXBSFgOgAdCdBj35aDTPvdAJReTMntFPGg==} engines: {node: '>=12.7.0'} peerDependencies: @@ -3097,6 +3089,7 @@ packages: react: optional: true dependencies: + immer: 10.0.2 react: 18.2.0 use-sync-external-store: 1.2.0(react@18.2.0) dev: false diff --git a/src/app/channel/components/miniMember.tsx b/src/app/channel/components/member.tsx similarity index 89% rename from src/app/channel/components/miniMember.tsx rename to src/app/channel/components/member.tsx index 73c92adf..301f587a 100644 --- a/src/app/channel/components/miniMember.tsx +++ b/src/app/channel/components/member.tsx @@ -4,7 +4,7 @@ import { DEFAULT_AVATAR } from "@stores/constants"; import { useProfile } from "@utils/hooks/useProfile"; -export default function MiniMember({ pubkey }: { pubkey: string }) { +export function Member({ pubkey }: { pubkey: string }) { const { user, isError, isLoading } = useProfile(pubkey); return ( diff --git a/src/app/channel/components/members.tsx b/src/app/channel/components/members.tsx index 0994b340..ce7b9630 100644 --- a/src/app/channel/components/members.tsx +++ b/src/app/channel/components/members.tsx @@ -1,44 +1,13 @@ -import MiniMember from "@app/channel/components/miniMember"; - -import { channelMembersAtom } from "@stores/channel"; - -import { useAtomValue } from "jotai"; - -export default function ChannelMembers() { - const membersAsSet = useAtomValue(channelMembersAtom); - const membersAsArray = [...membersAsSet]; - const miniMembersList = membersAsArray.slice(0, 4); - const totalMembers = - membersAsArray.length > 0 - ? `+${Intl.NumberFormat("en-US", { - notation: "compact", - maximumFractionDigits: 1, - }).format(membersAsArray.length)}` - : 0; +import { Member } from "@app/channel/components/member"; +import { useChannelMessages } from "@stores/channels"; +import { useEffect } from "react"; +export function ChannelMembers() { return ( -