From 309f76689f3672436bc790894af4580006a4c60f Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Thu, 5 Dec 2024 15:37:23 +0100 Subject: [PATCH 1/8] fix(feed): posts could change position causing displacement --- src/components/catalog-row/catalog-row.tsx | 20 ++------- .../comment-media/comment-media.tsx | 9 +++- src/components/post-desktop/post-desktop.tsx | 29 ++---------- src/components/post-mobile/post-mobile.tsx | 41 +++-------------- src/hooks/use-comment-media-info.ts | 44 +++++++++++++++++++ src/lib/utils/media-utils.ts | 2 + 6 files changed, 68 insertions(+), 77 deletions(-) create mode 100644 src/hooks/use-comment-media-info.ts diff --git a/src/components/catalog-row/catalog-row.tsx b/src/components/catalog-row/catalog-row.tsx index 1f6ee37d..caca961e 100644 --- a/src/components/catalog-row/catalog-row.tsx +++ b/src/components/catalog-row/catalog-row.tsx @@ -1,10 +1,10 @@ -import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; import { useTranslation } from 'react-i18next'; import { Link, useLocation, useParams } from 'react-router-dom'; import { Comment, useComment } from '@plebbit/plebbit-react-hooks'; import { useFloating, offset, size, autoUpdate, Placement } from '@floating-ui/react'; -import { fetchWebpageThumbnailIfNeeded, getCommentMediaInfo, getHasThumbnail } from '../../lib/utils/media-utils'; +import { getHasThumbnail } from '../../lib/utils/media-utils'; import { getFormattedTimeAgo } from '../../lib/utils/time-utils'; import { isAllView, isSubscriptionsView } from '../../lib/utils/view-utils'; import Plebbit from '@plebbit/plebbit-js/dist/browser/index.js'; @@ -18,6 +18,7 @@ import PostMenuDesktop from '../post-desktop/post-menu-desktop'; import styles from './catalog-row.module.css'; import _ from 'lodash'; import { ContentPreview } from '../../views/home/popular-threads-box'; +import { useCommentMediaInfo } from '../../hooks/use-comment-media-info'; interface CatalogPostMediaProps { commentMediaInfo: any; @@ -116,22 +117,9 @@ const CatalogPost = ({ post }: { post: Comment }) => { } = post || {}; const linkCount = useCountLinksInReplies(post); - // some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false - const initialCommentMediaInfo = useMemo(() => getCommentMediaInfo(post), [post]); - const [commentMediaInfo, setCommentMediaInfo] = useState(initialCommentMediaInfo); + const commentMediaInfo = useCommentMediaInfo(post); const hasThumbnail = getHasThumbnail(commentMediaInfo, link); - const fetchThumbnail = useCallback(async () => { - if (initialCommentMediaInfo?.type === 'webpage' && !initialCommentMediaInfo.thumbnail) { - const newMediaInfo = await fetchWebpageThumbnailIfNeeded(initialCommentMediaInfo); - setCommentMediaInfo(newMediaInfo); - } - }, [initialCommentMediaInfo]); - - useEffect(() => { - fetchThumbnail(); - }, [fetchThumbnail]); - const { hidden } = useHide({ cid }); const location = useLocation(); diff --git a/src/components/comment-media/comment-media.tsx b/src/components/comment-media/comment-media.tsx index b715f114..c81e97ba 100644 --- a/src/components/comment-media/comment-media.tsx +++ b/src/components/comment-media/comment-media.tsx @@ -136,7 +136,7 @@ const CommentMedia = ({ commentMediaInfo, isFloatingEmbed, post, showThumbnail, const isReply = parentCid; const { t } = useTranslation(); const isMobile = useIsMobile(); - const { url } = commentMediaInfo || {}; + const { url, thumbnailWidth, thumbnailHeight } = commentMediaInfo || {}; let type = commentMediaInfo?.type; const gifFrameUrl = useFetchGifFirstFrame(url); @@ -150,10 +150,17 @@ const CommentMedia = ({ commentMediaInfo, isFloatingEmbed, post, showThumbnail, const maxThumbnailSize = isMobile || isReply ? 125 : 250; if (linkWidth && linkHeight) { + // use the dimensions from the plebbit-js api let scale = Math.min(1, maxThumbnailSize / Math.max(linkWidth, linkHeight)); displayWidth = `${linkWidth * scale}px`; displayHeight = `${linkHeight * scale}px`; + } else if (thumbnailHeight && thumbnailWidth) { + // use the dimensions from the thumbnail fetched by useCommentMediaInfo + let scale = Math.min(1, maxThumbnailSize / Math.max(thumbnailWidth, thumbnailHeight)); + displayWidth = `${thumbnailWidth * scale}px`; + displayHeight = `${thumbnailHeight * scale}px`; } else { + // use the default size displayWidth = `${maxThumbnailSize}px`; displayHeight = `${maxThumbnailSize}px`; } diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 5703ed51..81ce0666 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -1,23 +1,17 @@ -import { useEffect, useState } from 'react'; +import { useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Link, useLocation, useParams } from 'react-router-dom'; import { Comment, useAuthorAvatar, useComment, useEditedComment, useSubplebbit } from '@plebbit/plebbit-react-hooks'; import Plebbit from '@plebbit/plebbit-js/dist/browser/index.js'; import styles from '../../views/post/post.module.css'; -import { - CommentMediaInfo, - fetchWebpageThumbnailIfNeeded, - getCommentMediaInfo, - getDisplayMediaInfoType, - getHasThumbnail, - getMediaDimensions, -} from '../../lib/utils/media-utils'; +import { getDisplayMediaInfoType, getHasThumbnail, getMediaDimensions } from '../../lib/utils/media-utils'; import { hashStringToColor, getTextColorForBackground } from '../../lib/utils/post-utils'; import { getFormattedDate, getFormattedTimeAgo } from '../../lib/utils/time-utils'; import { isValidURL } from '../../lib/utils/url-utils'; import { isAllView, isPendingPostView, isPostPageView, isSubscriptionsView } from '../../lib/utils/view-utils'; import useAvatarVisibilityStore from '../../stores/use-avatar-visibility-store'; import useAuthorAddressClick from '../../hooks/use-author-address-click'; +import { useCommentMediaInfo } from '../../hooks/use-comment-media-info'; import useCountLinksInReplies from '../../hooks/use-count-links-in-replies'; import useFetchGifFirstFrame from '../../hooks/use-fetch-gif-first-frame'; import useHide from '../../hooks/use-hide'; @@ -228,23 +222,8 @@ const PostMedia = ({ post }: PostProps) => { }; const PostMediaContent = ({ post, link, spoiler, t }: { post: any; link: string; spoiler: boolean; t: any }) => { - const initialInfo = getCommentMediaInfo(post); - const [webpageThumbnail, setWebpageThumbnail] = useState(); const { isDescription, isRules } = post || {}; // custom properties, not from api - - useEffect(() => { - // some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false - const loadThumbnail = async () => { - if (initialInfo?.type === 'webpage' && !initialInfo.thumbnail) { - const newMediaInfo = await fetchWebpageThumbnailIfNeeded(initialInfo); - setWebpageThumbnail(newMediaInfo); - } - }; - loadThumbnail(); - }, [initialInfo]); - - const commentMediaInfo = webpageThumbnail || initialInfo; - + const commentMediaInfo = useCommentMediaInfo(post); const { url } = commentMediaInfo || {}; let type = commentMediaInfo?.type; const gifFrameUrl = useFetchGifFirstFrame(url); diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index b06ad45b..7eb5cea2 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -1,15 +1,16 @@ -import { useEffect, useState } from 'react'; +import { useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import { Link, useLocation, useParams } from 'react-router-dom'; import { Comment, useAuthorAvatar, useComment, useEditedComment, useSubplebbit } from '@plebbit/plebbit-react-hooks'; import Plebbit from '@plebbit/plebbit-js/dist/browser/index.js'; import styles from '../../views/post/post.module.css'; -import { CommentMediaInfo, fetchWebpageThumbnailIfNeeded, getCommentMediaInfo, getHasThumbnail } from '../../lib/utils/media-utils'; +import { getHasThumbnail } from '../../lib/utils/media-utils'; import { getTextColorForBackground, hashStringToColor } from '../../lib/utils/post-utils'; import { getFormattedDate, getFormattedTimeAgo } from '../../lib/utils/time-utils'; import { isAllView, isPendingPostView, isPostPageView, isSubscriptionsView } from '../../lib/utils/view-utils'; import useAvatarVisibilityStore from '../../stores/use-avatar-visibility-store'; import useAuthorAddressClick from '../../hooks/use-author-address-click'; +import { useCommentMediaInfo } from '../../hooks/use-comment-media-info'; import useCountLinksInReplies from '../../hooks/use-count-links-in-replies'; import useHide from '../../hooks/use-hide'; import useReplies from '../../hooks/use-replies'; @@ -26,6 +27,7 @@ import _ from 'lodash'; const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: PostProps) => { const { t } = useTranslation(); const { author, cid, deleted, link, locked, parentCid, pinned, postCid, reason, removed, shortCid, state, subplebbitAddress, timestamp } = post || {}; + const isReply = parentCid; const title = post?.title?.trim(); const { isDescription, isRules } = post || {}; // custom properties, not from api const { address, shortAddress } = author || {}; @@ -40,27 +42,9 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P const isInPostPageView = isPostPageView(location.pathname, params); const isInSubscriptionsView = isSubscriptionsView(location.pathname, params); - const initialInfo = getCommentMediaInfo(post); - const [webpageThumbnail, setWebpageThumbnail] = useState(); - useEffect(() => { - // some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false - const loadThumbnail = async () => { - if (initialInfo?.type === 'webpage' && !initialInfo.thumbnail) { - const newMediaInfo = await fetchWebpageThumbnailIfNeeded(initialInfo); - setWebpageThumbnail(newMediaInfo); - } - }; - loadThumbnail(); - return () => { - setWebpageThumbnail(undefined); - }; - }, [initialInfo]); - const commentMediaInfo = webpageThumbnail || initialInfo; - + const commentMediaInfo = useCommentMediaInfo(post); const hasThumbnail = getHasThumbnail(commentMediaInfo, link); - const isReply = parentCid; - const stateString = useStateString(post); const handleUserAddressClick = useAuthorAddressClick(); @@ -192,22 +176,9 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P }; const PostMediaContent = ({ post, link, t }: { post: any; link: string; t: any }) => { - const initialInfo = getCommentMediaInfo(post); - const [webpageThumbnail, setWebpageThumbnail] = useState(); const [showThumbnail, setShowThumbnail] = useState(true); const { isDescription, isRules } = post || {}; // custom properties, not from api - useEffect(() => { - // some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false - const loadThumbnail = async () => { - if (initialInfo?.type === 'webpage' && !initialInfo.thumbnail) { - const newMediaInfo = await fetchWebpageThumbnailIfNeeded(initialInfo); - setWebpageThumbnail(newMediaInfo); - } - }; - loadThumbnail(); - }, [initialInfo]); - - const commentMediaInfo = webpageThumbnail || initialInfo; + const commentMediaInfo = useCommentMediaInfo(post); const hasThumbnail = getHasThumbnail(commentMediaInfo, link); return ( diff --git a/src/hooks/use-comment-media-info.ts b/src/hooks/use-comment-media-info.ts new file mode 100644 index 00000000..3a724b30 --- /dev/null +++ b/src/hooks/use-comment-media-info.ts @@ -0,0 +1,44 @@ +import { useCallback, useEffect, useMemo, useState } from 'react'; +import { useLocation, useParams } from 'react-router-dom'; +import { Comment } from '@plebbit/plebbit-react-hooks'; +import { getCommentMediaInfo, fetchWebpageThumbnailIfNeeded } from '../lib/utils/media-utils'; +import { isPendingPostView, isPostPageView } from '../lib/utils/view-utils'; + +export const useCommentMediaInfo = (comment: Comment) => { + const location = useLocation(); + const params = useParams(); + const isInPostPageView = isPostPageView(location.pathname, params); + const isInPendingPostView = isPendingPostView(location.pathname, params); + // some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false + const initialCommentMediaInfo = useMemo(() => getCommentMediaInfo(comment), [comment]); + const [commentMediaInfo, setCommentMediaInfo] = useState(initialCommentMediaInfo); + + const fetchThumbnail = useCallback(async () => { + if (!isInPostPageView && !isInPendingPostView) { + return; // don't fetch in feed view, it displaces the posts + } + if (initialCommentMediaInfo?.type === 'webpage' && !initialCommentMediaInfo.thumbnail) { + const newMediaInfo = await fetchWebpageThumbnailIfNeeded(initialCommentMediaInfo); + + // Fetch the dimensions of the thumbnail + if (newMediaInfo.thumbnail) { + const img = new Image(); + img.onload = () => { + setCommentMediaInfo({ + ...newMediaInfo, + thumbnailWidth: img.width, + thumbnailHeight: img.height, + }); + }; + img.src = newMediaInfo.thumbnail; + } else { + setCommentMediaInfo(newMediaInfo); + } + } + }, [initialCommentMediaInfo, isInPostPageView, isInPendingPostView]); + useEffect(() => { + fetchThumbnail(); + }, [fetchThumbnail]); + + return commentMediaInfo; +}; diff --git a/src/lib/utils/media-utils.ts b/src/lib/utils/media-utils.ts index d61dbe58..0acafe0b 100644 --- a/src/lib/utils/media-utils.ts +++ b/src/lib/utils/media-utils.ts @@ -10,6 +10,8 @@ export interface CommentMediaInfo { url: string; type: string; thumbnail?: string; + thumbnailWidth?: number; + thumbnailHeight?: number; patternThumbnailUrl?: string; post?: Comment; } From 18c55aa2f8df0e31994d295278082e4f0920a573 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Thu, 5 Dec 2024 22:58:37 +0100 Subject: [PATCH 2/8] rename plebbit options variables, only show data path on electron --- .../plebbit-options/plebbit-options.tsx | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/components/settings-modal/plebbit-options/plebbit-options.tsx b/src/components/settings-modal/plebbit-options/plebbit-options.tsx index b0ca7cd2..6ac833ad 100644 --- a/src/components/settings-modal/plebbit-options/plebbit-options.tsx +++ b/src/components/settings-modal/plebbit-options/plebbit-options.tsx @@ -12,7 +12,7 @@ interface SettingsProps { maticRpcRef?: RefObject; avaxRpcRef?: RefObject; plebbitRpcRef?: RefObject; - nodeDataPathRef?: RefObject; + plebbitDataPathRef?: RefObject; } const IPFSGatewaysSettings = ({ ipfsGatewayUrlsRef, mediaIpfsGatewayUrlRef }: SettingsProps) => { @@ -119,21 +119,23 @@ const PlebbitRPCSettings = ({ plebbitRpcRef }: SettingsProps) => { ); }; -const NodeDataPathSettings = ({ nodeDataPathRef }: SettingsProps) => { +const PlebbitDataPathSettings = ({ plebbitDataPathRef }: SettingsProps) => { const plebbitRpc = usePlebbitRpcSettings(); const { plebbitRpcSettings } = plebbitRpc || {}; const isConnectedToRpc = plebbitRpc?.state === 'succeeded'; - const path = plebbitRpcSettings?.plebbitOptions?.dataPath || ''; + const path = plebbitRpcSettings?.plebbitOptions?.plebbitDataPath || ''; return ( -
+
- +
); }; +const isElectron = window.isElectron === true; + const PlebbitOptions = () => { const { t } = useTranslation(); const account = useAccount(); @@ -147,7 +149,7 @@ const PlebbitOptions = () => { const maticRpcRef = useRef(null); const avaxRpcRef = useRef(null); const plebbitRpcRef = useRef(null); - const nodeDataPathRef = useRef(null); + const plebbitDataPathRef = useRef(null); const handleSave = async () => { const ipfsGatewayUrls = ipfsGatewayUrlsRef.current?.value.split('\n').map((url) => url.trim()); @@ -158,7 +160,7 @@ const PlebbitOptions = () => { const maticRpcUrls = maticRpcRef.current?.value.split('\n').map((url) => url.trim()); const avaxRpcUrls = avaxRpcRef.current?.value.split('\n').map((url) => url.trim()); const plebbitRpcClientsOptions = plebbitRpcRef.current?.value.trim(); - const dataPath = nodeDataPathRef.current?.value.trim(); + const plebbitDataPath = plebbitDataPathRef.current?.value.trim(); const chainProviders = { eth: { @@ -189,7 +191,7 @@ const PlebbitOptions = () => { pubsubHttpClientsOptions, chainProviders, plebbitRpcClientsOptions, - dataPath, + plebbitDataPath, }, }); alert('Options saved.'); @@ -230,17 +232,19 @@ const PlebbitOptions = () => {
- node RPC: + plebbit RPC:
-
- node data path: - - - -
+ {isElectron && ( +
+ plebbit data path: + + + +
+ )} ); }; From db8c51fa72404b00bc1bc90d4e92b2e3ad5887c5 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Thu, 5 Dec 2024 23:02:18 +0100 Subject: [PATCH 3/8] fix(plebbit options): schema error prevented to save --- .../plebbit-options/plebbit-options.tsx | 52 +++++++++++++++---- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/src/components/settings-modal/plebbit-options/plebbit-options.tsx b/src/components/settings-modal/plebbit-options/plebbit-options.tsx index 6ac833ad..b6ccb5ae 100644 --- a/src/components/settings-modal/plebbit-options/plebbit-options.tsx +++ b/src/components/settings-modal/plebbit-options/plebbit-options.tsx @@ -148,19 +148,50 @@ const PlebbitOptions = () => { const solRpcRef = useRef(null); const maticRpcRef = useRef(null); const avaxRpcRef = useRef(null); + const httpRoutersRef = useRef(null); const plebbitRpcRef = useRef(null); const plebbitDataPathRef = useRef(null); const handleSave = async () => { - const ipfsGatewayUrls = ipfsGatewayUrlsRef.current?.value.split('\n').map((url) => url.trim()); + const ipfsGatewayUrls = ipfsGatewayUrlsRef.current?.value + .split('\n') + .map((url) => url.trim()) + .filter((url) => url !== ''); + const mediaIpfsGatewayUrl = mediaIpfsGatewayUrlRef.current?.value.trim(); - const pubsubHttpClientsOptions = pubsubProvidersRef.current?.value.split('\n').map((url) => url.trim()); - const ethRpcUrls = ethRpcRef.current?.value.split('\n').map((url) => url.trim()); - const solRpcUrls = solRpcRef.current?.value.split('\n').map((url) => url.trim()); - const maticRpcUrls = maticRpcRef.current?.value.split('\n').map((url) => url.trim()); - const avaxRpcUrls = avaxRpcRef.current?.value.split('\n').map((url) => url.trim()); - const plebbitRpcClientsOptions = plebbitRpcRef.current?.value.trim(); - const plebbitDataPath = plebbitDataPathRef.current?.value.trim(); + + const pubsubHttpClientsOptions = pubsubProvidersRef.current?.value + .split('\n') + .map((url) => url.trim()) + .filter((url) => url !== ''); + + const ethRpcUrls = ethRpcRef.current?.value + .split('\n') + .map((url) => url.trim()) + .filter((url) => url !== ''); + + const solRpcUrls = solRpcRef.current?.value + .split('\n') + .map((url) => url.trim()) + .filter((url) => url !== ''); + + const maticRpcUrls = maticRpcRef.current?.value + .split('\n') + .map((url) => url.trim()) + .filter((url) => url !== ''); + + const avaxRpcUrls = avaxRpcRef.current?.value + .split('\n') + .map((url) => url.trim()) + .filter((url) => url !== ''); + + const httpRoutersOptions = httpRoutersRef.current?.value + .split('\n') + .map((url) => url.trim()) + .filter((url) => url !== ''); + + const plebbitRpcClientsOptions = plebbitRpcRef.current?.value.trim() ? [plebbitRpcRef.current.value.trim()] : undefined; + const dataPath = plebbitDataPathRef.current?.value.trim() || undefined; const chainProviders = { eth: { @@ -190,11 +221,12 @@ const PlebbitOptions = () => { ipfsGatewayUrls, pubsubHttpClientsOptions, chainProviders, + httpRoutersOptions, plebbitRpcClientsOptions, - plebbitDataPath, + dataPath, }, }); - alert('Options saved.'); + alert('Options saved, reloading...'); window.location.reload(); } catch (e) { if (e instanceof Error) { From cc660e9527468de04c1b826c9d97b863ebd2f2eb Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Thu, 5 Dec 2024 23:13:54 +0100 Subject: [PATCH 4/8] fix(settings): crypto address setting would show error for an already set address --- .../crypto-address-setting.module.css | 4 ++++ .../crypto-address-setting/crypto-address-setting.tsx | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/settings-modal/crypto-address-setting/crypto-address-setting.module.css b/src/components/settings-modal/crypto-address-setting/crypto-address-setting.module.css index eb3f60fe..f8031853 100644 --- a/src/components/settings-modal/crypto-address-setting/crypto-address-setting.module.css +++ b/src/components/settings-modal/crypto-address-setting/crypto-address-setting.module.css @@ -41,6 +41,10 @@ margin: 0 5px; } +.saved { + padding-left: 5px; +} + .red { color: red; } diff --git a/src/components/settings-modal/crypto-address-setting/crypto-address-setting.tsx b/src/components/settings-modal/crypto-address-setting/crypto-address-setting.tsx index 2fbb4c37..6402b1d6 100644 --- a/src/components/settings-modal/crypto-address-setting/crypto-address-setting.tsx +++ b/src/components/settings-modal/crypto-address-setting/crypto-address-setting.tsx @@ -8,7 +8,7 @@ const CryptoAddressSetting = () => { const account = useAccount(); const [cryptoState, setCryptoState] = useState({ - cryptoAddress: '', + cryptoAddress: account?.author?.shortAddress.includes('.') ? account.author.shortAddress : '', checkingCryptoAddress: false, showResolvingMessage: true, resolveString: t('crypto_address_verification'), @@ -62,6 +62,12 @@ const CryptoAddressSetting = () => { if (!cryptoState.cryptoAddress || !cryptoState.cryptoAddress.includes('.')) { alert(t('enter_crypto_address')); return; + } else if (cryptoState.cryptoAddress === account?.author?.address) { + setSavedCryptoAddress(true); + setTimeout(() => { + setSavedCryptoAddress(false); + }, 2000); + return; } else if (resolvedAddress && resolvedAddress !== account?.signer?.address) { alert(t('crypto_address_not_yours')); return; @@ -110,7 +116,7 @@ const CryptoAddressSetting = () => { { setInputValue(e.target.value); setCryptoState((prevState) => ({ ...prevState, cryptoAddress: e.target.value })); From fbb1020c411b404ca7a8eabb9331b49fed0f83f9 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Fri, 6 Dec 2024 10:02:53 +0100 Subject: [PATCH 5/8] remove annoying color --- .../settings-modal/account-settings/account-settings.module.css | 1 - .../settings-modal/avatar-settings/avatar-settings.module.css | 1 - 2 files changed, 2 deletions(-) diff --git a/src/components/settings-modal/account-settings/account-settings.module.css b/src/components/settings-modal/account-settings/account-settings.module.css index ce458df4..8ee19a63 100644 --- a/src/components/settings-modal/account-settings/account-settings.module.css +++ b/src/components/settings-modal/account-settings/account-settings.module.css @@ -45,7 +45,6 @@ .warning { font-size: 0.8em; - color: red; padding: 5px 0; } diff --git a/src/components/settings-modal/avatar-settings/avatar-settings.module.css b/src/components/settings-modal/avatar-settings/avatar-settings.module.css index 2f70da56..4b3fc77b 100644 --- a/src/components/settings-modal/avatar-settings/avatar-settings.module.css +++ b/src/components/settings-modal/avatar-settings/avatar-settings.module.css @@ -13,7 +13,6 @@ .warning { font-size: 0.8em; - color: red; padding: 0 10px 10px 10px; display: block; } From 16c8f39add8231df00c261891ee80ca312fc66a2 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Fri, 6 Dec 2024 12:30:22 +0100 Subject: [PATCH 6/8] fix(avatar settings): add timestamp field to let users add existing signature --- public/translations/ar/default.json | 2 +- public/translations/bn/default.json | 2 +- public/translations/cs/default.json | 2 +- public/translations/da/default.json | 2 +- public/translations/de/default.json | 2 +- public/translations/el/default.json | 2 +- public/translations/en/default.json | 2 +- public/translations/es/default.json | 2 +- public/translations/fa/default.json | 2 +- public/translations/fi/default.json | 2 +- public/translations/fil/default.json | 2 +- public/translations/fr/default.json | 2 +- public/translations/he/default.json | 2 +- public/translations/hi/default.json | 2 +- public/translations/hu/default.json | 2 +- public/translations/id/default.json | 2 +- public/translations/it/default.json | 2 +- public/translations/ja/default.json | 2 +- public/translations/ko/default.json | 2 +- public/translations/mr/default.json | 2 +- public/translations/nl/default.json | 2 +- public/translations/no/default.json | 2 +- public/translations/pl/default.json | 2 +- public/translations/pt/default.json | 2 +- public/translations/ro/default.json | 2 +- public/translations/ru/default.json | 2 +- public/translations/sq/default.json | 2 +- public/translations/sv/default.json | 2 +- public/translations/te/default.json | 2 +- public/translations/th/default.json | 2 +- public/translations/tr/default.json | 2 +- public/translations/uk/default.json | 2 +- public/translations/ur/default.json | 2 +- public/translations/vi/default.json | 2 +- public/translations/zh/default.json | 2 +- .../avatar-settings/avatar-settings.tsx | 12 ++++++++++++ 36 files changed, 47 insertions(+), 35 deletions(-) diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index c7ce4ca7..da67c269 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "عنوان العملة الرقمية ينتمي إلى حساب آخر.", "enter_crypto_address": "الرجاء إدخال عنوان كريبتو صالح.", "crypto_address_not_resolved": "لم يتم حل عنوان العملة الرقمية بعد.", - "copy_message_etherscan": "انسخ الرسالة للتوقيع على <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} رسالة للتوقيع على <2>etherscan", "account": "حساب", "crypto_address": "عنوان العملة الرقمية", "crypto_wallets": "محافظ العملات الرقمية", diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index 41a2ba6a..0dd7861a 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "ক্রিপ্টো ঠিকানা অন্য একটি অ্যাকাউন্টের অংশ।", "enter_crypto_address": "দয়া করে একটি বৈধ ক্রিপ্টো ঠিকানা দিন।", "crypto_address_not_resolved": "ক্রিপ্টো ঠিকানা এখনো সমাধান করা হয়নি।", - "copy_message_etherscan": "<1>etherscan এ সাইন করার জন্য বার্তা অনুলিপি করুন", + "copy_message_etherscan": "<1>{{copy}} বার্তা সাইন করতে <2>etherscan এ", "account": "অ্যাকাউন্ট", "crypto_address": "ক্রিপ্টো ঠিকানা", "crypto_wallets": "ক্রিপ্টো ওয়ালেট", diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index f229511c..be5eb808 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Adresa kryptoměny patří k jinému účtu.", "enter_crypto_address": "Zadejte prosím platnou kryptoadresu.", "crypto_address_not_resolved": "Adresa kryptoměny ještě není vyřešena.", - "copy_message_etherscan": "Zkopírujte zprávu k podpisu na <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} zpráva k podpisu na <2>etherscan", "account": "účet", "crypto_address": "adresa kryptoměny", "crypto_wallets": "Kryptoměny", diff --git a/public/translations/da/default.json b/public/translations/da/default.json index 31b1e588..07bae59f 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Crypto-adresse tilhører en anden konto.", "enter_crypto_address": "Indtast venligst en gyldig krypto adresse.", "crypto_address_not_resolved": "Crypto-adresse er endnu ikke løst.", - "copy_message_etherscan": "Kopiér besked til at underskrive på <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} besked at underskrive på <2>etherscan", "account": "konto", "crypto_address": "kryptoadresse", "crypto_wallets": "Crypto Wallets", diff --git a/public/translations/de/default.json b/public/translations/de/default.json index 9fe94204..15c1d797 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Krypto-Adresse gehört zu einem anderen Konto.", "enter_crypto_address": "Bitte geben Sie eine gültige Krypto-Adresse ein.", "crypto_address_not_resolved": "Krypto-Adresse ist noch nicht aufgelöst.", - "copy_message_etherscan": "Nachricht zum Signieren auf <1>etherscan kopieren", + "copy_message_etherscan": "<1>{{copy}} Nachricht zum Signieren auf <2>etherscan", "account": "Konto", "crypto_address": "Krypto-Adresse", "crypto_wallets": "Krypto-Wallets", diff --git a/public/translations/el/default.json b/public/translations/el/default.json index e2bbc5b4..2da0e4c2 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Η διεύθυνση κρυπτονομίσματος ανήκει σε άλλο λογαριασμό.", "enter_crypto_address": "Παρακαλώ εισαγάγετε μια έγκυρη διεύθυνση κρυπτονομίσματος.", "crypto_address_not_resolved": "Η διεύθυνση κρυπτονομίσματος δεν έχει ακόμη επιλυθεί.", - "copy_message_etherscan": "Αντιγράψτε το μήνυμα για υπογραφή στο <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} μήνυμα για υπογραφή στο <2>etherscan", "account": "λογαριασμός", "crypto_address": "διεύθυνση κρυπτονομίσματος", "crypto_wallets": "Πορτοφόλια κρυπτονομισμάτων", diff --git a/public/translations/en/default.json b/public/translations/en/default.json index faf6fc26..fffed5fc 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Crypto address belongs to another account.", "enter_crypto_address": "Please enter a valid crypto address.", "crypto_address_not_resolved": "Crypto address is not resolved yet.", - "copy_message_etherscan": "Copy message to sign on <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} message to sign on <2>etherscan", "account": "account", "crypto_address": "crypto address", "crypto_wallets": "Crypto Wallets", diff --git a/public/translations/es/default.json b/public/translations/es/default.json index e075da2f..07c06457 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "La dirección de criptomoneda pertenece a otra cuenta.", "enter_crypto_address": "Por favor, introduzca una dirección de cripto válida.", "crypto_address_not_resolved": "La dirección de criptomoneda aún no está resuelta.", - "copy_message_etherscan": "Copiar mensaje para firmar en <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} mensaje para firmar en <2>etherscan", "account": "cuenta", "crypto_address": "dirección de cripto", "crypto_wallets": "Billeteras cripto", diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index cfe14675..a9e68d1c 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "آدرس رمزارز به حساب دیگری تعلق دارد.", "enter_crypto_address": "لطفاً یک آدرس کریپتو صحیح وارد کنید.", "crypto_address_not_resolved": "آدرس رمزارز هنوز حل نشده است.", - "copy_message_etherscan": "پیام را برای امضا در <1>etherscan کپی کنید", + "copy_message_etherscan": "<1>{{copy}} پیامی برای امضا در <2>etherscan", "account": "حساب", "crypto_address": "آدرس رمزارز", "crypto_wallets": "کیف پول رمز ارز", diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index 352ec4da..4dd26b18 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Krypto-osoite kuuluu toiseen tiliin.", "enter_crypto_address": "Syötä voimassa oleva krypto-osoite.", "crypto_address_not_resolved": "Krypto-osoitetta ei ole vielä ratkaistu.", - "copy_message_etherscan": "Kopioi viesti allekirjoitettavaksi <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} viesti allekirjoitettavaksi <2>etherscan:ssa", "account": "tili", "crypto_address": "krypto-osoite", "crypto_wallets": "Krypto-lompakot", diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index d0e49cb1..614482dd 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Ang crypto address ay nauugnay sa ibang account.", "enter_crypto_address": "Mangyaring magpasok ng wastong crypto address.", "crypto_address_not_resolved": "Hindi pa naresolba ang crypto address.", - "copy_message_etherscan": "Kopyahin ang mensahe upang pirmahan sa <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} mensahe na pipirmahan sa <2>etherscan", "account": "account", "crypto_address": "crypto address", "crypto_wallets": "Mga Wallet ng Crypto", diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index d5dce7de..ee781425 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "L'adresse crypto appartient à un autre compte.", "enter_crypto_address": "Veuillez entrer une adresse crypto valide.", "crypto_address_not_resolved": "L'adresse crypto n'est pas encore résolue.", - "copy_message_etherscan": "Copier le message à signer sur <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} message à signer sur <2>etherscan", "account": "compte", "crypto_address": "adresse crypto", "crypto_wallets": "Portefeuilles de crypto", diff --git a/public/translations/he/default.json b/public/translations/he/default.json index 4cf8e125..86aa8bf0 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "כתובת המטבע הקריפטוגרפי שייכת לחשבון אחר.", "enter_crypto_address": "אנא הזן כתובת קריפטו תקף.", "crypto_address_not_resolved": "כתובת המטבע הקריפטוגרפית עדיין לא נפתרה.", - "copy_message_etherscan": "העתק הודעה לחתימה ב-<1>etherscan", + "copy_message_etherscan": "<1>{{copy}} הודעה לחתימה ב-<2>etherscan", "account": "חשבון", "crypto_address": "כתובת קריפטו", "crypto_wallets": "ארנק קריפטו", diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index d868f138..4c279517 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "क्रिप्टो पता दूसरे खाते से संबंधित है।", "enter_crypto_address": "कृपया एक मान्य क्रिप्टो पता दर्ज करें।", "crypto_address_not_resolved": "क्रिप्टो पता अभी तक हल नहीं किया गया है।", - "copy_message_etherscan": "<1>etherscan पर साइन करने के लिए संदेश कॉपी करें", + "copy_message_etherscan": "<1>{{copy}} संदेश को <2>etherscan पर हस्ताक्षर करें", "account": "खाता", "crypto_address": "क्रिप्टो पता", "crypto_wallets": "क्रिप्टो वॉलेट्स", diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index 067af75d..ee636fdc 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "A kripto-cím egy másik fiókhoz tartozik.", "enter_crypto_address": "Kérjük, adjon meg egy érvényes kripto címet.", "crypto_address_not_resolved": "A kripto cím még nem oldódott meg.", - "copy_message_etherscan": "Üzenet másolása aláíráshoz a <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} üzenet aláírásához az <2>etherscan-en", "account": "fiók", "crypto_address": "kriptovaluta cím", "crypto_wallets": "Kriptopénztárcák", diff --git a/public/translations/id/default.json b/public/translations/id/default.json index 51160707..7d5e7fb8 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Alamat kripto milik akun lain.", "enter_crypto_address": "Harap masukkan alamat kripto yang valid.", "crypto_address_not_resolved": "Alamat kripto belum terpecahkan.", - "copy_message_etherscan": "Salin pesan untuk ditandatangani di <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} pesan untuk ditandatangani di <2>etherscan", "account": "akun", "crypto_address": "alamat kripto", "crypto_wallets": "Dompet Crypto", diff --git a/public/translations/it/default.json b/public/translations/it/default.json index 6adcc5cb..819a3cf9 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "L'indirizzo cripto appartiene a un altro account.", "enter_crypto_address": "Inserisci un indirizzo cripto valido.", "crypto_address_not_resolved": "L'indirizzo cripto non è ancora risolto.", - "copy_message_etherscan": "Copia messaggio da firmare su <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} messaggio da firmare su <2>etherscan", "account": "account", "crypto_address": "indirizzo crypto", "crypto_wallets": "Wallet crypto", diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index 330dcdbb..1d692fb7 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "暗号通貨アドレスは別のアカウントに属しています。", "enter_crypto_address": "有効な暗号通貨アドレスを入力してください。", "crypto_address_not_resolved": "暗号通貨アドレスはまだ解決されていません。", - "copy_message_etherscan": "<1>etherscanで署名するメッセージをコピー", + "copy_message_etherscan": "<1>{{copy}} メッセージを<2>etherscanでサイン", "account": "アカウント", "crypto_address": "暗号通貨アドレス", "crypto_wallets": "暗号通貨ウォレット", diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index 3762d2a3..c78b8e5d 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "암호 주소는 다른 계정에 속합니다.", "enter_crypto_address": "유효한 암호 주소를 입력하세요.", "crypto_address_not_resolved": "암호 주소가 아직 해결되지 않았습니다.", - "copy_message_etherscan": "<1>etherscan에서 서명할 메시지 복사", + "copy_message_etherscan": "<1>{{copy}} 메시지를 <2>etherscan에서 서명", "account": "계정", "crypto_address": "암호 화폐 주소", "crypto_wallets": "암호 화폐 지갑", diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index bc59f938..01d87a57 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "क्रिप्टो पत्ता इतर खात्याशी संबंधित आहे.", "enter_crypto_address": "कृपया मान्य क्रिप्टो पत्ता प्रविष्ट करा.", "crypto_address_not_resolved": "क्रिप्टो पत्ता अजून सोपवला नाही.", - "copy_message_etherscan": "<1>etherscan वर स्वाक्षरीसाठी संदेश कॉपी करा", + "copy_message_etherscan": "<1>{{copy}} संदेश <2>etherscan वर हस्ताक्षर करण्यासाठी", "account": "खाता", "crypto_address": "क्रिप्टो पत्ता", "crypto_wallets": "क्रिप्टो बटव्या", diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index f4b30d30..f81827b6 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Crypto-adres behoort tot een andere account.", "enter_crypto_address": "Voer alstublieft een geldig crypto-adres in.", "crypto_address_not_resolved": "Crypto-adres is nog niet opgelost.", - "copy_message_etherscan": "Kopieer bericht om te ondertekenen op <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} bericht om te ondertekenen op <2>etherscan", "account": "account", "crypto_address": "crypto adres", "crypto_wallets": "Crypto-portefeuilles", diff --git a/public/translations/no/default.json b/public/translations/no/default.json index f5531d21..17610014 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Crypto-adressen tilhører en annen konto.", "enter_crypto_address": "Vennligst skriv inn en gyldig kryptoadresse.", "crypto_address_not_resolved": "Crypto-adresse er ikke løst ennå.", - "copy_message_etherscan": "Kopier melding for å signere på <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} melding å signere på <2>etherscan", "account": "konto", "crypto_address": "kryptoadresse", "crypto_wallets": "Crypto-lommebøker", diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index 75e3d78c..9cebec51 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Adres kryptowaluty należy do innego konta.", "enter_crypto_address": "Proszę podać prawidłowy adres kryptowalutowy.", "crypto_address_not_resolved": "Adres kryptowaluty nie jest jeszcze rozwiązany.", - "copy_message_etherscan": "Skopiuj wiadomość do podpisania na <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} wiadomość do podpisania na <2>etherscan", "account": "konto", "crypto_address": "adres kryptowalutowy", "crypto_wallets": "Portfele kryptowalut", diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index 44c19686..698197c1 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "O endereço de criptomoeda pertence a outra conta.", "enter_crypto_address": "Por favor, insira um endereço de cripto válido.", "crypto_address_not_resolved": "O endereço de criptomoeda ainda não foi resolvido.", - "copy_message_etherscan": "Copiar mensagem para assinar no <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} mensagem para assinar no <2>etherscan", "account": "conta", "crypto_address": "endereço de cripto", "crypto_wallets": "Carteiras cripto", diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index 2455602f..697384e4 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Adresa crypto aparține unui alt cont.", "enter_crypto_address": "Vă rugăm să introduceți o adresă crypto validă.", "crypto_address_not_resolved": "Adresa crypto nu este încă rezolvată.", - "copy_message_etherscan": "Copiați mesajul pentru a semna pe <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} mesaj de semnat pe <2>etherscan", "account": "cont", "crypto_address": "adresa cripto", "crypto_wallets": "Portofele crypto", diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index f8839d7f..aa857568 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Адрес криптовалюты принадлежит другому аккаунту.", "enter_crypto_address": "Пожалуйста, введите действительный криптовалютный адрес.", "crypto_address_not_resolved": "Адрес криптовалюты еще не решен.", - "copy_message_etherscan": "Скопируйте сообщение для подписи на <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} сообщение для подписи на <2>etherscan", "account": "аккаунт", "crypto_address": "адрес криптовалюты", "crypto_wallets": "Криптокошельки", diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index b19ea302..589d0fcb 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Adresa e kriptovalutës i përket një llogarie tjetër.", "enter_crypto_address": "Ju lutemi vendosni një adresë kripto të vlefshme.", "crypto_address_not_resolved": "Adresa e kriptovalutës nuk është ende e zgjidhur.", - "copy_message_etherscan": "Kopjoni mesazhin për të nënshkruar në <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} mesazh për nënshkrim në <2>etherscan", "account": "llogari", "crypto_address": "adresa e kripto", "crypto_wallets": "Portofolitë e cryptos", diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index 4aae1018..4a4a30e3 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Crypto-adress tillhör ett annat konto.", "enter_crypto_address": "Ange en giltig kryptoadress.", "crypto_address_not_resolved": "Crypto-adressen är ännu inte löst.", - "copy_message_etherscan": "Kopiera meddelande för att signera på <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} meddelande att signera på <2>etherscan", "account": "konto", "crypto_address": "kryptoadress", "crypto_wallets": "Crypto-plånböcker", diff --git a/public/translations/te/default.json b/public/translations/te/default.json index 95b59168..401edaf2 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "క్రిప్టో చిరునామా మరొక ఖాతాకు చేరుకుంది.", "enter_crypto_address": "దయచేసి చేసిన క్రిప్టో చిరునామాను నమోదు చేయండి.", "crypto_address_not_resolved": "క్రిప్టో చిరునామా ఇంకా పరిష్కరించబడలేదు.", - "copy_message_etherscan": "<1>etherscan లో సైన్ చేయడానికి సందేశాన్ని కాపీ చేయండి", + "copy_message_etherscan": "<1>{{copy}} సందేశం సాఇన్ చేయడానికి <2>etherscan మీద", "account": "ఖాతా", "crypto_address": "క్రిప్టో చిరునామా", "crypto_wallets": "క్రిప్టో వాలెట్‌లు", diff --git a/public/translations/th/default.json b/public/translations/th/default.json index b4b2344d..2197bb68 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "ที่อยู่คริปโตเป็นของบัญชีอื่น", "enter_crypto_address": "โปรดป้อนที่อยู่คริปโตที่ถูกต้อง", "crypto_address_not_resolved": "ที่อยู่คริปโตยังไม่ได้รับการแก้ไข", - "copy_message_etherscan": "คัดลอกข้อความเพื่อลงนามบน <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} ข้อความเพื่อเซ็นบน <2>etherscan", "account": "บัญชี", "crypto_address": "ที่อยู่คริปโต", "crypto_wallets": "กระเป๋าเงินดิจิทัล", diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index ae777ac6..e65c03ca 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Kripto adres başka bir hesaba aittir.", "enter_crypto_address": "Lütfen geçerli bir kripto adresi girin.", "crypto_address_not_resolved": "Kripto adres henüz çözülmedi.", - "copy_message_etherscan": "<1>etherscan üzerinde imzalamak için mesajı kopyala", + "copy_message_etherscan": "<1>{{copy}} <2>etherscan üzerinde imzalanacak mesaj", "account": "hesap", "crypto_address": "kripto adres", "crypto_wallets": "Kripto Cüzdanlar", diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index 07bab21d..3bdbddda 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Адреса криптовалюти належить до іншого облікового запису.", "enter_crypto_address": "Будь ласка, введіть дійсну криптовалютну адресу.", "crypto_address_not_resolved": "Адреса криптовалюти ще не вирішена.", - "copy_message_etherscan": "Скопіюйте повідомлення для підпису на <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} повідомлення для підпису на <2>etherscan", "account": "рахунок", "crypto_address": "адреса криптовалюти", "crypto_wallets": "Криптокошельки", diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index ad663a4f..ea9a4b38 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "کرپٹو پتا دوسرے اکاؤنٹ کا حصہ ہے۔", "enter_crypto_address": "براہ کرم ایک معتبر کرپٹو پتہ داخل کریں۔", "crypto_address_not_resolved": "کرپٹو پتا ابھی تک حل نہیں ہوا ہے۔", - "copy_message_etherscan": "<1>etherscan پر دستخط کرنے کے لیے پیغام کاپی کریں", + "copy_message_etherscan": "<1>{{copy}} پیغام <2>etherscan پر دستخط کریں", "account": "اکاؤنٹ", "crypto_address": "کرپٹو پتہ", "crypto_wallets": "کرپٹو والٹس", diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index 9a0aabe0..d7f25a04 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "Địa chỉ tiền điện tử thuộc về một tài khoản khác.", "enter_crypto_address": "Vui lòng nhập địa chỉ tiền điện tử hợp lệ.", "crypto_address_not_resolved": "Địa chỉ tiền điện tử vẫn chưa được giải quyết.", - "copy_message_etherscan": "Sao chép tin nhắn để ký trên <1>etherscan", + "copy_message_etherscan": "<1>{{copy}} tin nhắn để ký trên <2>etherscan", "account": "tài khoản", "crypto_address": "địa chỉ tiền điện tử", "crypto_wallets": "Ví tiền điện tử", diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index d46cebd6..f0ff0fdf 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -103,7 +103,7 @@ "crypto_address_not_yours": "加密地址属于另一个帐户。", "enter_crypto_address": "请输入有效的加密货币地址。", "crypto_address_not_resolved": "加密地址尚未解析。", - "copy_message_etherscan": "复制消息以在<1>etherscan上签名", + "copy_message_etherscan": "<1>{{copy}} 在<2>etherscan上签名的消息", "account": "帐户", "crypto_address": "加密地址", "crypto_wallets": "加密货币钱包", diff --git a/src/components/settings-modal/avatar-settings/avatar-settings.tsx b/src/components/settings-modal/avatar-settings/avatar-settings.tsx index 1e21edc4..32cd4a0f 100644 --- a/src/components/settings-modal/avatar-settings/avatar-settings.tsx +++ b/src/components/settings-modal/avatar-settings/avatar-settings.tsx @@ -183,6 +183,18 @@ const AvatarSettings = () => { }} /> +
+ {t('timestamp')} + setTimestamp(Number(e.target.value))} + /> +
{t('paste_signature')} Date: Thu, 12 Dec 2024 16:38:04 +0100 Subject: [PATCH 7/8] fix(feed post): gif thumbnail could break persistently --- src/hooks/use-fetch-gif-first-frame.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hooks/use-fetch-gif-first-frame.ts b/src/hooks/use-fetch-gif-first-frame.ts index 88c85bd3..f936caae 100644 --- a/src/hooks/use-fetch-gif-first-frame.ts +++ b/src/hooks/use-fetch-gif-first-frame.ts @@ -75,8 +75,13 @@ const useFetchGifFirstFrame = (url: string | undefined) => { try { const cachedFrame = await getCachedGifFrame(url); if (cachedFrame) { - if (isActive) setFrameUrl(cachedFrame); - return; + try { + const response = await fetch(cachedFrame); + if (response.ok) { + if (isActive) setFrameUrl(cachedFrame); + return; + } + } catch {} } const blob = typeof url === 'string' ? await parseGif(await fetchImage(url)) : await parseGif(await readImage(url as File)); From d3e11bd48cf6480d331600b9c7640c7869058289 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Thu, 12 Dec 2024 16:41:18 +0100 Subject: [PATCH 8/8] refactor, don't allow click to enlarge on 404'd images --- .../comment-media/comment-media.tsx | 115 +++++++++++------- 1 file changed, 69 insertions(+), 46 deletions(-) diff --git a/src/components/comment-media/comment-media.tsx b/src/components/comment-media/comment-media.tsx index c81e97ba..78f6fe3c 100644 --- a/src/components/comment-media/comment-media.tsx +++ b/src/components/comment-media/comment-media.tsx @@ -29,18 +29,14 @@ interface MediaProps { const Thumbnail = ({ commentMediaInfo, deleted, displayHeight, displayWidth, isFloatingEmbed, isOutOfFeed, isReply, removed, spoiler, setShowThumbnail }: MediaProps) => { const isMobile = useIsMobile(); const { patternThumbnailUrl, thumbnail, type, url } = commentMediaInfo || {}; - const [hasError, setHasError] = useState(false); - const handleError = () => setHasError(true); let thumbnailComponent: React.ReactNode = null; const iframeThumbnail = patternThumbnailUrl || thumbnail; const gifFrameUrl = useFetchGifFirstFrame(type === 'gif' ? url : undefined); const hasThumbnail = getHasThumbnail(commentMediaInfo, url); - if (type === 'gif' && gifFrameUrl) { - thumbnailComponent = setShowThumbnail(false)} />; - } else if (type === 'image') { - thumbnailComponent = setShowThumbnail(false)} />; + if (type === 'gif') { + thumbnailComponent = setShowThumbnail(false)} />; } else if (type === 'video') { thumbnailComponent = thumbnail ? ( @@ -61,7 +57,7 @@ const Thumbnail = ({ commentMediaInfo, deleted, displayHeight, displayWidth, isF const linkWithoutThumbnail = url && new URL(url); - return hasError || deleted || removed ? ( + return deleted || removed ? ( File deleted ) : spoiler ? ( setShowThumbnail(false)} /> @@ -106,8 +102,6 @@ const Media = ({ commentMediaInfo, isReply, setShowThumbnail }: MediaProps) => { setShowThumbnail(true)} /> ) : type === 'video' ? (