mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
add stats ui, update popular threads
This commit is contained in:
@@ -229,6 +229,17 @@
|
|||||||
white-space: pre-line;
|
white-space: pre-line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.stats {
|
||||||
|
margin-top: 5px;
|
||||||
|
text-align: center;
|
||||||
|
color: #800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats .stat {
|
||||||
|
display: inline-block;
|
||||||
|
width: 33%;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
.content {
|
.content {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|||||||
+19
-4
@@ -154,7 +154,7 @@ const PopularThreads = ({ subplebbits }: { subplebbits: any }) => {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
isMediaShowed &&
|
isMediaShowed &&
|
||||||
replyCount >= 2 &&
|
replyCount > 0 &&
|
||||||
!deleted &&
|
!deleted &&
|
||||||
!removed &&
|
!removed &&
|
||||||
!locked &&
|
!locked &&
|
||||||
@@ -213,14 +213,29 @@ const PopularThreads = ({ subplebbits }: { subplebbits: any }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const Stats = () => {
|
const Stats = ({ subplebbitAddresses }: { subplebbitAddresses: string[] }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
// const { totalPosts, currentUsers, boardsTracked } = useSubplebbitStats(subplebbitAddresses);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.box}>
|
<div className={styles.box}>
|
||||||
<div className={`${styles.boxBar} ${styles.color2ColorBar}`}>
|
<div className={`${styles.boxBar} ${styles.color2ColorBar}`}>
|
||||||
<h2 className={styles.capitalize}>{t('stats')}</h2>
|
<h2 className={styles.capitalize}>{t('stats')}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.boxContent}></div>
|
<div className={`${styles.boxContent} ${styles.stats}`}>
|
||||||
|
{/* <div className={styles.statsInfo}>
|
||||||
|
<p>{t('stats_info')}</p>
|
||||||
|
</div> */}
|
||||||
|
<div className={styles.stat}>
|
||||||
|
<b>Total Posts:</b>{' '}
|
||||||
|
</div>
|
||||||
|
<div className={styles.stat}>
|
||||||
|
<b>Current Users:</b>{' '}
|
||||||
|
</div>
|
||||||
|
<div className={styles.stat}>
|
||||||
|
<b>Boards Tracked:</b>{' '}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -329,7 +344,7 @@ const Home = () => {
|
|||||||
<InfoBox />
|
<InfoBox />
|
||||||
<Boards defaultSubplebbits={defaultSubplebbits} />
|
<Boards defaultSubplebbits={defaultSubplebbits} />
|
||||||
<PopularThreads subplebbits={subplebbits} />
|
<PopularThreads subplebbits={subplebbits} />
|
||||||
<Stats />
|
<Stats subplebbitAddresses={subplebbitAddresses} />
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user