mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
style(homepage): display '?' as title while it's loading, if there's no title display shortAddress without tld
This commit is contained in:
@@ -14,7 +14,7 @@ import { nsfwTags } from '../home';
|
|||||||
|
|
||||||
const Board = ({ subplebbit, isMobile }: { subplebbit: Subplebbit; isMobile: boolean }) => {
|
const Board = ({ subplebbit, isMobile }: { subplebbit: Subplebbit; isMobile: boolean }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { address, title, tags } = subplebbit || {};
|
const { address, tags } = subplebbit || {};
|
||||||
const nsfwTag = tags?.find((tag: string) => nsfwTags.includes(tag));
|
const nsfwTag = tags?.find((tag: string) => nsfwTags.includes(tag));
|
||||||
|
|
||||||
let stats = useSubplebbitStats({ subplebbitAddress: address });
|
let stats = useSubplebbitStats({ subplebbitAddress: address });
|
||||||
@@ -25,6 +25,10 @@ const Board = ({ subplebbit, isMobile }: { subplebbit: Subplebbit; isMobile: boo
|
|||||||
const displayAddress = address && Plebbit.getShortAddress(address);
|
const displayAddress = address && Plebbit.getShortAddress(address);
|
||||||
const showOfflineIcon = address && (isOffline || isOnlineStatusLoading);
|
const showOfflineIcon = address && (isOffline || isOnlineStatusLoading);
|
||||||
|
|
||||||
|
const title =
|
||||||
|
subplebbitData?.title ||
|
||||||
|
(subplebbitData?.updatedAt ? (displayAddress.endsWith('.eth') || displayAddress.endsWith('.sol') ? displayAddress.slice(0, -4) : displayAddress) : '?');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr className={styles.subplebbit} key={address}>
|
<tr className={styles.subplebbit} key={address}>
|
||||||
<td className={styles.boardAddress}>
|
<td className={styles.boardAddress}>
|
||||||
@@ -41,7 +45,7 @@ const Board = ({ subplebbit, isMobile }: { subplebbit: Subplebbit; isMobile: boo
|
|||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
<td className={styles.boardTitle}>
|
<td className={styles.boardTitle}>
|
||||||
<p className={styles.boardCell}>{title || displayAddress}</p>
|
<p className={styles.boardCell}>{title}</p>
|
||||||
</td>
|
</td>
|
||||||
{!isMobile && (
|
{!isMobile && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user