Merge pull request #19 from plebbit/development

Development
This commit is contained in:
plebeius.eth
2023-10-21 21:52:47 +02:00
committed by GitHub
7 changed files with 58 additions and 52 deletions

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 121 KiB

View File

@@ -1,7 +1,7 @@
{
"header_hot": "hot",
"header_new": "new",
"header_rising": "rising",
"header_active": "active",
"header_controversial": "controversial",
"header_top": "top",
"account_bar_preferences": "preferences",

View File

@@ -1,7 +1,7 @@
{
"header_hot": "popolari",
"header_new": "nuovi",
"header_rising": "in crescita",
"header_active": "attivi",
"header_controversial": "discussi",
"header_top": "più votati",
"account_bar_preferences": "preferenze",

View File

@@ -4,7 +4,7 @@
.expando {
display: block;
padding: 5px 0 5px 0;
padding: 5px;
clear: left;
position: relative;
}

View File

@@ -1,8 +1,12 @@
.container {
clear: both;
display: flex;
flex-direction: column;
padding-bottom: 8px;
}
.row {
display: flex;
align-items: flex-start;
padding-bottom: 8px;
}
.leftcol {

View File

@@ -30,56 +30,58 @@ const FeedPost: FC<FeedPostProps> = ({ post, index }) => {
return (
<div className={styles.container} key={index}>
<div className={styles.leftcol}>
<div className={styles.midcol}>
<div className={styles.arrowWrapper}>
<div className={`${styles.arrowCommon} ${styles.arrowUp}`}></div>
<div className={styles.row}>
<div className={styles.leftcol}>
<div className={styles.midcol}>
<div className={styles.arrowWrapper}>
<div className={`${styles.arrowCommon} ${styles.arrowUp}`}></div>
</div>
<div className={styles.score}>{upvoteCount === 0 && downvoteCount === 0 ? '•' : upvoteCount - downvoteCount}</div>
<div className={styles.arrowWrapper}>
<div className={`${styles.arrowCommon} ${styles.arrowDown}`}></div>
</div>
</div>
<div className={styles.score}>{upvoteCount === 0 && downvoteCount === 0 ? '•' : upvoteCount - downvoteCount}</div>
<div className={styles.arrowWrapper}>
<div className={`${styles.arrowCommon} ${styles.arrowDown}`}></div>
{hasThumbnail && <Thumbnail commentCid={cid} />}
</div>
<div className={styles.entry}>
<div className={styles.topMatter}>
<p className={styles.title}>
<Link className={styles.link} to={`p/${subplebbitAddress}/c/${cid}`} onClick={(e) => e.preventDefault()}>
{postTitleOrContent}
</Link>
{flair && (
<>
&nbsp;
<Flair flair={flair} />
</>
)}
&nbsp;
{linkUrl && (
<span className={styles.domain}>
(
<a href={link} target='_blank' rel='noreferrer'>
{linkUrl}
</a>
)
</span>
)}
</p>
<ExpandButton commentCid={cid} expanded={expanded} hasThumbnail={hasThumbnail} toggleExpanded={toggleExpanded} />
<p className={styles.tagline}>
{t('feed_post_submitted')} {utils.getFormattedTime(timestamp)} {t('feed_post_by')}&nbsp;
<Link className={styles.author} to={`u/${author.shortAddress}`} onClick={(e) => e.preventDefault()}>
u/{author.shortAddress}
</Link>
 {t('feed_post_to')}
<Link className={styles.subplebbit} to={`p/${subplebbitAddress}`} onClick={(e) => e.preventDefault()}>
&nbsp;p/{subplebbit.shortAddress}
</Link>
</p>
<PostTools commentCid={cid} />
</div>
</div>
{hasThumbnail && <Thumbnail commentCid={cid} />}
</div>
<div className={styles.entry}>
<div className={styles.topMatter}>
<p className={styles.title}>
<Link className={styles.link} to={`p/${subplebbitAddress}/c/${cid}`} onClick={(e) => e.preventDefault()}>
{postTitleOrContent}
</Link>
{flair && (
<>
&nbsp;
<Flair flair={flair} />
</>
)}
&nbsp;
{linkUrl && (
<span className={styles.domain}>
(
<a href={link} target='_blank' rel='noreferrer'>
{linkUrl}
</a>
)
</span>
)}
</p>
<ExpandButton commentCid={cid} expanded={expanded} hasThumbnail={hasThumbnail} toggleExpanded={toggleExpanded} />
<p className={styles.tagline}>
{t('feed_post_submitted')} {utils.getFormattedTime(timestamp)} {t('feed_post_by')}&nbsp;
<Link className={styles.author} to={`u/${author.shortAddress}`} onClick={(e) => e.preventDefault()}>
u/{author.shortAddress}
</Link>
 {t('feed_post_to')}
<Link className={styles.subplebbit} to={`p/${subplebbitAddress}`} onClick={(e) => e.preventDefault()}>
&nbsp;p/{subplebbit.shortAddress}
</Link>
</p>
<PostTools commentCid={cid} />
</div>
<Expando commentCid={cid} expanded={expanded} />
</div>
<Expando commentCid={cid} expanded={expanded} />
</div>
);
};

View File

@@ -14,7 +14,7 @@ const Header: FC = () => {
const [theme] = useTheme();
const [selected, setSelected] = useState(sortType || '/topMonth');
const labels = [t('header_hot'), t('header_new'), t('header_rising'), t('header_controversial'), t('header_top')];
const labels = [t('header_hot'), t('header_new'), t('header_active'), t('header_controversial'), t('header_top')];
useEffect(() => {
if (sortType) {