mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(board header): add sub online status info to offline icon title
This commit is contained in:
@@ -23,14 +23,14 @@
|
||||
text-align: center;
|
||||
color: red;
|
||||
font-weight: 700;
|
||||
padding: 100px 0;
|
||||
padding: 100px 15px;
|
||||
}
|
||||
|
||||
.offlineBoard {
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: red;
|
||||
padding: 30px 0;
|
||||
padding: 30px 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
@@ -273,22 +273,16 @@ const PostForm = () => {
|
||||
|
||||
const subplebbit = useSubplebbit({ subplebbitAddress: params?.subplebbitAddress });
|
||||
const { updatedAt } = subplebbit || {};
|
||||
const isBoardOffline = subplebbit?.updatedAt && subplebbit.updatedAt < Date.now() / 1000 - 60 * 60;
|
||||
const isBoardOffline = updatedAt && updatedAt < Date.now() / 1000 - 60 * 60;
|
||||
|
||||
const offlineAlert =
|
||||
showForm &&
|
||||
(updatedAt ? (
|
||||
isBoardOffline && (
|
||||
<div className={styles.offlineBoard}>{t('posts_last_synced_info', { time: getFormattedTimeAgo(updatedAt), interpolation: { escapeValue: false } })}</div>
|
||||
)
|
||||
) : (
|
||||
<div className={styles.offlineBoard}>{t('subplebbit_offline_info')}</div>
|
||||
));
|
||||
const offlineMessage = updatedAt
|
||||
? isBoardOffline && t('posts_last_synced_info', { time: getFormattedTimeAgo(updatedAt), interpolation: { escapeValue: false } })
|
||||
: t('subplebbit_offline_info');
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles.postFormDesktop}>
|
||||
{!(isInAllView || isInSubscriptionsView) && offlineAlert}
|
||||
{!(isInAllView || isInSubscriptionsView) && showForm && <div className={styles.offlineBoard}>{offlineMessage}</div>}
|
||||
{isThreadClosed ? (
|
||||
<div className={styles.closed}>
|
||||
{t('thread_closed')}
|
||||
@@ -308,7 +302,7 @@ const PostForm = () => {
|
||||
)}
|
||||
</div>
|
||||
<div className={styles.postFormMobile}>
|
||||
{!(isInAllView || isInSubscriptionsView) && offlineAlert}
|
||||
{!(isInAllView || isInSubscriptionsView) && showForm && <div className={styles.offlineBoard}>{offlineMessage}</div>}
|
||||
{isThreadClosed ? (
|
||||
<div className={styles.closed}>
|
||||
{t('thread_closed')}
|
||||
|
||||
Reference in New Issue
Block a user