From c1d818c69dbaab22d92a5f414a57102bb834ee8a Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Tue, 21 Mar 2023 09:58:06 +0700 Subject: [PATCH] minor fixes --- package.json | 10 +- pnpm-lock.yaml | 156 +++++++++++++------------- src/components/note/content/index.tsx | 21 +++- src/components/note/root.tsx | 4 +- src/components/user/base.tsx | 4 +- src/components/user/extend.tsx | 4 +- src/components/user/mention.tsx | 4 +- src/components/user/mini.tsx | 4 +- src/pages/newsfeed/following.tsx | 4 +- 9 files changed, 110 insertions(+), 101 deletions(-) diff --git a/package.json b/package.json index e24a9bd2..49bb721b 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@radix-ui/react-popover": "^1.0.5", "@radix-ui/react-tabs": "^1.0.3", "@rehooks/local-storage": "^2.4.4", - "@supabase/supabase-js": "^2.11.0", + "@supabase/supabase-js": "^2.12.0", "@tauri-apps/api": "^1.2.0", "@uiw/react-markdown-preview": "^4.1.10", "@uiw/react-md-editor": "^3.20.5", @@ -48,16 +48,16 @@ "@tailwindcss/typography": "^0.5.9", "@tauri-apps/cli": "^1.2.3", "@trivago/prettier-plugin-sort-imports": "^4.1.1", - "@types/node": "^18.15.3", + "@types/node": "^18.15.5", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", - "@typescript-eslint/eslint-plugin": "^5.55.0", - "@typescript-eslint/parser": "^5.55.0", + "@typescript-eslint/eslint-plugin": "^5.56.0", + "@typescript-eslint/parser": "^5.56.0", "autoprefixer": "^10.4.14", "csstype": "^3.1.1", "eslint": "^8.36.0", "eslint-config-next": "^13.2.4", - "eslint-config-prettier": "^8.7.0", + "eslint-config-prettier": "^8.8.0", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", "husky": "^8.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 44f19c7d..dbcecb85 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,16 +8,16 @@ specifiers: '@radix-ui/react-popover': ^1.0.5 '@radix-ui/react-tabs': ^1.0.3 '@rehooks/local-storage': ^2.4.4 - '@supabase/supabase-js': ^2.11.0 + '@supabase/supabase-js': ^2.12.0 '@tailwindcss/typography': ^0.5.9 '@tauri-apps/api': ^1.2.0 '@tauri-apps/cli': ^1.2.3 '@trivago/prettier-plugin-sort-imports': ^4.1.1 - '@types/node': ^18.15.3 + '@types/node': ^18.15.5 '@types/react': ^18.0.28 '@types/react-dom': ^18.0.11 - '@typescript-eslint/eslint-plugin': ^5.55.0 - '@typescript-eslint/parser': ^5.55.0 + '@typescript-eslint/eslint-plugin': ^5.56.0 + '@typescript-eslint/parser': ^5.56.0 '@uiw/react-markdown-preview': ^4.1.10 '@uiw/react-md-editor': ^3.20.5 autoprefixer: ^10.4.14 @@ -27,7 +27,7 @@ specifiers: dayjs: ^1.11.7 eslint: ^8.36.0 eslint-config-next: ^13.2.4 - eslint-config-prettier: ^8.7.0 + eslint-config-prettier: ^8.8.0 eslint-plugin-react: ^7.32.2 eslint-plugin-react-hooks: ^4.6.0 framer-motion: ^9.1.7 @@ -64,7 +64,7 @@ dependencies: '@radix-ui/react-popover': 1.0.5_zula6vjvt3wdocc4mwcxqa6nzi '@radix-ui/react-tabs': 1.0.3_biqbaboplfbrettd7655fr4n2y '@rehooks/local-storage': 2.4.4_react@18.2.0 - '@supabase/supabase-js': 2.11.0 + '@supabase/supabase-js': 2.12.0 '@tauri-apps/api': 1.2.0 '@uiw/react-markdown-preview': 4.1.10_zula6vjvt3wdocc4mwcxqa6nzi '@uiw/react-md-editor': 3.20.5_zula6vjvt3wdocc4mwcxqa6nzi @@ -93,16 +93,16 @@ devDependencies: '@tailwindcss/typography': 0.5.9_tailwindcss@3.2.7 '@tauri-apps/cli': 1.2.3 '@trivago/prettier-plugin-sort-imports': 4.1.1_prettier@2.8.5 - '@types/node': 18.15.3 + '@types/node': 18.15.5 '@types/react': 18.0.28 '@types/react-dom': 18.0.11 - '@typescript-eslint/eslint-plugin': 5.55.0_342y7v4tc7ytrrysmit6jo4wri - '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/eslint-plugin': 5.56.0_iskin7c6dxqunwflhstekcjqmq + '@typescript-eslint/parser': 5.56.0_vgl77cfdswitgr47lm5swmv43m autoprefixer: 10.4.14_postcss@8.4.21 csstype: 3.1.1 eslint: 8.36.0 eslint-config-next: 13.2.4_vgl77cfdswitgr47lm5swmv43m - eslint-config-prettier: 8.7.0_eslint@8.36.0 + eslint-config-prettier: 8.8.0_eslint@8.36.0 eslint-plugin-react: 7.32.2_eslint@8.36.0 eslint-plugin-react-hooks: 4.6.0_eslint@8.36.0 husky: 8.0.3 @@ -1267,9 +1267,9 @@ packages: - encoding dev: false - /@supabase/supabase-js/2.11.0: + /@supabase/supabase-js/2.12.0: resolution: - { integrity: sha512-FkaPZjVx1oY4boS02kAoNhmdyy5hrezxGlY8lZdQwKvk7ee5NPiXzjjsGruc6JOS1QNeuWIUAw1L7uKVYI30dA== } + { integrity: sha512-tHV4KqlPHuPt4uPu+nYwQTEp+mU7Qc0h42EyRW7rsAGGo8bmKIOGnZjyDDc5lxg0CW7OF5R5oMQWmtuuXZh00Q== } dependencies: '@supabase/functions-js': 2.1.0 '@supabase/gotrue-js': 2.15.0 @@ -1459,9 +1459,9 @@ packages: { integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== } dev: true - /@types/mdast/3.0.10: + /@types/mdast/3.0.11: resolution: - { integrity: sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA== } + { integrity: sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw== } dependencies: '@types/unist': 2.0.6 dev: false @@ -1471,9 +1471,9 @@ packages: { integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== } dev: false - /@types/node/18.15.3: + /@types/node/18.15.5: resolution: - { integrity: sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw== } + { integrity: sha512-Ark2WDjjZO7GmvsyFFf81MXuGTA/d6oP38anyxWOL6EREyBKAxKoFHwBhaZxCfLRLpO8JgVXwqOwSwa7jRcjew== } /@types/parse5/6.0.3: resolution: @@ -1527,12 +1527,12 @@ packages: resolution: { integrity: sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ== } dependencies: - '@types/node': 18.15.3 + '@types/node': 18.15.5 dev: false - /@typescript-eslint/eslint-plugin/5.55.0_342y7v4tc7ytrrysmit6jo4wri: + /@typescript-eslint/eslint-plugin/5.56.0_iskin7c6dxqunwflhstekcjqmq: resolution: - { integrity: sha512-IZGc50rtbjk+xp5YQoJvmMPmJEYoC53SiKPXyqWfv15XoD2Y5Kju6zN0DwlmaGJp1Iw33JsWJcQ7nw0lGCGjVg== } + { integrity: sha512-ZNW37Ccl3oMZkzxrYDUX4o7cnuPgU+YrcaYXzsRtLB16I1FR5SHMqga3zGsaSliZADCWo2v8qHWqAYIj8nWCCg== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -1543,10 +1543,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.4.0 - '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m - '@typescript-eslint/scope-manager': 5.55.0 - '@typescript-eslint/type-utils': 5.55.0_vgl77cfdswitgr47lm5swmv43m - '@typescript-eslint/utils': 5.55.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/parser': 5.56.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/scope-manager': 5.56.0 + '@typescript-eslint/type-utils': 5.56.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/utils': 5.56.0_vgl77cfdswitgr47lm5swmv43m debug: 4.3.4 eslint: 8.36.0 grapheme-splitter: 1.0.4 @@ -1559,9 +1559,9 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.55.0_vgl77cfdswitgr47lm5swmv43m: + /@typescript-eslint/parser/5.56.0_vgl77cfdswitgr47lm5swmv43m: resolution: - { integrity: sha512-ppvmeF7hvdhUUZWSd2EEWfzcFkjJzgNQzVST22nzg958CR+sphy8A6K7LXQZd6V75m1VKjp+J4g/PCEfSCmzhw== } + { integrity: sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1570,9 +1570,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.55.0 - '@typescript-eslint/types': 5.55.0 - '@typescript-eslint/typescript-estree': 5.55.0_typescript@4.9.5 + '@typescript-eslint/scope-manager': 5.56.0 + '@typescript-eslint/types': 5.56.0 + '@typescript-eslint/typescript-estree': 5.56.0_typescript@4.9.5 debug: 4.3.4 eslint: 8.36.0 typescript: 4.9.5 @@ -1580,18 +1580,18 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager/5.55.0: + /@typescript-eslint/scope-manager/5.56.0: resolution: - { integrity: sha512-OK+cIO1ZGhJYNCL//a3ROpsd83psf4dUJ4j7pdNVzd5DmIk+ffkuUIX2vcZQbEW/IR41DYsfJTB19tpCboxQuw== } + { integrity: sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dependencies: - '@typescript-eslint/types': 5.55.0 - '@typescript-eslint/visitor-keys': 5.55.0 + '@typescript-eslint/types': 5.56.0 + '@typescript-eslint/visitor-keys': 5.56.0 dev: true - /@typescript-eslint/type-utils/5.55.0_vgl77cfdswitgr47lm5swmv43m: + /@typescript-eslint/type-utils/5.56.0_vgl77cfdswitgr47lm5swmv43m: resolution: - { integrity: sha512-ObqxBgHIXj8rBNm0yh8oORFrICcJuZPZTqtAFh0oZQyr5DnAHZWfyw54RwpEEH+fD8suZaI0YxvWu5tYE/WswA== } + { integrity: sha512-8WxgOgJjWRy6m4xg9KoSHPzBNZeQbGlQOH7l2QEhQID/+YseaFxg5J/DLwWSsi9Axj4e/cCiKx7PVzOq38tY4A== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: eslint: '*' @@ -1600,8 +1600,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.55.0_typescript@4.9.5 - '@typescript-eslint/utils': 5.55.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/typescript-estree': 5.56.0_typescript@4.9.5 + '@typescript-eslint/utils': 5.56.0_vgl77cfdswitgr47lm5swmv43m debug: 4.3.4 eslint: 8.36.0 tsutils: 3.21.0_typescript@4.9.5 @@ -1610,15 +1610,15 @@ packages: - supports-color dev: true - /@typescript-eslint/types/5.55.0: + /@typescript-eslint/types/5.56.0: resolution: - { integrity: sha512-M4iRh4AG1ChrOL6Y+mETEKGeDnT7Sparn6fhZ5LtVJF1909D5O4uqK+C5NPbLmpfZ0XIIxCdwzKiijpZUOvOug== } + { integrity: sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dev: true - /@typescript-eslint/typescript-estree/5.55.0_typescript@4.9.5: + /@typescript-eslint/typescript-estree/5.56.0_typescript@4.9.5: resolution: - { integrity: sha512-I7X4A9ovA8gdpWMpr7b1BN9eEbvlEtWhQvpxp/yogt48fy9Lj3iE3ild/1H3jKBBIYj5YYJmS2+9ystVhC7eaQ== } + { integrity: sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: typescript: '*' @@ -1626,8 +1626,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.55.0 - '@typescript-eslint/visitor-keys': 5.55.0 + '@typescript-eslint/types': 5.56.0 + '@typescript-eslint/visitor-keys': 5.56.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1638,9 +1638,9 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.55.0_vgl77cfdswitgr47lm5swmv43m: + /@typescript-eslint/utils/5.56.0_vgl77cfdswitgr47lm5swmv43m: resolution: - { integrity: sha512-FkW+i2pQKcpDC3AY6DU54yl8Lfl14FVGYDgBTyGKB75cCwV3KpkpTMFi9d9j2WAJ4271LR2HeC5SEWF/CZmmfw== } + { integrity: sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -1648,9 +1648,9 @@ packages: '@eslint-community/eslint-utils': 4.3.0_eslint@8.36.0 '@types/json-schema': 7.0.11 '@types/semver': 7.3.13 - '@typescript-eslint/scope-manager': 5.55.0 - '@typescript-eslint/types': 5.55.0 - '@typescript-eslint/typescript-estree': 5.55.0_typescript@4.9.5 + '@typescript-eslint/scope-manager': 5.56.0 + '@typescript-eslint/types': 5.56.0 + '@typescript-eslint/typescript-estree': 5.56.0_typescript@4.9.5 eslint: 8.36.0 eslint-scope: 5.1.1 semver: 7.3.8 @@ -1659,12 +1659,12 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys/5.55.0: + /@typescript-eslint/visitor-keys/5.56.0: resolution: - { integrity: sha512-q2dlHHwWgirKh1D3acnuApXG+VNXpEY5/AwRxDVuEQpxWaB0jCDe0jFMVMALJ3ebSfuOVE8/rMS+9ZOYGg1GWw== } + { integrity: sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q== } engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dependencies: - '@typescript-eslint/types': 5.55.0 + '@typescript-eslint/types': 5.56.0 eslint-visitor-keys: 3.3.0 dev: true @@ -2080,7 +2080,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001468 - electron-to-chromium: 1.4.333 + electron-to-chromium: 1.4.334 node-releases: 2.0.10 update-browserslist-db: 1.0.10_browserslist@4.21.5 @@ -2495,9 +2495,9 @@ packages: { integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== } dev: true - /electron-to-chromium/1.4.333: + /electron-to-chromium/1.4.334: resolution: - { integrity: sha512-YyE8+GKyGtPEP1/kpvqsdhD6rA/TP1DUFDN4uiU/YI52NzDxmwHkEb3qjId8hLBa5siJvG0sfC3O66501jMruQ== } + { integrity: sha512-laZ1odk+TRen6q0GeyQx/JEkpD3iSZT7ewopCpKqg9bTjP1l8XRfU3Bg20CFjNPZkp5+NDBl3iqd4o/kPO+Vew== } /emoji-regex/8.0.0: resolution: @@ -2663,11 +2663,11 @@ packages: dependencies: '@next/eslint-plugin-next': 13.2.4 '@rushstack/eslint-patch': 1.2.0 - '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/parser': 5.56.0_vgl77cfdswitgr47lm5swmv43m eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 eslint-import-resolver-typescript: 3.5.3_eakrjjutlgqjxe5ydhtnd4qdmy - eslint-plugin-import: 2.27.5_v7jo3sddp7aqau7pajjy572cju + eslint-plugin-import: 2.27.5_as6wyplljmmarlclp2tx3tj6rq eslint-plugin-jsx-a11y: 6.7.1_eslint@8.36.0 eslint-plugin-react: 7.32.2_eslint@8.36.0 eslint-plugin-react-hooks: 4.6.0_eslint@8.36.0 @@ -2677,9 +2677,9 @@ packages: - supports-color dev: true - /eslint-config-prettier/8.7.0_eslint@8.36.0: + /eslint-config-prettier/8.8.0_eslint@8.36.0: resolution: - { integrity: sha512-HHVXLSlVUhMSmyW4ZzEuvjpwqamgmlfkutD53cYXLikh4pt/modINRcCIApJ84czDxM4GZInwUrromsDdTImTA== } + { integrity: sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== } hasBin: true peerDependencies: eslint: '>=7.0.0' @@ -2709,7 +2709,7 @@ packages: debug: 4.3.4 enhanced-resolve: 5.12.0 eslint: 8.36.0 - eslint-plugin-import: 2.27.5_v7jo3sddp7aqau7pajjy572cju + eslint-plugin-import: 2.27.5_as6wyplljmmarlclp2tx3tj6rq get-tsconfig: 4.4.0 globby: 13.1.3 is-core-module: 2.11.0 @@ -2719,7 +2719,7 @@ packages: - supports-color dev: true - /eslint-module-utils/2.7.4_wgltsi2kbncdpzwytonvdf2oba: + /eslint-module-utils/2.7.4_ab4tb467oik4rhsaavmctlutka: resolution: { integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA== } engines: { node: '>=4' } @@ -2741,7 +2741,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/parser': 5.56.0_vgl77cfdswitgr47lm5swmv43m debug: 3.2.7 eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 @@ -2750,7 +2750,7 @@ packages: - supports-color dev: true - /eslint-plugin-import/2.27.5_v7jo3sddp7aqau7pajjy572cju: + /eslint-plugin-import/2.27.5_as6wyplljmmarlclp2tx3tj6rq: resolution: { integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow== } engines: { node: '>=4' } @@ -2761,7 +2761,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.55.0_vgl77cfdswitgr47lm5swmv43m + '@typescript-eslint/parser': 5.56.0_vgl77cfdswitgr47lm5swmv43m array-includes: 3.1.6 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 @@ -2769,7 +2769,7 @@ packages: doctrine: 2.1.0 eslint: 8.36.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4_wgltsi2kbncdpzwytonvdf2oba + eslint-module-utils: 2.7.4_ab4tb467oik4rhsaavmctlutka has: 1.0.3 is-core-module: 2.11.0 is-glob: 4.0.3 @@ -4084,7 +4084,7 @@ packages: resolution: { integrity: sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 '@types/unist': 2.0.6 unist-util-visit: 4.1.2 dev: false @@ -4093,7 +4093,7 @@ packages: resolution: { integrity: sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 escape-string-regexp: 5.0.0 unist-util-is: 5.2.1 unist-util-visit-parents: 5.1.3 @@ -4103,7 +4103,7 @@ packages: resolution: { integrity: sha512-HN3W1gRIuN/ZW295c7zi7g9lVBllMgZE40RxCX37wrTPWXCWtpvOZdfnuK+1WNpvZje6XuJeI3Wnb4TJEUem+g== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 '@types/unist': 2.0.6 decode-named-character-reference: 1.0.2 mdast-util-to-string: 3.1.1 @@ -4123,7 +4123,7 @@ packages: resolution: { integrity: sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 ccount: 2.0.1 mdast-util-find-and-replace: 2.2.2 micromark-util-character: 1.1.0 @@ -4133,7 +4133,7 @@ packages: resolution: { integrity: sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 mdast-util-to-markdown: 1.5.0 micromark-util-normalize-identifier: 1.0.0 dev: false @@ -4142,7 +4142,7 @@ packages: resolution: { integrity: sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 mdast-util-to-markdown: 1.5.0 dev: false @@ -4150,7 +4150,7 @@ packages: resolution: { integrity: sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 markdown-table: 3.0.3 mdast-util-from-markdown: 1.3.0 mdast-util-to-markdown: 1.5.0 @@ -4162,7 +4162,7 @@ packages: resolution: { integrity: sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 mdast-util-to-markdown: 1.5.0 dev: false @@ -4185,7 +4185,7 @@ packages: resolution: { integrity: sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 unist-util-is: 5.2.1 dev: false @@ -4194,7 +4194,7 @@ packages: { integrity: sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw== } dependencies: '@types/hast': 2.3.4 - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 mdast-util-definitions: 5.1.2 micromark-util-sanitize-uri: 1.1.0 trim-lines: 3.0.1 @@ -4207,7 +4207,7 @@ packages: resolution: { integrity: sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 '@types/unist': 2.0.6 longest-streak: 3.1.0 mdast-util-phrasing: 3.0.1 @@ -4221,7 +4221,7 @@ packages: resolution: { integrity: sha512-tGvhT94e+cVnQt8JWE9/b3cUQZWS732TJxXHktvP+BYo62PpYD53Ls/6cC60rW21dW+txxiM4zMdc6abASvZKA== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 dev: false /memoize-one/5.2.1: @@ -5513,7 +5513,7 @@ packages: resolution: { integrity: sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 mdast-util-gfm: 2.0.2 micromark-extension-gfm: 2.0.1 unified: 10.1.2 @@ -5525,7 +5525,7 @@ packages: resolution: { integrity: sha512-1fUyHr2jLsVOkhbvPRBJ5zTKZZyD6yZzYaWCS6BPBdQ8vEMBCH+9zNCDA6tET/zHCi/jLqjCWtlJZUPk+DbnFw== } dependencies: - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 mdast-util-from-markdown: 1.3.0 unified: 10.1.2 transitivePeerDependencies: @@ -5537,7 +5537,7 @@ packages: { integrity: sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw== } dependencies: '@types/hast': 2.3.4 - '@types/mdast': 3.0.10 + '@types/mdast': 3.0.11 mdast-util-to-hast: 12.3.0 unified: 10.1.2 dev: false diff --git a/src/components/note/content/index.tsx b/src/components/note/content/index.tsx index 3b63599b..1ff240f5 100644 --- a/src/components/note/content/index.tsx +++ b/src/components/note/content/index.tsx @@ -10,9 +10,9 @@ export const Content = memo(function Content({ data }: { data: any }) { const content = useMemo(() => { let parsedContent; // get data tags - const tags = JSON.parse(data.tags); + const tags = data.tags ? JSON.parse(data.tags) : null; // remove all image urls - parsedContent = data.content.replace(/(https?:\/\/.*\.(jpg|jpeg|gif|png|webp)((\?.*)$|$))/gim, ''); + parsedContent = data.content.replace(/(https?:\/\/.*\.(jpg|jpeg|gif|png|webp|mp4|webm)((\?.*)$|$))/gim, ''); // handle urls parsedContent = reactStringReplace(parsedContent, /(https?:\/\/\S+)/g, (match, i) => ( @@ -21,12 +21,21 @@ export const Content = memo(function Content({ data }: { data: any }) { )); // handle hashtags parsedContent = reactStringReplace(parsedContent, /#(\w+)/g, (match, i) => ( - #{match} + + #{match} + )); // handle mentions - parsedContent = reactStringReplace(parsedContent, /\#\[(\d+)\]/gm, (match, i) => ( - - )); + if (tags) { + parsedContent = reactStringReplace(parsedContent, /\#\[(\d+)\]/gm, (match, i) => { + if (tags[match][0] === 'p') { + return ; + } else { + // #TODO: handle mention other note + console.log(tags[match]); + } + }); + } return parsedContent; }, [data.content, data.tags]); diff --git a/src/components/note/root.tsx b/src/components/note/root.tsx index 8282ef5c..eed878d7 100644 --- a/src/components/note/root.tsx +++ b/src/components/note/root.tsx @@ -3,7 +3,7 @@ import { RelayContext } from '@components/contexts/relay'; import { Content } from '@components/note/content'; import useLocalStorage from '@rehooks/local-storage'; -import { memo, useCallback, useContext, useEffect, useState } from 'react'; +import { memo, useCallback, useContext, useMemo, useState } from 'react'; export const RootNote = memo(function RootNote({ id }: { id: string }) { const { db }: any = useContext(DatabaseContext); @@ -53,7 +53,7 @@ export const RootNote = memo(function RootNote({ id }: { id: string }) { ); }, [id, insertDB, relayPool, relays]); - useEffect(() => { + useMemo(() => { getData() .then((res) => { if (res) { diff --git a/src/components/user/base.tsx b/src/components/user/base.tsx index 993d124f..49654533 100644 --- a/src/components/user/base.tsx +++ b/src/components/user/base.tsx @@ -4,7 +4,7 @@ import { ImageWithFallback } from '@components/imageWithFallback'; import { truncate } from '@utils/truncate'; import Avatar from 'boring-avatars'; -import { memo, useCallback, useContext, useEffect, useState } from 'react'; +import { memo, useCallback, useContext, useMemo, useState } from 'react'; export const UserBase = memo(function UserBase({ pubkey }: { pubkey: string }) { const { db }: any = useContext(DatabaseContext); @@ -20,7 +20,7 @@ export const UserBase = memo(function UserBase({ pubkey }: { pubkey: string }) { [db, pubkey] ); - useEffect(() => { + useMemo(() => { fetch(`https://rbr.bio/${pubkey}/metadata.json`, { redirect: 'follow' }) .then((response) => { if (response.ok) { diff --git a/src/components/user/extend.tsx b/src/components/user/extend.tsx index 168b07f8..7b298834 100644 --- a/src/components/user/extend.tsx +++ b/src/components/user/extend.tsx @@ -7,7 +7,7 @@ import { DotsHorizontalIcon } from '@radix-ui/react-icons'; import Avatar from 'boring-avatars'; import dayjs from 'dayjs'; import relativeTime from 'dayjs/plugin/relativeTime'; -import { memo, useCallback, useContext, useEffect, useState } from 'react'; +import { memo, useCallback, useContext, useMemo, useState } from 'react'; dayjs.extend(relativeTime); @@ -30,7 +30,7 @@ export const UserExtend = memo(function UserExtend({ pubkey, time }: { pubkey: s return result[0]; }, [db, pubkey]); - useEffect(() => { + useMemo(() => { getCacheProfile() .then((res) => { if (res !== undefined) { diff --git a/src/components/user/mention.tsx b/src/components/user/mention.tsx index 5b5ab538..a9edab14 100644 --- a/src/components/user/mention.tsx +++ b/src/components/user/mention.tsx @@ -2,7 +2,7 @@ import { DatabaseContext } from '@components/contexts/database'; import { truncate } from '@utils/truncate'; -import { memo, useCallback, useContext, useEffect, useState } from 'react'; +import { memo, useCallback, useContext, useMemo, useState } from 'react'; export const UserMention = memo(function UserMention({ pubkey }: { pubkey: string }) { const { db }: any = useContext(DatabaseContext); @@ -23,7 +23,7 @@ export const UserMention = memo(function UserMention({ pubkey }: { pubkey: strin return result[0]; }, [db, pubkey]); - useEffect(() => { + useMemo(() => { getCacheProfile() .then((res) => { if (res !== undefined) { diff --git a/src/components/user/mini.tsx b/src/components/user/mini.tsx index 334cf700..9d6fafed 100644 --- a/src/components/user/mini.tsx +++ b/src/components/user/mini.tsx @@ -4,7 +4,7 @@ import { ImageWithFallback } from '@components/imageWithFallback'; import { truncate } from '@utils/truncate'; import Avatar from 'boring-avatars'; -import { memo, useCallback, useContext, useEffect, useState } from 'react'; +import { memo, useCallback, useContext, useMemo, useState } from 'react'; export const UserMini = memo(function UserMini({ pubkey }: { pubkey: string }) { const { db }: any = useContext(DatabaseContext); @@ -25,7 +25,7 @@ export const UserMini = memo(function UserMini({ pubkey }: { pubkey: string }) { return result[0]; }, [db, pubkey]); - useEffect(() => { + useMemo(() => { getCacheProfile() .then((res) => { if (res !== undefined) { diff --git a/src/pages/newsfeed/following.tsx b/src/pages/newsfeed/following.tsx index 903fcb99..0826bbf5 100644 --- a/src/pages/newsfeed/following.tsx +++ b/src/pages/newsfeed/following.tsx @@ -12,7 +12,7 @@ import { dateToUnix } from '@utils/getDate'; import { useAtom } from 'jotai'; import { Key, useCallback, useState } from 'react'; -import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal, useContext, useEffect, useRef } from 'react'; +import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal, useContext, useMemo, useRef } from 'react'; import { Virtuoso } from 'react-virtuoso'; export default function Page() { @@ -70,7 +70,7 @@ export default function Page() { [data] ); - useEffect(() => { + useMemo(() => { const getData = async () => { const result = await db.select(`SELECT * FROM cache_notes ORDER BY created_at DESC LIMIT ${limit.current}`); if (result.length > 0) {