From 9a4f57d07206c9a4783409c9dfc49b21ad925805 Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 12:32:10 +0530 Subject: [PATCH 01/14] refactor: Layout component imports and remove unused code --- apps/web/src/components/Common/Layout.tsx | 14 +- yarn.lock | 241 ++++++++++------------ 2 files changed, 112 insertions(+), 143 deletions(-) diff --git a/apps/web/src/components/Common/Layout.tsx b/apps/web/src/components/Common/Layout.tsx index 924df217b..b99aba697 100644 --- a/apps/web/src/components/Common/Layout.tsx +++ b/apps/web/src/components/Common/Layout.tsx @@ -2,11 +2,7 @@ import getCurrentSessionProfileId from '@lib/getCurrentSessionProfileId' import { hydrateAuthTokens, signOut } from '@lib/store/auth' import useNonceStore from '@lib/store/nonce' import useProfileStore from '@lib/store/profile' -import { - getToastOptions, - setFingerprint, - useIsMounted -} from '@tape.xyz/browser' +import { getToastOptions, setFingerprint } from '@tape.xyz/browser' import { AUTH_ROUTES, OWNER_ONLY_ROUTES } from '@tape.xyz/constants' import { getIsProfileOwner, trimify } from '@tape.xyz/generic' import type { Profile } from '@tape.xyz/lens' @@ -35,7 +31,7 @@ const Layout: FC = ({ children, skipNav, skipPadding }) => { const { setLensHubOnchainSigNonce } = useNonceStore() const { activeProfile, setActiveProfile } = useProfileStore() - const isMounted = useIsMounted() + // const isMounted = useIsMounted() const { resolvedTheme } = useTheme() const { address, connector } = useAccount() const { pathname, replace, asPath } = useRouter() @@ -104,9 +100,9 @@ const Layout: FC = ({ children, skipNav, skipPadding }) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []) - if (!isMounted()) { - return - } + // if (!isMounted()) { + // return + // } if (loading) { return diff --git a/yarn.lock b/yarn.lock index 24e1e9bce..6a5b13fd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2068,9 +2068,9 @@ integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== "@eslint/eslintrc@^2.1.2": - version "2.1.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.2.tgz#c6936b4b328c64496692f76944e755738be62396" - integrity sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g== + version "2.1.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.3.tgz#797470a75fe0fbd5a53350ee715e85e87baff22d" + integrity sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -2329,11 +2329,6 @@ "@ethersproject/logger" "^5.7.0" hash.js "1.1.7" -"@ethersproject/shims@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/shims/-/shims-5.7.0.tgz#ee32e543418595774029c5ea6123ea8995e7e154" - integrity sha512-WeDptc6oAprov5CCN2LJ/6/+dC9gTonnkdAtLepm/7P5Z+3PRxS5NpfVWmOMs1yE4Vitl2cU8bOPWC0GvGSbVg== - "@ethersproject/signing-key@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" @@ -5027,9 +5022,9 @@ viem "^1.0.0" "@safe-global/safe-gateway-typescript-sdk@^3.5.3": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@safe-global/safe-gateway-typescript-sdk/-/safe-gateway-typescript-sdk-3.13.0.tgz#0aa7e20e16376be0b181d7edacaf8cd8a0112247" - integrity sha512-VfSILoCLhBm6ll815+/SkmP3n9yTEWtT3neyU8951Xgk2C8poWpc9/wpY8iVnOUiQvOIRH+QvzfFlQONGwlcIg== + version "3.13.2" + resolved "https://registry.yarnpkg.com/@safe-global/safe-gateway-typescript-sdk/-/safe-gateway-typescript-sdk-3.13.2.tgz#f03884c7eb766f5508085d95ab96063a28e20920" + integrity sha512-kGlJecJHBzGrGTq/yhLANh56t+Zur6Ubpt+/w03ARX1poDb4TM8vKU3iV8tuYpk359PPWp+Qvjnqb9oW2YQcYw== "@scure/base@~1.1.0", "@scure/base@~1.1.2": version "1.1.3" @@ -6411,10 +6406,10 @@ eventemitter3 "^4.0.7" zustand "^4.3.1" -"@walletconnect/core@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.10.0.tgz#b659de4dfb374becd938964abd4f2150d410e617" - integrity sha512-Z8pdorfIMueuiBXLdnf7yloiO9JIiobuxN3j0OTal+MYc4q5/2O7d+jdD1DAXbLi1taJx3x60UXT/FPVkjIqIQ== +"@walletconnect/core@2.10.2": + version "2.10.2" + resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.10.2.tgz#a1bf6e3e87b33f9df795ce0970d8ddd400fdc8a3" + integrity sha512-JQz/xp3SLEpTeRQctdck2ugSBVEpMxoSE+lFi2voJkZop1hv6P+uqr6E4PzjFluAjeAnKlT1xvra0aFWjPWVcw== dependencies: "@walletconnect/heartbeat" "1.2.1" "@walletconnect/jsonrpc-provider" "1.0.13" @@ -6427,16 +6422,16 @@ "@walletconnect/relay-auth" "^1.0.4" "@walletconnect/safe-json" "^1.0.2" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.0" - "@walletconnect/utils" "2.10.0" + "@walletconnect/types" "2.10.2" + "@walletconnect/utils" "2.10.2" events "^3.3.0" lodash.isequal "4.5.0" uint8arrays "^3.1.0" -"@walletconnect/core@2.10.2": - version "2.10.2" - resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.10.2.tgz#a1bf6e3e87b33f9df795ce0970d8ddd400fdc8a3" - integrity sha512-JQz/xp3SLEpTeRQctdck2ugSBVEpMxoSE+lFi2voJkZop1hv6P+uqr6E4PzjFluAjeAnKlT1xvra0aFWjPWVcw== +"@walletconnect/core@2.10.4": + version "2.10.4" + resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.10.4.tgz#da9396b56f63806c165389cbf98d2373d36854df" + integrity sha512-MGdw5a4dIlQFPxVHEw2neIpHPAw3gtrsJYyUqm6rI+1c1SfmZyOPCaYTr6zPU2cnoWQUjv2ePMLeO/JKy3Yh5g== dependencies: "@walletconnect/heartbeat" "1.2.1" "@walletconnect/jsonrpc-provider" "1.0.13" @@ -6449,8 +6444,8 @@ "@walletconnect/relay-auth" "^1.0.4" "@walletconnect/safe-json" "^1.0.2" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.2" - "@walletconnect/utils" "2.10.2" + "@walletconnect/types" "2.10.4" + "@walletconnect/utils" "2.10.4" events "^3.3.0" lodash.isequal "4.5.0" uint8arrays "^3.1.0" @@ -6646,16 +6641,15 @@ valtio "1.11.2" "@walletconnect/modal-react-native@^1.0.0-rc.11": - version "1.0.0-rc.11" - resolved "https://registry.yarnpkg.com/@walletconnect/modal-react-native/-/modal-react-native-1.0.0-rc.11.tgz#4cee6a69f273484c3d7c19fb786a6082ff8519fe" - integrity sha512-DZbpLj5OzwGHeBiRiGb0jIZTKOPW3uMtFmPjC71I19hYnjo4HkdLtB5RMzL27CbL3xFsTq8UEUC9G53dMecm6w== - dependencies: - "@ethersproject/shims" "5.7.0" - "@walletconnect/core" "2.10.0" - "@walletconnect/react-native-compat" "2.10.0" - "@walletconnect/universal-provider" "2.10.0" + version "1.0.0-rc.13" + resolved "https://registry.yarnpkg.com/@walletconnect/modal-react-native/-/modal-react-native-1.0.0-rc.13.tgz#0347522fa40c081a90f35cb30a6fd66733a4b723" + integrity sha512-r02YCg5J05FwY5QRnyb6Uajs+H19ggM1G05JMwE5tEA96m0bpZt62kgt3Tst2Bzd3aUJZiQaiS3qdLEui+NjrQ== + dependencies: + "@walletconnect/core" "2.10.4" + "@walletconnect/react-native-compat" "2.10.4" + "@walletconnect/universal-provider" "2.10.4" qrcode "1.5.3" - valtio "1.10.5" + valtio "1.11.3" "@walletconnect/modal-ui@2.6.2": version "2.6.2" @@ -6685,10 +6679,10 @@ randombytes "^2.1.0" tslib "1.14.1" -"@walletconnect/react-native-compat@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/react-native-compat/-/react-native-compat-2.10.0.tgz#6254b23a22d371e7890ed957cf7950ee5b9eafc7" - integrity sha512-7u0ykp1gz+7UoYp3miAfm6fTjsDUEHjGB2RXSeYjCX5ikVN6rJl0USMzBmM52pYTtAVFG9QT25Tt2bGk2rHOjw== +"@walletconnect/react-native-compat@2.10.4": + version "2.10.4" + resolved "https://registry.yarnpkg.com/@walletconnect/react-native-compat/-/react-native-compat-2.10.4.tgz#2d28b61e63ab69b6d364d3946bdb13753bdecf30" + integrity sha512-U19UHlVfxBWO1Vslmx1W8mU5xbyejzDKeXOsK61nlByzc1SzPZUz5s6o4TTBox5ILBNOoZUitUY2d+vgfnKg8g== dependencies: events "3.3.0" fast-text-encoding "^1.0.6" @@ -6721,34 +6715,34 @@ dependencies: tslib "1.14.1" -"@walletconnect/sign-client@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.10.0.tgz#0fee8f12821e37783099f0c7bd64e6efdfbd9d86" - integrity sha512-hbDljDS53kR/It3oXD91UkcOsT6diNnW5+Zzksm0YEfwww5dop/YfNlcdnc8+jKUhWOL/YDPNQCjzsCSNlVzbw== +"@walletconnect/sign-client@2.10.2": + version "2.10.2" + resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.10.2.tgz#33300a9cfe42487473f66b73c99535f6b26f8c54" + integrity sha512-vviSLV3f92I0bReX+OLr1HmbH0uIzYEQQFd1MzIfDk9PkfFT/LLAHhUnDaIAMkIdippqDcJia+5QEtT4JihL3Q== dependencies: - "@walletconnect/core" "2.10.0" + "@walletconnect/core" "2.10.2" "@walletconnect/events" "^1.0.1" "@walletconnect/heartbeat" "1.2.1" "@walletconnect/jsonrpc-utils" "1.0.8" "@walletconnect/logger" "^2.0.1" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.0" - "@walletconnect/utils" "2.10.0" + "@walletconnect/types" "2.10.2" + "@walletconnect/utils" "2.10.2" events "^3.3.0" -"@walletconnect/sign-client@2.10.2": - version "2.10.2" - resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.10.2.tgz#33300a9cfe42487473f66b73c99535f6b26f8c54" - integrity sha512-vviSLV3f92I0bReX+OLr1HmbH0uIzYEQQFd1MzIfDk9PkfFT/LLAHhUnDaIAMkIdippqDcJia+5QEtT4JihL3Q== +"@walletconnect/sign-client@2.10.4": + version "2.10.4" + resolved "https://registry.yarnpkg.com/@walletconnect/sign-client/-/sign-client-2.10.4.tgz#4e3b14ebe900472874f4cae5f53c74a6077c85da" + integrity sha512-C5VHkK59/DQNrJS91UXLn5OSr0drXHkKjajhl2a9hb3h6kxuSdlWbyC0yRPKT1sD0fQho8+EWZHBiV063yBePw== dependencies: - "@walletconnect/core" "2.10.2" + "@walletconnect/core" "2.10.4" "@walletconnect/events" "^1.0.1" "@walletconnect/heartbeat" "1.2.1" "@walletconnect/jsonrpc-utils" "1.0.8" "@walletconnect/logger" "^2.0.1" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.2" - "@walletconnect/utils" "2.10.2" + "@walletconnect/types" "2.10.4" + "@walletconnect/utils" "2.10.4" events "^3.3.0" "@walletconnect/time@^1.0.2": @@ -6758,10 +6752,10 @@ dependencies: tslib "1.14.1" -"@walletconnect/types@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.10.0.tgz#5d63235b49e03d609521402a4b49627dbc4ed514" - integrity sha512-kSTA/WZnbKdEbvbXSW16Ty6dOSzOZCHnGg6JH7q1MuraalD2HuNg00lVVu7QAZ/Rj1Gn9DAkrgP5Wd5a8Xq//Q== +"@walletconnect/types@2.10.2": + version "2.10.2" + resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.10.2.tgz#68e433a29ec2cf42d79d8b50c77bd5c1d91db721" + integrity sha512-luNV+07Wdla4STi9AejseCQY31tzWKQ5a7C3zZZaRK/di+rFaAAb7YW04OP4klE7tw/mJRGPTlekZElmHxO8kQ== dependencies: "@walletconnect/events" "^1.0.1" "@walletconnect/heartbeat" "1.2.1" @@ -6770,10 +6764,10 @@ "@walletconnect/logger" "^2.0.1" events "^3.3.0" -"@walletconnect/types@2.10.2": - version "2.10.2" - resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.10.2.tgz#68e433a29ec2cf42d79d8b50c77bd5c1d91db721" - integrity sha512-luNV+07Wdla4STi9AejseCQY31tzWKQ5a7C3zZZaRK/di+rFaAAb7YW04OP4klE7tw/mJRGPTlekZElmHxO8kQ== +"@walletconnect/types@2.10.4": + version "2.10.4" + resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-2.10.4.tgz#23f6e4bd785671812dc6ea96848a6bd7ea78f038" + integrity sha512-eQpOElyiwJp3tepuOS3TS9dXTl9jVVlrC3iVA8bytnbLagkAUxmiv/s7PyDFx+ndXwQVh8PFBkWg1oxGwgCSBA== dependencies: "@walletconnect/events" "^1.0.1" "@walletconnect/heartbeat" "1.2.1" @@ -6782,40 +6776,40 @@ "@walletconnect/logger" "^2.0.1" events "^3.3.0" -"@walletconnect/universal-provider@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/universal-provider/-/universal-provider-2.10.0.tgz#565d6478dcb5cc66955e5f03d6a00f51c9bcac14" - integrity sha512-jtVWf+AeTCqBcB3lCmWkv3bvSmdRCkQdo67GNoT5y6/pvVHMxfjgrJNBOUsWQMxpREpWDpZ993X0JRjsYVsMcA== +"@walletconnect/universal-provider@2.10.2": + version "2.10.2" + resolved "https://registry.yarnpkg.com/@walletconnect/universal-provider/-/universal-provider-2.10.2.tgz#85c8da39f65da8fe33f65f62689e703607b5ddc5" + integrity sha512-wFgI0LbQ3D56sgaUMsgOHCM5m8WLxiC71BGuCKQfApgsbNMVKugYVy2zWHyUyi8sqTQHI+uSaVpDev4UHq9LEw== dependencies: "@walletconnect/jsonrpc-http-connection" "^1.0.7" "@walletconnect/jsonrpc-provider" "1.0.13" "@walletconnect/jsonrpc-types" "^1.0.2" "@walletconnect/jsonrpc-utils" "^1.0.7" "@walletconnect/logger" "^2.0.1" - "@walletconnect/sign-client" "2.10.0" - "@walletconnect/types" "2.10.0" - "@walletconnect/utils" "2.10.0" + "@walletconnect/sign-client" "2.10.2" + "@walletconnect/types" "2.10.2" + "@walletconnect/utils" "2.10.2" events "^3.3.0" -"@walletconnect/universal-provider@2.10.2": - version "2.10.2" - resolved "https://registry.yarnpkg.com/@walletconnect/universal-provider/-/universal-provider-2.10.2.tgz#85c8da39f65da8fe33f65f62689e703607b5ddc5" - integrity sha512-wFgI0LbQ3D56sgaUMsgOHCM5m8WLxiC71BGuCKQfApgsbNMVKugYVy2zWHyUyi8sqTQHI+uSaVpDev4UHq9LEw== +"@walletconnect/universal-provider@2.10.4": + version "2.10.4" + resolved "https://registry.yarnpkg.com/@walletconnect/universal-provider/-/universal-provider-2.10.4.tgz#601604d11320531594dab928ef2af88b19dda74c" + integrity sha512-f9uhRQX9iExoMz1V4JT13OpqvpoJYhE9GLvuwNWposhDS35vVKfQfmPxQCcsdw7IpMr+UdpA8K2ShPh8g9wT4g== dependencies: "@walletconnect/jsonrpc-http-connection" "^1.0.7" "@walletconnect/jsonrpc-provider" "1.0.13" "@walletconnect/jsonrpc-types" "^1.0.2" "@walletconnect/jsonrpc-utils" "^1.0.7" "@walletconnect/logger" "^2.0.1" - "@walletconnect/sign-client" "2.10.2" - "@walletconnect/types" "2.10.2" - "@walletconnect/utils" "2.10.2" + "@walletconnect/sign-client" "2.10.4" + "@walletconnect/types" "2.10.4" + "@walletconnect/utils" "2.10.4" events "^3.3.0" -"@walletconnect/utils@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.10.0.tgz#6918d12180d797b8bd4a19fb2ff128e394e181d6" - integrity sha512-9GRyEz/7CJW+G04RvrjPET5k7hOEsB9b3fF9cWDk/iDCxSWpbkU/hv/urRB36C+gvQMAZgIZYX3dHfzJWkY/2g== +"@walletconnect/utils@2.10.2": + version "2.10.2" + resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.10.2.tgz#1f2c6a2f1bb95bcc4517b1e94aa7164c9286eb46" + integrity sha512-syxXRpc2yhSknMu3IfiBGobxOY7fLfLTJuw+ppKaeO6WUdZpIit3wfuGOcc0Ms3ZPFCrGfyGOoZsCvgdXtptRg== dependencies: "@stablelib/chacha20poly1305" "1.0.1" "@stablelib/hkdf" "1.0.1" @@ -6825,17 +6819,17 @@ "@walletconnect/relay-api" "^1.0.9" "@walletconnect/safe-json" "^1.0.2" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.0" + "@walletconnect/types" "2.10.2" "@walletconnect/window-getters" "^1.0.1" "@walletconnect/window-metadata" "^1.0.1" detect-browser "5.3.0" query-string "7.1.3" uint8arrays "^3.1.0" -"@walletconnect/utils@2.10.2": - version "2.10.2" - resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.10.2.tgz#1f2c6a2f1bb95bcc4517b1e94aa7164c9286eb46" - integrity sha512-syxXRpc2yhSknMu3IfiBGobxOY7fLfLTJuw+ppKaeO6WUdZpIit3wfuGOcc0Ms3ZPFCrGfyGOoZsCvgdXtptRg== +"@walletconnect/utils@2.10.4": + version "2.10.4" + resolved "https://registry.yarnpkg.com/@walletconnect/utils/-/utils-2.10.4.tgz#5f17938e7ea481541ec2dbae0df5cd494c72523f" + integrity sha512-XbrKgnQ0hC9DC9wjFb468MEYMoJxnCVmOj2gi01DA4FSr8fJi7wwNRUnlnZzLWrUWrHuaPReYe4PgBAgIv363g== dependencies: "@stablelib/chacha20poly1305" "1.0.1" "@stablelib/hkdf" "1.0.1" @@ -6845,7 +6839,7 @@ "@walletconnect/relay-api" "^1.0.9" "@walletconnect/safe-json" "^1.0.2" "@walletconnect/time" "^1.0.2" - "@walletconnect/types" "2.10.2" + "@walletconnect/types" "2.10.4" "@walletconnect/window-getters" "^1.0.1" "@walletconnect/window-metadata" "^1.0.1" detect-browser "5.3.0" @@ -7607,9 +7601,9 @@ async-retry@^1.3.3: retry "0.13.1" async@^3.2.2: - version "3.2.4" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.4.tgz#2d22e00f8cddeb5fde5dd33522b56d1cf569a81c" - integrity sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ== + version "3.2.5" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66" + integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg== asynciterator.prototype@^1.0.0: version "1.0.0" @@ -9609,9 +9603,9 @@ ee-first@1.1.1: integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== electron-to-chromium@^1.4.535: - version "1.4.574" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.574.tgz#6de04d7c6e244e5ffcae76d2e2a33b02cab66781" - integrity sha512-bg1m8L0n02xRzx4LsTTMbBPiUd9yIR+74iPtS/Ao65CuXvhVZHP0ym1kSdDG3yHFDXqHQQBKujlN1AQ8qZnyFg== + version "1.4.576" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.576.tgz#0c6940fdc0d60f7e34bd742b29d8fa847c9294d1" + integrity sha512-yXsZyXJfAqzWk1WKryr0Wl0MN2D47xodPvEEwlVePBnhU5E7raevLQR+E6b9JAD3GfL/7MbAL9ZtWQQPcLx7wA== electron@^23.1.2: version "23.3.13" @@ -10915,9 +10909,9 @@ flow-enums-runtime@^0.0.5: integrity sha512-PSZF9ZuaZD03sT9YaIs0FrGJ7lSUw7rHZIex+73UYVXg46eL/wxN5PaVcPJFudE2cJu5f0fezitV5aBkLHPUOQ== flow-parser@0.*: - version "0.220.0" - resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.220.0.tgz#de184e9da22b47ead09cf40ab4e781a17149017d" - integrity sha512-Fks+nOCqhorp4NpAtAxf09UaR/9xDf3AnU1UkWczmpneoHh06Y3AoEA4tIe2HbYrOHT9JArUgDZpCFhP4clo1A== + version "0.220.1" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.220.1.tgz#8302ef224e2efb549cccb69fcfb8fb8fb2346668" + integrity sha512-RoM3ARqVYvxnwtkM36RjQFzo5Z9p22jUqtuMrN8gzA/8fU6iMLFE3cXkdSFPyfHRXLU8ILH8TCtSFADk1ACPCg== flow-parser@^0.206.0: version "0.206.0" @@ -12541,9 +12535,9 @@ join-component@^1.1.0: integrity sha512-bF7vcQxbODoGK1imE2P9GS9aw4zD0Sd+Hni68IMZLj7zRnquH7dXUmMw9hDI5S/Jzt7q+IyTXN0rSg2GI0IKhQ== jose@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/jose/-/jose-5.0.1.tgz#a2f0bb241ecfe6ebf37ef435498a491918a1a0e0" - integrity sha512-gRVzy7s3RRdGbXmcTdlOswJOjhwPLx1ijIgAqLY6ktzFpOJxxYn4l0fC2vHaHHi4YBX/5FOL3aY+6W0cvQgpug== + version "5.1.0" + resolved "https://registry.yarnpkg.com/jose/-/jose-5.1.0.tgz#b4dcfa037b3b30ad9d64949b51bc6f173cbd61cf" + integrity sha512-H+RVqxA6apaJ0rcQYupKYhos7uosAiF42gUcWZiwhICWMphDULFj/CRr1R0tV/JCv9DEeJaSyYYpc9luHHNT4g== js-base64@^3.7.2: version "3.7.5" @@ -15120,9 +15114,9 @@ postcss@8.4.31, postcss@^8.3.5, postcss@^8.4.21, postcss@^8.4.23, postcss@^8.4.2 source-map-js "^1.0.2" preact@^10.12.0, preact@^10.5.9: - version "10.18.1" - resolved "https://registry.yarnpkg.com/preact/-/preact-10.18.1.tgz#3b84bb305f0b05f4ad5784b981d15fcec4e105da" - integrity sha512-mKUD7RRkQQM6s7Rkmi7IFkoEHjuFqRQUaXamO61E6Nn7vqF/bo7EZCmSyrUnp2UWHw0O7XjZ2eeXis+m7tf4lg== + version "10.18.2" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.18.2.tgz#e3aeccc292aebbc2e0b76ed76570aa61dd5f75e4" + integrity sha512-X/K43vocUHDg0XhWVmTTMbec4LT/iBMh+csCEqJk+pJqegaXsvjdqN80ZZ3L+93azWCnWCZ+WGwYb8SplxeNjA== prelude-ls@^1.2.1: version "1.2.1" @@ -17727,9 +17721,9 @@ undici-types@~5.26.4: integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== undici@^5.22.1: - version "5.27.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.27.0.tgz#789f2e40ce982b5507899abc2c2ddeb2712b4554" - integrity sha512-l3ydWhlhOJzMVOYkymLykcRRXqbUaQriERtR70B9LzNkZ4bX52Fc8wbTDneMiwo8T+AemZXvXaTx+9o5ROxrXg== + version "5.27.2" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.27.2.tgz#a270c563aea5b46cc0df2550523638c95c5d4411" + integrity sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ== dependencies: "@fastify/busboy" "^2.0.0" @@ -18014,14 +18008,6 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" -valtio@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/valtio/-/valtio-1.10.5.tgz#7852125e3b774b522827d96bd9c76d285c518678" - integrity sha512-jTp0k63VXf4r5hPoaC6a6LCG4POkVSh629WLi1+d5PlajLsbynTMd7qAgEiOSPxzoX5iNvbN7iZ/k/g29wrNiQ== - dependencies: - proxy-compare "2.5.1" - use-sync-external-store "1.2.0" - valtio@1.11.2: version "1.11.2" resolved "https://registry.yarnpkg.com/valtio/-/valtio-1.11.2.tgz#b8049c02dfe65620635d23ebae9121a741bb6530" @@ -18030,6 +18016,14 @@ valtio@1.11.2: proxy-compare "2.5.1" use-sync-external-store "1.2.0" +valtio@1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/valtio/-/valtio-1.11.3.tgz#92aabcc79458f6af7cf3b2b18cbaef34956dcd8f" + integrity sha512-HL50LlM6YrYfai5H9QKSU0HJYOkghyGvZeRMCJSI6q79DWSng0PdCzT3S3M2UAcvtqBSteThqmhh6jHYyxPUTg== + dependencies: + proxy-compare "2.5.1" + use-sync-external-store "1.2.0" + value-or-promise@^1.0.11, value-or-promise@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.12.tgz#0e5abfeec70148c78460a849f6b003ea7986f15c" @@ -18040,21 +18034,7 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== -viem@^1.0.0: - version "1.18.3" - resolved "https://registry.yarnpkg.com/viem/-/viem-1.18.3.tgz#be0ea4ecf0cf22419cb9772720cbd8b1cf6afd35" - integrity sha512-r27eb39MHEXul/k2jZnRVNJY8QhoS816Kqh0guaLVLRJkGGIutryh7z5sKIuhKHU1yz2+CoPaiRn08gGKrfskw== - dependencies: - "@adraffy/ens-normalize" "1.9.4" - "@noble/curves" "1.2.0" - "@noble/hashes" "1.3.2" - "@scure/bip32" "1.3.2" - "@scure/bip39" "1.2.1" - abitype "0.9.8" - isows "1.0.3" - ws "8.13.0" - -viem@^1.18.4: +viem@^1.0.0, viem@^1.18.4: version "1.18.4" resolved "https://registry.yarnpkg.com/viem/-/viem-1.18.4.tgz#2bb17c6e7c4082f06cd8a6ed8a34eedf6e4a3bc9" integrity sha512-im+y30k+IGT6VtfD/q1V0RX5PaiHPsFTHkKqvTjTqV+ZT8RgJXzOGPXr5E0uPIm2cbJAJp6A9nR9BCHY7BKR2Q== @@ -18555,9 +18535,9 @@ yaml@^1.10.2: integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== yaml@^2.1.1, yaml@^2.2.1, yaml@^2.3.1: - version "2.3.3" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.3.tgz#01f6d18ef036446340007db8e016810e5d64aad9" - integrity sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ== + version "2.3.4" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" + integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== yargs-parser@^18.1.2: version "18.1.3" @@ -18646,14 +18626,7 @@ zod@^3.20.6, zod@^3.22.2, zod@^3.22.4: resolved "https://registry.yarnpkg.com/zod/-/zod-3.22.4.tgz#f31c3a9386f61b1f228af56faa9255e845cf3fff" integrity sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg== -zustand@^4.3.1, zustand@^4.3.9: - version "4.4.5" - resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.4.5.tgz#0d5571affb30906b0c07c16557f2779ede9f4d8c" - integrity sha512-jgIrBBLKncQW74PA2Lclct3gwD4aPughwGE4FqlXrv3rDqQox7JCn8rwUiFK6ygJcbBAvfTf8fF+ICg7HLD2FQ== - dependencies: - use-sync-external-store "1.2.0" - -zustand@^4.4.6: +zustand@^4.3.1, zustand@^4.3.9, zustand@^4.4.6: version "4.4.6" resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.4.6.tgz#03c78e3e2686c47095c93714c0c600b72a6512bd" integrity sha512-Rb16eW55gqL4W2XZpJh0fnrATxYEG3Apl2gfHTyDSE965x/zxslTikpNch0JgNjJA9zK6gEFW8Fl6d1rTZaqgg== From f79949752d47ab25d2cb6326ec37eace50f0aade Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 12:41:36 +0530 Subject: [PATCH 02/14] Add useIsMounted hook to Layout component --- apps/web/src/components/Common/Layout.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/web/src/components/Common/Layout.tsx b/apps/web/src/components/Common/Layout.tsx index b99aba697..924df217b 100644 --- a/apps/web/src/components/Common/Layout.tsx +++ b/apps/web/src/components/Common/Layout.tsx @@ -2,7 +2,11 @@ import getCurrentSessionProfileId from '@lib/getCurrentSessionProfileId' import { hydrateAuthTokens, signOut } from '@lib/store/auth' import useNonceStore from '@lib/store/nonce' import useProfileStore from '@lib/store/profile' -import { getToastOptions, setFingerprint } from '@tape.xyz/browser' +import { + getToastOptions, + setFingerprint, + useIsMounted +} from '@tape.xyz/browser' import { AUTH_ROUTES, OWNER_ONLY_ROUTES } from '@tape.xyz/constants' import { getIsProfileOwner, trimify } from '@tape.xyz/generic' import type { Profile } from '@tape.xyz/lens' @@ -31,7 +35,7 @@ const Layout: FC = ({ children, skipNav, skipPadding }) => { const { setLensHubOnchainSigNonce } = useNonceStore() const { activeProfile, setActiveProfile } = useProfileStore() - // const isMounted = useIsMounted() + const isMounted = useIsMounted() const { resolvedTheme } = useTheme() const { address, connector } = useAccount() const { pathname, replace, asPath } = useRouter() @@ -100,9 +104,9 @@ const Layout: FC = ({ children, skipNav, skipPadding }) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []) - // if (!isMounted()) { - // return - // } + if (!isMounted()) { + return + } if (loading) { return From 0e39a21aeb5e78d9544e93692610be34234de7ad Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 12:46:40 +0530 Subject: [PATCH 03/14] Add production browser source maps. --- apps/web/next.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 8074dbd37..dce522ede 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -11,6 +11,7 @@ const moduleExports = { experimental: { scrollRestoration: true }, + productionBrowserSourceMaps: true, async rewrites() { return [ { From b5ed1051467b3f874c5b43e7a2a4658219bf91c8 Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 12:50:47 +0530 Subject: [PATCH 04/14] chore: update VideoCard and imageCdn functions --- apps/web/src/components/Common/VideoCard/index.tsx | 2 +- packages/helpers/generic/functions/imageCdn.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/Common/VideoCard/index.tsx b/apps/web/src/components/Common/VideoCard/index.tsx index 280af038f..d1b6f9db0 100644 --- a/apps/web/src/components/Common/VideoCard/index.tsx +++ b/apps/web/src/components/Common/VideoCard/index.tsx @@ -42,7 +42,7 @@ const VideoCard: FC = ({ video }) => {
Date: Sat, 4 Nov 2023 12:57:39 +0530 Subject: [PATCH 05/14] Update profile picture display in various components --- apps/embed/src/components/VideoOverlay.tsx | 2 +- apps/web/src/components/Common/UserMenu.tsx | 4 ++-- .../src/components/Common/VideoCard/QueuedVideo.tsx | 2 +- .../src/components/Common/VideoCard/StreamCard.tsx | 2 +- .../components/Common/VideoCard/VideoOptions.tsx | 4 ++-- .../src/components/Create/CollectModule/Splits.tsx | 2 +- apps/web/src/components/Login/Authenticate.tsx | 2 +- apps/web/src/components/Login/Authenticated.tsx | 2 +- apps/web/src/components/Notifications/Acted.tsx | 2 +- apps/web/src/components/Notifications/Commented.tsx | 2 +- apps/web/src/components/Notifications/Followed.tsx | 2 +- apps/web/src/components/Notifications/Mentioned.tsx | 2 +- apps/web/src/components/Notifications/Mirrored.tsx | 2 +- apps/web/src/components/Notifications/Quoted.tsx | 2 +- apps/web/src/components/Notifications/Reactions.tsx | 2 +- .../components/Profile/Mutual/MutualFollowers.tsx | 2 +- .../web/src/components/Profile/Tabs/PinnedVideo.tsx | 4 ++-- .../web/src/components/UIElements/InputMentions.tsx | 2 +- .../helpers/generic/functions/getProfilePicture.ts | 13 +++++++++++++ 19 files changed, 34 insertions(+), 21 deletions(-) diff --git a/apps/embed/src/components/VideoOverlay.tsx b/apps/embed/src/components/VideoOverlay.tsx index 288abb6bf..c9d4ab174 100644 --- a/apps/embed/src/components/VideoOverlay.tsx +++ b/apps/embed/src/components/VideoOverlay.tsx @@ -31,7 +31,7 @@ const VideoOverlay: FC = ({ video }) => { onClick={() => Tower.track(EVENTS.EMBED_VIDEO.CLICK_EMBED_PROFILE)} > {getProfile(video.by)?.slug} { @@ -80,7 +80,7 @@ const UserMenu = () => { diff --git a/apps/web/src/components/Common/VideoCard/QueuedVideo.tsx b/apps/web/src/components/Common/VideoCard/QueuedVideo.tsx index 3b1ced0a8..96fb54455 100644 --- a/apps/web/src/components/Common/VideoCard/QueuedVideo.tsx +++ b/apps/web/src/components/Common/VideoCard/QueuedVideo.tsx @@ -118,7 +118,7 @@ const QueuedVideo: FC = ({ queuedVideo }) => {
{getProfile(activeProfile)?.slug} diff --git a/apps/web/src/components/Common/VideoCard/StreamCard.tsx b/apps/web/src/components/Common/VideoCard/StreamCard.tsx index a83926eea..75423db58 100644 --- a/apps/web/src/components/Common/VideoCard/StreamCard.tsx +++ b/apps/web/src/components/Common/VideoCard/StreamCard.tsx @@ -43,7 +43,7 @@ const StreamCard: FC = ({ stream }) => {
= ({ video, variant = 'ghost', children }) => { ...(activeProfile?.metadata?.bio && { bio: activeProfile?.metadata?.bio }), - picture: getProfilePicture(activeProfile as Profile), + picture: getProfilePictureUri(activeProfile as Profile), attributes: [ ...otherAttributes, { diff --git a/apps/web/src/components/Create/CollectModule/Splits.tsx b/apps/web/src/components/Create/CollectModule/Splits.tsx index 3e67736b4..76538145a 100644 --- a/apps/web/src/components/Create/CollectModule/Splits.tsx +++ b/apps/web/src/components/Create/CollectModule/Splits.tsx @@ -203,7 +203,7 @@ const Splits: FC = ({ submitContainerRef }) => { > { { diff --git a/apps/web/src/components/Notifications/Acted.tsx b/apps/web/src/components/Notifications/Acted.tsx index 651ba32dd..fe600b3d3 100644 --- a/apps/web/src/components/Notifications/Acted.tsx +++ b/apps/web/src/components/Notifications/Acted.tsx @@ -29,7 +29,7 @@ const Acted: FC = ({ notification: { publication, actions } }) => { {getProfile(by)?.slug} diff --git a/apps/web/src/components/Notifications/Commented.tsx b/apps/web/src/components/Notifications/Commented.tsx index 3aeac3059..944cac168 100644 --- a/apps/web/src/components/Notifications/Commented.tsx +++ b/apps/web/src/components/Notifications/Commented.tsx @@ -27,7 +27,7 @@ const Commented: FC = ({ notification: { comment } }) => { {getProfile(comment.by)?.slug} diff --git a/apps/web/src/components/Notifications/Followed.tsx b/apps/web/src/components/Notifications/Followed.tsx index 2b8604863..03e421c2d 100644 --- a/apps/web/src/components/Notifications/Followed.tsx +++ b/apps/web/src/components/Notifications/Followed.tsx @@ -21,7 +21,7 @@ const Followed: FC = ({ notification: { followers } }) => { {getProfile(profile)?.displayName} diff --git a/apps/web/src/components/Notifications/Mentioned.tsx b/apps/web/src/components/Notifications/Mentioned.tsx index d1a168152..1684632e0 100644 --- a/apps/web/src/components/Notifications/Mentioned.tsx +++ b/apps/web/src/components/Notifications/Mentioned.tsx @@ -29,7 +29,7 @@ const Mentioned: FC = ({ notification: { publication } }) => { {getProfile(publication.by)?.displayName} diff --git a/apps/web/src/components/Notifications/Mirrored.tsx b/apps/web/src/components/Notifications/Mirrored.tsx index 155e02445..3df00672b 100644 --- a/apps/web/src/components/Notifications/Mirrored.tsx +++ b/apps/web/src/components/Notifications/Mirrored.tsx @@ -26,7 +26,7 @@ const Mirrored: FC = ({ notification: { mirrors, publication } }) => { {getProfile(profile)?.displayName} diff --git a/apps/web/src/components/Notifications/Quoted.tsx b/apps/web/src/components/Notifications/Quoted.tsx index 6ce5aeba1..595678036 100644 --- a/apps/web/src/components/Notifications/Quoted.tsx +++ b/apps/web/src/components/Notifications/Quoted.tsx @@ -27,7 +27,7 @@ const Quoted: FC = ({ notification: { quote } }) => { {getProfile(quote.by)?.displayName} diff --git a/apps/web/src/components/Notifications/Reactions.tsx b/apps/web/src/components/Notifications/Reactions.tsx index d854e96f1..ce74faaa0 100644 --- a/apps/web/src/components/Notifications/Reactions.tsx +++ b/apps/web/src/components/Notifications/Reactions.tsx @@ -26,7 +26,7 @@ const Reactions: FC = ({ notification: { publication, reactions } }) => { {getProfile(profile)?.displayName} diff --git a/apps/web/src/components/Profile/Mutual/MutualFollowers.tsx b/apps/web/src/components/Profile/Mutual/MutualFollowers.tsx index cacdb20f9..64f3584dc 100644 --- a/apps/web/src/components/Profile/Mutual/MutualFollowers.tsx +++ b/apps/web/src/components/Profile/Mutual/MutualFollowers.tsx @@ -75,7 +75,7 @@ const MutualFollowers: FC = ({ viewing }) => {
{getProfile(profile)?.slug} diff --git a/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx b/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx index 633531024..052e6f6fd 100644 --- a/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx +++ b/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx @@ -19,7 +19,7 @@ import { EVENTS, getIsSensitiveContent, getProfileCoverPicture, - getProfilePicture, + getProfilePictureUri, getPublication, getPublicationData, getPublicationMediaUrl, @@ -164,7 +164,7 @@ const PinnedVideo: FC = ({ id }) => { coverPicture: getProfileCoverPicture(activeProfile), id: uuidv4(), name: activeProfile?.metadata?.displayName ?? '', - picture: getProfilePicture(activeProfile as Profile), + picture: getProfilePictureUri(activeProfile as Profile), attributes: [ ...otherAttributes, { diff --git a/apps/web/src/components/UIElements/InputMentions.tsx b/apps/web/src/components/UIElements/InputMentions.tsx index 3263fca08..bc954572f 100644 --- a/apps/web/src/components/UIElements/InputMentions.tsx +++ b/apps/web/src/components/UIElements/InputMentions.tsx @@ -57,7 +57,7 @@ const InputMentions: FC = ({ id: profile.handle?.fullHandle, display: getProfile(profile)?.displayName, profileId: profile.id, - picture: getProfilePicture(profile), + picture: getProfilePicture(profile, 'AVATAR'), followers: profile.stats.followers })) callback(channels) diff --git a/packages/helpers/generic/functions/getProfilePicture.ts b/packages/helpers/generic/functions/getProfilePicture.ts index cef999232..e77cd8feb 100644 --- a/packages/helpers/generic/functions/getProfilePicture.ts +++ b/packages/helpers/generic/functions/getProfilePicture.ts @@ -24,3 +24,16 @@ export const getProfilePicture = ( const sanitized = sanitizeDStorageUrl(url) return imageCdn(sanitized, type) } + +export const getProfilePictureUri = (profile: Profile | null): string => { + if (!profile) { + return '' + } + const url = + profile.metadata?.picture?.__typename === 'ImageSet' + ? profile.metadata?.picture?.optimized?.uri + : profile.metadata?.picture?.__typename === 'NftImage' + ? profile?.metadata.picture.image?.optimized?.uri + : null + return url +} From 04677cec3371d9eafd44e0d6e2b86bac56db2d6e Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 13:17:39 +0530 Subject: [PATCH 06/14] Update getProfilePictureUri function to use raw image URI instead of optimized image URI --- packages/helpers/generic/functions/getProfilePicture.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/helpers/generic/functions/getProfilePicture.ts b/packages/helpers/generic/functions/getProfilePicture.ts index e77cd8feb..92c76721d 100644 --- a/packages/helpers/generic/functions/getProfilePicture.ts +++ b/packages/helpers/generic/functions/getProfilePicture.ts @@ -31,9 +31,9 @@ export const getProfilePictureUri = (profile: Profile | null): string => { } const url = profile.metadata?.picture?.__typename === 'ImageSet' - ? profile.metadata?.picture?.optimized?.uri + ? profile.metadata?.picture?.raw?.uri : profile.metadata?.picture?.__typename === 'NftImage' - ? profile?.metadata.picture.image?.optimized?.uri + ? profile?.metadata.picture.image?.raw?.uri : null return url } From 2d0c339ab8c165abac60b640046b896abba88f1c Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 14:15:50 +0530 Subject: [PATCH 07/14] Fix negative value bug in secondsToISO function --- packages/helpers/browser/functions/getMetaTags.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/helpers/browser/functions/getMetaTags.ts b/packages/helpers/browser/functions/getMetaTags.ts index 242023b7c..d49b8bd3f 100644 --- a/packages/helpers/browser/functions/getMetaTags.ts +++ b/packages/helpers/browser/functions/getMetaTags.ts @@ -37,7 +37,7 @@ const secondsToISO = (seconds: string | undefined) => { ['S', SECONDS_PER_SECOND] ] let duration = 'P' - let remainder = seconds ? Number(seconds ?? 0) : 0 + let remainder = seconds ? Math.abs(Number(seconds ?? 0)) : 0 // Use Math.abs to ensure a positive value designations.forEach(([sign, seconds]) => { const value = Math.floor(remainder / (seconds as number)) From 436eafdc57aa72932336f4610a2d648d609cfd39 Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 14:28:58 +0530 Subject: [PATCH 08/14] Remove useScreenSize hook and update ThemeProvider component --- .../Common/Providers/ThemeProvider.tsx | 8 +-- .../helpers/browser/hooks/useScreenSize.ts | 56 ------------------- packages/helpers/browser/index.ts | 1 - 3 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 packages/helpers/browser/hooks/useScreenSize.ts diff --git a/apps/web/src/components/Common/Providers/ThemeProvider.tsx b/apps/web/src/components/Common/Providers/ThemeProvider.tsx index 61bcf6277..ed49e64ff 100644 --- a/apps/web/src/components/Common/Providers/ThemeProvider.tsx +++ b/apps/web/src/components/Common/Providers/ThemeProvider.tsx @@ -1,7 +1,6 @@ import '@radix-ui/themes/styles.css' import { Theme } from '@radix-ui/themes' -import { useScreenSize } from '@tape.xyz/browser' import { ThemeProvider as NextTheme } from 'next-themes' import { type FC, type ReactNode } from 'react' @@ -10,14 +9,9 @@ type Props = { } const ThemeProvider: FC = ({ children }) => { - const { isMobile, isTablet } = useScreenSize() return ( - + {children} diff --git a/packages/helpers/browser/hooks/useScreenSize.ts b/packages/helpers/browser/hooks/useScreenSize.ts deleted file mode 100644 index 2628a5606..000000000 --- a/packages/helpers/browser/hooks/useScreenSize.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { useEffect, useState } from 'react' - -type ScreenSize = { - width: number - height: number - isMobile: boolean - isTablet: boolean -} - -export const useScreenSize = (): ScreenSize => { - const [screenSize, setScreenSize] = useState({ - width: 0, - height: 0, - isMobile: false, - isTablet: false - }) - - useEffect(() => { - const handleResize = () => { - const newWidth = window.innerWidth - const newHeight = window.innerHeight - const isMobile = newWidth <= 768 // Adjust this breakpoint as needed - const isTablet = newWidth > 768 && newWidth <= 1024 // Adjust this breakpoint as needed - - setScreenSize({ - width: newWidth, - height: newHeight, - isMobile, - isTablet - }) - } - - window.addEventListener('resize', handleResize) - - // Clean up the event listener when the component unmounts - return () => { - window.removeEventListener('resize', handleResize) - } - }, []) - - // Initial device type detection - useEffect(() => { - const isMobile = window.innerWidth <= 768 // Adjust this breakpoint as needed - const isTablet = window.innerWidth > 768 && window.innerWidth <= 1024 // Adjust this breakpoint as needed - - setScreenSize((prevScreenSize) => ({ - ...prevScreenSize, - isMobile, - isTablet, - width: window.innerWidth, - height: window.innerHeight - })) - }, []) - - return screenSize -} diff --git a/packages/helpers/browser/index.ts b/packages/helpers/browser/index.ts index 264768f5b..bb9c833a6 100644 --- a/packages/helpers/browser/index.ts +++ b/packages/helpers/browser/index.ts @@ -14,5 +14,4 @@ export * from './hooks/useDragAndDrop' export * from './hooks/useHorizontalScroll' export * from './hooks/useIsMounted' export * from './hooks/useOutsideClick' -export * from './hooks/useScreenSize' export * from './hooks/useVideoViews' From 23d2529f51b7fd5e1fb27bc138b2d27d1abc5662 Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 14:36:39 +0530 Subject: [PATCH 09/14] Update limit to display only 10 latest bytes. --- apps/web/src/components/Common/Icons/VerifiedSolid.tsx | 4 +--- apps/web/src/components/Home/LatestBytes.tsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/Common/Icons/VerifiedSolid.tsx b/apps/web/src/components/Common/Icons/VerifiedSolid.tsx index 6b8d472e2..3fc88946c 100644 --- a/apps/web/src/components/Common/Icons/VerifiedSolid.tsx +++ b/apps/web/src/components/Common/Icons/VerifiedSolid.tsx @@ -9,10 +9,8 @@ const VerifiedSolid = (props: SVGProps) => ( xmlns="http://www.w3.org/2000/svg" > ) diff --git a/apps/web/src/components/Home/LatestBytes.tsx b/apps/web/src/components/Home/LatestBytes.tsx index ec30cf2f3..69e03fae7 100644 --- a/apps/web/src/components/Home/LatestBytes.tsx +++ b/apps/web/src/components/Home/LatestBytes.tsx @@ -35,7 +35,7 @@ const request: ExplorePublicationRequest = { } }, orderBy: ExplorePublicationsOrderByType.LensCurated, - limit: LimitType.Fifty + limit: LimitType.Ten } const LatestBytes = () => { From 713fc1af6103b9083c1732bd5f7418f5da3b9395 Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 14:40:12 +0530 Subject: [PATCH 10/14] Update logo dimensions in FullPageLoader and Navbar components --- apps/web/src/components/Common/FullPageLoader.tsx | 2 ++ apps/web/src/components/Common/Navbar.tsx | 2 ++ apps/web/src/pages/login.tsx | 2 ++ 3 files changed, 6 insertions(+) diff --git a/apps/web/src/components/Common/FullPageLoader.tsx b/apps/web/src/components/Common/FullPageLoader.tsx index 894ecb732..bc23c86aa 100644 --- a/apps/web/src/components/Common/FullPageLoader.tsx +++ b/apps/web/src/components/Common/FullPageLoader.tsx @@ -16,6 +16,7 @@ const FullPageLoader = () => { className="h-10" alt="tape" height={50} + width={200} draggable={false} /> ) : ( @@ -23,6 +24,7 @@ const FullPageLoader = () => { src={`${STATIC_ASSETS}/brand/logo-with-text-dark.webp`} className="h-10" height={50} + width={200} alt="tape" draggable={false} /> diff --git a/apps/web/src/components/Common/Navbar.tsx b/apps/web/src/components/Common/Navbar.tsx index 68b6ec5b3..51eb6ec6b 100644 --- a/apps/web/src/components/Common/Navbar.tsx +++ b/apps/web/src/components/Common/Navbar.tsx @@ -38,6 +38,7 @@ const Navbar = () => { className="-mb-0.5 h-6" alt="tape" height={30} + width={110} draggable={false} /> ) : ( @@ -45,6 +46,7 @@ const Navbar = () => { src={`${STATIC_ASSETS}/brand/logo-with-text-dark.webp`} className="-mb-0.5 h-6" height={30} + width={110} alt="tape" draggable={false} /> diff --git a/apps/web/src/pages/login.tsx b/apps/web/src/pages/login.tsx index af7032563..4977914ad 100644 --- a/apps/web/src/pages/login.tsx +++ b/apps/web/src/pages/login.tsx @@ -28,6 +28,7 @@ const Login = () => { src={`${STATIC_ASSETS}/brand/logo-with-text-dark.webp`} className="h-10" alt="tape" + width={200} height={30} draggable={false} /> @@ -36,6 +37,7 @@ const Login = () => { src={`${STATIC_ASSETS}/brand/logo-with-text-light.webp`} className="h-10" alt="tape" + width={200} height={30} draggable={false} /> From 0dfed5e870d9fed9384544b8ea3a16f521f4b46a Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 14:43:22 +0530 Subject: [PATCH 11/14] Fix UI styling in CategoryFilters and HorizantalScroller components --- apps/web/src/components/Common/CategoryFilters.tsx | 4 ++-- apps/web/src/components/Common/HorizantalScroller.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/Common/CategoryFilters.tsx b/apps/web/src/components/Common/CategoryFilters.tsx index 8df1dfbda..c1a3bc300 100644 --- a/apps/web/src/components/Common/CategoryFilters.tsx +++ b/apps/web/src/components/Common/CategoryFilters.tsx @@ -37,7 +37,7 @@ const CategoryFilters: FC = ({ heading, subheading }) => { 'whitespace-nowrap px-10 py-2.5 font-medium', activeTagFilter === 'all' ? 'from-brand-50 border-brand-400 dark:from-brand-950 border-b-2 bg-gradient-to-t to-transparent' - : 'text-dust border-b dark:border-gray-800' + : 'border-b dark:border-gray-800' )} onClick={() => onFilter('all')} > @@ -50,7 +50,7 @@ const CategoryFilters: FC = ({ heading, subheading }) => { 'whitespace-nowrap px-6 py-2.5 font-medium', activeTagFilter === category.tag ? 'from-brand-50 border-brand-400 dark:from-brand-950 border-b-2 bg-gradient-to-t to-transparent' - : 'text-dust border-b dark:border-gray-800' + : 'border-b dark:border-gray-800' )} onClick={() => onFilter(category.tag)} > diff --git a/apps/web/src/components/Common/HorizantalScroller.tsx b/apps/web/src/components/Common/HorizantalScroller.tsx index 2b56ffc92..6f5ab5f2d 100644 --- a/apps/web/src/components/Common/HorizantalScroller.tsx +++ b/apps/web/src/components/Common/HorizantalScroller.tsx @@ -24,7 +24,7 @@ const HorizantalScroller: FC = ({ heading, subheading, sectionRef }) => {

{heading}

-

{subheading}

+

{subheading}

diff --git a/packages/constants/general.ts b/packages/constants/general.ts index 85b99de02..e4abc3bdf 100644 --- a/packages/constants/general.ts +++ b/packages/constants/general.ts @@ -20,7 +20,7 @@ export const OG_IMAGE = `${STATIC_ASSETS}/brand/og.png` export const LENS_IMAGEKIT_SNAPSHOT_URL = 'https://ik.imagekit.io/lenstube' // infinite scroll -export const INFINITE_SCROLL_ROOT_MARGIN = '500px' +export const INFINITE_SCROLL_ROOT_MARGIN = '800px' export const IMAGE_TRANSFORMATIONS = { AVATAR: 'tr:w-60,h-60', From 1482b0a3192a6fc84fdf57cf2cd4c2ab7e440f08 Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 15:37:58 +0530 Subject: [PATCH 13/14] Fix profile picture bug in VideoOptions and PinnedVideo --- .../components/Common/VideoCard/VideoOptions.tsx | 15 +++++++++------ .../src/components/Profile/Tabs/PinnedVideo.tsx | 7 +++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/apps/web/src/components/Common/VideoCard/VideoOptions.tsx b/apps/web/src/components/Common/VideoCard/VideoOptions.tsx index cac6418ae..edf6158f0 100644 --- a/apps/web/src/components/Common/VideoCard/VideoOptions.tsx +++ b/apps/web/src/components/Common/VideoCard/VideoOptions.tsx @@ -195,17 +195,20 @@ const VideoOptions: FC = ({ video, variant = 'ghost', children }) => { try { toast.loading(`Pinning video...`) + const pfp = getProfilePictureUri(activeProfile as Profile) const metadata: ProfileOptions = { - appId: TAPE_APP_ID, - coverPicture: getProfileCoverPicture(activeProfile), - id: uuidv4(), ...(activeProfile?.metadata?.displayName && { - name: activeProfile?.metadata?.displayName + name: activeProfile?.metadata.displayName }), ...(activeProfile?.metadata?.bio && { - bio: activeProfile?.metadata?.bio + bio: activeProfile?.metadata.bio + }), + ...(pfp && { + picture: pfp }), - picture: getProfilePictureUri(activeProfile as Profile), + appId: TAPE_APP_ID, + coverPicture: getProfileCoverPicture(activeProfile), + id: uuidv4(), attributes: [ ...otherAttributes, { diff --git a/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx b/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx index 052e6f6fd..8c55ff109 100644 --- a/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx +++ b/apps/web/src/components/Profile/Tabs/PinnedVideo.tsx @@ -153,18 +153,21 @@ const PinnedVideo: FC = ({ id }) => { try { toast.loading(`Unpinning video...`) + const pfp = getProfilePictureUri(activeProfile as Profile) const metadata: ProfileOptions = { - appId: TAPE_APP_ID, ...(activeProfile?.metadata?.displayName && { name: activeProfile?.metadata?.displayName }), ...(activeProfile?.metadata?.bio && { bio: activeProfile?.metadata?.bio }), + ...(pfp && { + picture: pfp + }), + appId: TAPE_APP_ID, coverPicture: getProfileCoverPicture(activeProfile), id: uuidv4(), name: activeProfile?.metadata?.displayName ?? '', - picture: getProfilePictureUri(activeProfile as Profile), attributes: [ ...otherAttributes, { From 87b687b67d85e0710ad6d27f0658af69d2138aef Mon Sep 17 00:00:00 2001 From: "sasi.eth" Date: Sat, 4 Nov 2023 16:01:51 +0530 Subject: [PATCH 14/14] Refactor Feed and VideoCardShimmer components. --- apps/web/src/components/Feed/index.tsx | 1 - .../web/src/components/Shimmers/VideoCardShimmer.tsx | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/web/src/components/Feed/index.tsx b/apps/web/src/components/Feed/index.tsx index ff4407824..6d018263b 100644 --- a/apps/web/src/components/Feed/index.tsx +++ b/apps/web/src/components/Feed/index.tsx @@ -87,7 +87,6 @@ const Feed = () => {
- {loading && } {!error && !loading && ( <> diff --git a/apps/web/src/components/Shimmers/VideoCardShimmer.tsx b/apps/web/src/components/Shimmers/VideoCardShimmer.tsx index de3b6937a..8e804f62e 100644 --- a/apps/web/src/components/Shimmers/VideoCardShimmer.tsx +++ b/apps/web/src/components/Shimmers/VideoCardShimmer.tsx @@ -21,13 +21,11 @@ const VideoCardShimmer = () => {
-
-
-
-
-
-
-
+
+
+
+
+