improve settings UI, translations, offline status

This commit is contained in:
Tom (plebeius.eth)
2024-10-15 12:52:57 +02:00
parent c2aa9cad49
commit 44a09f9e5b
39 changed files with 148 additions and 47 deletions
+3 -3
View File
@@ -339,12 +339,12 @@ const PostForm = () => {
const [showForm, setShowForm] = useState(false);
const subplebbit = useSubplebbit({ subplebbitAddress: params?.subplebbitAddress });
const { isOffline, offlineTitle } = useIsSubplebbitOffline(subplebbit);
const { isOffline, isOnlineStatusLoading, offlineTitle } = useIsSubplebbitOffline(subplebbit);
return (
<>
<div className={styles.postFormDesktop}>
{!(isInAllView || isInSubscriptionsView) && showForm && (isOffline || isOffline) && <div className={styles.offlineBoard}>{offlineTitle}</div>}
{!(isInAllView || isInSubscriptionsView) && showForm && (isOffline || isOnlineStatusLoading) && <div className={styles.offlineBoard}>{offlineTitle}</div>}
{isThreadClosed ? (
<div className={styles.closed}>
{t('thread_closed')}
@@ -364,7 +364,7 @@ const PostForm = () => {
)}
</div>
<div className={styles.postFormMobile}>
{!(isInAllView || isInSubscriptionsView) && showForm && (isOffline || isOffline) && <div className={styles.offlineBoard}>{offlineTitle}</div>}
{!(isInAllView || isInSubscriptionsView) && showForm && (isOffline || isOnlineStatusLoading) && <div className={styles.offlineBoard}>{offlineTitle}</div>}
{isThreadClosed ? (
<div className={styles.closed}>
{t('thread_closed')}
@@ -13,10 +13,6 @@
font-style: italic;
}
.removeWallet {
color: red;
}
.save {
margin-top: 10px;
margin-right: 5px;
@@ -89,7 +89,7 @@ const CryptoWalletsForm = ({ account }: { account: Account | undefined }) => {
const _removeWallet = (index: number) => {
const wallet = walletsArray[index];
if (window.confirm(t('delete_confirm', { value: wallet.chainTicker, interpolation: { escapeValue: false } }))) {
if (window.confirm(t('delete_confirm', { value: wallet.address, interpolation: { escapeValue: false } }))) {
const newArray = [...walletsArray.slice(0, index), ...walletsArray.slice(index + 1)];
setWalletsArray(newArray);
setSelectedWallet(0);
@@ -142,10 +142,10 @@ const CryptoWalletsForm = ({ account }: { account: Account | undefined }) => {
/>
<div className={styles.buttons}>
<button className={styles.save} onClick={save}>
{t('save')}
{t('save_changes')}
</button>
<button className={styles.removeWallet} onClick={() => _removeWallet(selectedWallet)}>
{t('remove')}
{t('delete_wallet')}
</button>
</div>
</div>
@@ -170,7 +170,7 @@ const CryptoWalletsForm = ({ account }: { account: Account | undefined }) => {
setSelectedWallet(newIndex);
}}
>
+
{t('create')}
</button>
</div>
{walletsInputs}
+1 -1
View File
@@ -34,7 +34,7 @@ const useIsSubplebbitOffline = (subplebbit: Subplebbit) => {
const offlineIconClass = isLoading ? 'yellowOfflineIcon' : isOffline ? 'redOfflineIcon' : '';
const offlineTitle = isLoading
? t('loading')
? t('loading_subplebbit')
: updatedAt
? isOffline && t('posts_last_synced_info', { time: getFormattedTimeAgo(updatedAt), interpolation: { escapeValue: false } })
: t('subplebbit_offline_info');