diff --git a/src/views/pending-post/pending-post.tsx b/src/views/pending-post/pending-post.tsx index c8724c39..ee19f87d 100644 --- a/src/views/pending-post/pending-post.tsx +++ b/src/views/pending-post/pending-post.tsx @@ -1,12 +1,14 @@ import { useEffect } from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { useAccountComment } from '@plebbit/plebbit-react-hooks'; +import { useTranslation } from 'react-i18next'; import styles from './pending-post.module.css'; import Post from '../../components/post'; import useStateString from '../../hooks/use-state-string'; import LoadingEllipsis from '../../components/loading-ellipsis'; const PendingPost = () => { + const { t } = useTranslation(); const { accountCommentIndex } = useParams<{ accountCommentIndex?: string }>(); const commentIndex = accountCommentIndex ? parseInt(accountCommentIndex) : undefined; const post = useAccountComment({ commentIndex }); @@ -21,14 +23,10 @@ const PendingPost = () => { } }, [post, navigate]); - const loadingString = stateString && ( -
{stateString !== 'Failed' ? : stateString}
- ); - return (
- {loadingString} +
{stateString && stateString !== 'Failed' ? : t('failed')}
); }; diff --git a/src/views/post-page/post-page.module.css b/src/views/post-page/post-page.module.css index 070d799b..9a9df228 100644 --- a/src/views/post-page/post-page.module.css +++ b/src/views/post-page/post-page.module.css @@ -40,6 +40,7 @@ .loadingString { padding: 5px; + position: absolute; } .dropdown { diff --git a/src/views/post-page/post-page.tsx b/src/views/post-page/post-page.tsx index 43ffaa1d..87b3ee55 100644 --- a/src/views/post-page/post-page.tsx +++ b/src/views/post-page/post-page.tsx @@ -38,7 +38,6 @@ const Post = ({ post }: { post: Comment }) => { const commentCount = replyCount === 0 ? t('no_comments') : replyCount === 1 ? t('one_comment') : t('all_comments', { count: replyCount }); const stateString = useStateString(post); - const loadingString = stateString &&
{stateString !== 'failed' ? : stateString}
; const lockedState = deleted ? t('deleted') : locked ? t('locked') : removed ? t('removed') : ''; @@ -84,7 +83,15 @@ const Post = ({ post }: { post: Comment }) => { )} - {loadingString && loadingString} + + {stateString && stateString !== 'Failed' ? ( +
+ +
+ ) : ( + t('failed') + )} +
); }; @@ -98,7 +105,6 @@ const PostWithContext = ({ post }: { post: Comment }) => { const topParentComment = useComment({ commentCid: topParentCid || '' }); const stateString = useStateString(post); - const loadingString = stateString &&
{stateString !== 'failed' ? : stateString}
; return ( <> @@ -117,7 +123,13 @@ const PostWithContext = ({ post }: { post: Comment }) => {
- {loadingString && loadingString} + {stateString && stateString !== 'Failed' ? ( +
+ +
+ ) : ( + t('failed') + )}
{t('single_comment_notice')}
diff --git a/src/views/settings/address-settings/address-settings.tsx b/src/views/settings/address-settings/address-settings.tsx index 664ad078..904b1d3c 100644 --- a/src/views/settings/address-settings/address-settings.tsx +++ b/src/views/settings/address-settings/address-settings.tsx @@ -155,7 +155,6 @@ const AddressSettings = () => { {' '} {cryptoState.resolveString}
-
); diff --git a/src/views/settings/plebbit-options/plebbit-options.tsx b/src/views/settings/plebbit-options/plebbit-options.tsx index 935be0d5..1625bcfc 100644 --- a/src/views/settings/plebbit-options/plebbit-options.tsx +++ b/src/views/settings/plebbit-options/plebbit-options.tsx @@ -73,7 +73,7 @@ const PlebbitRPCSettings = ({ isElectron }: { isElectron: boolean }) => { {showInfo && (
- use a plebbit full node locally, or remotely via SSL + use a plebbit full node locally, or remotely with SSL
  1. get secret auth key from the node