mirror of
https://github.com/plebbit/seedit.git
synced 2026-02-15 08:21:19 -05:00
@@ -45,5 +45,7 @@
|
||||
"reply_best": "أفضل",
|
||||
"reply_sorted_by": "مرتبة حسب",
|
||||
"all_comments": "جميع {{count}} التعليقات",
|
||||
"no_comments": "لا تعليقات (بعد)"
|
||||
"no_comments": "لا تعليقات (بعد)",
|
||||
"reply_score_singular": "1 نقطة",
|
||||
"reply_score_plural": "{{count}} نقاط"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "সেরা",
|
||||
"reply_sorted_by": "অনুসারে বাছাই",
|
||||
"all_comments": "সব {{count}} মন্তব্য",
|
||||
"no_comments": "কোনো মন্তব্য নেই (এখনো)"
|
||||
"no_comments": "কোনো মন্তব্য নেই (এখনো)",
|
||||
"reply_score_singular": "1 পয়েন্ট",
|
||||
"reply_score_plural": "{{count}} পয়েন্ট"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Nejlepší",
|
||||
"reply_sorted_by": "Řazeno podle",
|
||||
"all_comments": "Všechny {{count}} komentáře",
|
||||
"no_comments": "Žádné komentáře (zatím)"
|
||||
"no_comments": "Žádné komentáře (zatím)",
|
||||
"reply_score_singular": "1 bod",
|
||||
"reply_score_plural": "{{count}} body"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Bedste",
|
||||
"reply_sorted_by": "Sorteret efter",
|
||||
"all_comments": "Alle {{count}} kommentarer",
|
||||
"no_comments": "Ingen kommentarer (endnu)"
|
||||
"no_comments": "Ingen kommentarer (endnu)",
|
||||
"reply_score_singular": "1 point",
|
||||
"reply_score_plural": "{{count}} point"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Besten",
|
||||
"reply_sorted_by": "Sortiert nach",
|
||||
"all_comments": "Alle {{count}} kommentare",
|
||||
"no_comments": "Keine kommentare (noch)"
|
||||
"no_comments": "Keine kommentare (noch)",
|
||||
"reply_score_singular": "1 Punkt",
|
||||
"reply_score_plural": "{{count}} Punkte"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Καλύτερα",
|
||||
"reply_sorted_by": "Ταξινομημένα κατά",
|
||||
"all_comments": "Όλα τα {{count}} σχόλια",
|
||||
"no_comments": "Κανένα σχόλιο (ακόμη)"
|
||||
"no_comments": "Κανένα σχόλιο (ακόμη)",
|
||||
"reply_score_singular": "1 βαθμός",
|
||||
"reply_score_plural": "{{count}} βαθμοί"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "best",
|
||||
"reply_sorted_by": "sorted by",
|
||||
"all_comments": "all {{count}} comments",
|
||||
"no_comments": "no comments (yet)"
|
||||
"no_comments": "no comments (yet)",
|
||||
"reply_score_singular": "1 point",
|
||||
"reply_score_plural": "{{count}} points"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "mejores",
|
||||
"reply_sorted_by": "ordenado por",
|
||||
"all_comments": "todos los {{count}} comentarios",
|
||||
"no_comments": "sin comentarios (aún)"
|
||||
"no_comments": "sin comentarios (aún)",
|
||||
"reply_score_singular": "1 punto",
|
||||
"reply_score_plural": "{{count}} puntos"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "بهترین",
|
||||
"reply_sorted_by": "مرتبشده بر اساس",
|
||||
"all_comments": "همه {{count}} نظرات",
|
||||
"no_comments": "بدون نظر (هنوز)"
|
||||
"no_comments": "بدون نظر (هنوز)",
|
||||
"reply_score_singular": "1 امتیاز",
|
||||
"reply_score_plural": "{{count}} امتیاز"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Parhaat",
|
||||
"reply_sorted_by": "Lajiteltu",
|
||||
"all_comments": "Kaikki {{count}} kommentit",
|
||||
"no_comments": "Ei kommentteja (vielä)"
|
||||
"no_comments": "Ei kommentteja (vielä)",
|
||||
"reply_score_singular": "1 piste",
|
||||
"reply_score_plural": "{{count}} pistettä"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Pinakamahusay",
|
||||
"reply_sorted_by": "Naayos ayon sa",
|
||||
"all_comments": "Lahat ng {{count}} mga komento",
|
||||
"no_comments": "Walang komento (pa)"
|
||||
"no_comments": "Walang komento (pa)",
|
||||
"reply_score_singular": "1 punto",
|
||||
"reply_score_plural": "{{count}} punto"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "meilleurs",
|
||||
"reply_sorted_by": "trié par",
|
||||
"all_comments": "tous les {{count}} commentaires",
|
||||
"no_comments": "aucun commentaire (encore)"
|
||||
"no_comments": "aucun commentaire (encore)",
|
||||
"reply_score_singular": "1 point",
|
||||
"reply_score_plural": "{{count}} points"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "הכי טובים",
|
||||
"reply_sorted_by": "ממוין לפי",
|
||||
"all_comments": "כל {{count}} התגובות",
|
||||
"no_comments": "אין תגובות (עדיין)"
|
||||
"no_comments": "אין תגובות (עדיין)",
|
||||
"reply_score_singular": "1 נקודה",
|
||||
"reply_score_plural": "{{count}} נקודות"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "सर्वश्रेष्ठ",
|
||||
"reply_sorted_by": "इसके अनुसार क्रमबद्ध",
|
||||
"all_comments": "सभी {{count}} टिप्पणियां",
|
||||
"no_comments": "कोई टिप्पणी नहीं (अब तक)"
|
||||
"no_comments": "कोई टिप्पणी नहीं (अब तक)",
|
||||
"reply_score_singular": "1 अंक",
|
||||
"reply_score_plural": "{{count}} अंक"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Legjobb",
|
||||
"reply_sorted_by": "Sorrend",
|
||||
"all_comments": "Mind a {{count}} hozzászólások",
|
||||
"no_comments": "Nincsenek hozzászólások (még)"
|
||||
"no_comments": "Nincsenek hozzászólások (még)",
|
||||
"reply_score_singular": "1 pont",
|
||||
"reply_score_plural": "{{count}} pont"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Terbaik",
|
||||
"reply_sorted_by": "Diurutkan berdasarkan",
|
||||
"all_comments": "Semua {{count}} komentar",
|
||||
"no_comments": "Tidak ada komentar (belum)"
|
||||
"no_comments": "Tidak ada komentar (belum)",
|
||||
"reply_score_singular": "1 poin",
|
||||
"reply_score_plural": "{{count}} poin"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "migliori",
|
||||
"reply_sorted_by": "ordinato per",
|
||||
"all_comments": "tutti i {{count}} commenti",
|
||||
"no_comments": "nessun commento (ancora)"
|
||||
"no_comments": "nessun commento (ancora)",
|
||||
"reply_score_singular": "1 punto",
|
||||
"reply_score_plural": "{{count}} punti"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "最良",
|
||||
"reply_sorted_by": "ソート条件",
|
||||
"all_comments": "すべての{{count}}コメント",
|
||||
"no_comments": "コメントはありません(まだ)"
|
||||
"no_comments": "コメントはありません(まだ)",
|
||||
"reply_score_singular": "1 ポイント",
|
||||
"reply_score_plural": "{{count}} ポイント"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "최고의",
|
||||
"reply_sorted_by": "정렬 기준",
|
||||
"all_comments": "모든 {{count}} 댓글",
|
||||
"no_comments": "댓글 없음 (아직)"
|
||||
"no_comments": "댓글 없음 (아직)",
|
||||
"reply_score_singular": "1 점",
|
||||
"reply_score_plural": "{{count}} 점"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "सर्वोत्कृष्ट",
|
||||
"reply_sorted_by": "याप्रमाणे क्रमवारीत",
|
||||
"all_comments": "सर्व {{count}} टिप्पण्या",
|
||||
"no_comments": "कोणत्याही टिप्पण्या नाहीत (अजून)"
|
||||
"no_comments": "कोणत्याही टिप्पण्या नाहीत (अजून)",
|
||||
"reply_score_singular": "1 गुण",
|
||||
"reply_score_plural": "{{count}} गुण"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Beste",
|
||||
"reply_sorted_by": "Gesorteerd op",
|
||||
"all_comments": "Alle {{count}} reacties",
|
||||
"no_comments": "Geen reacties (nog)"
|
||||
"no_comments": "Geen reacties (nog)",
|
||||
"reply_score_singular": "1 punt",
|
||||
"reply_score_plural": "{{count}} punten"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Beste",
|
||||
"reply_sorted_by": "Sortert etter",
|
||||
"all_comments": "Alle {{count}} kommentarer",
|
||||
"no_comments": "Ingen kommentarer (ennå)"
|
||||
"no_comments": "Ingen kommentarer (ennå)",
|
||||
"reply_score_singular": "1 poeng",
|
||||
"reply_score_plural": "{{count}} poeng"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Najlepsze",
|
||||
"reply_sorted_by": "Sortowane według",
|
||||
"all_comments": "Wszystkie {{count}} komentarze",
|
||||
"no_comments": "Brak komentarzy (jeszcze)"
|
||||
"no_comments": "Brak komentarzy (jeszcze)",
|
||||
"reply_score_singular": "1 punkt",
|
||||
"reply_score_plural": "{{count}} punkty"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "melhores",
|
||||
"reply_sorted_by": "ordenado por",
|
||||
"all_comments": "todos os {{count}} comentários",
|
||||
"no_comments": "sem comentários (ainda)"
|
||||
"no_comments": "sem comentários (ainda)",
|
||||
"reply_score_singular": "1 ponto",
|
||||
"reply_score_plural": "{{count}} pontos"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Cele mai bune",
|
||||
"reply_sorted_by": "Sortat după",
|
||||
"all_comments": "Toate {{count}} comentariile",
|
||||
"no_comments": "Fără comentarii (încă)"
|
||||
"no_comments": "Fără comentarii (încă)",
|
||||
"reply_score_singular": "1 punct",
|
||||
"reply_score_plural": "{{count}} puncte"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Лучшие",
|
||||
"reply_sorted_by": "Сортировать по",
|
||||
"all_comments": "Все {{count}} комментарии",
|
||||
"no_comments": "Нет комментариев (пока)"
|
||||
"no_comments": "Нет комментариев (пока)",
|
||||
"reply_score_singular": "1 очко",
|
||||
"reply_score_plural": "{{count}} очков"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Më të mirët",
|
||||
"reply_sorted_by": "Renditur sipas",
|
||||
"all_comments": "Të gjitha {{count}} komentet",
|
||||
"no_comments": "Asnjë koment (ende)"
|
||||
"no_comments": "Asnjë koment (ende)",
|
||||
"reply_score_singular": "1 pikë",
|
||||
"reply_score_plural": "{{count}} pikë"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Bästa",
|
||||
"reply_sorted_by": "Sorterat efter",
|
||||
"all_comments": "Alla {{count}} kommentarer",
|
||||
"no_comments": "Inga kommentarer (ännu)"
|
||||
"no_comments": "Inga kommentarer (ännu)",
|
||||
"reply_score_singular": "1 poäng",
|
||||
"reply_score_plural": "{{count}} poäng"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "ఉత్తమ",
|
||||
"reply_sorted_by": "దీని ప్రకారం క్రమపడబడింది",
|
||||
"all_comments": "అన్ని {{count}} వ్యాఖ్యలు",
|
||||
"no_comments": "వ్యాఖ్యలు లేవు (ఇంకా)"
|
||||
"no_comments": "వ్యాఖ్యలు లేవు (ఇంకా)",
|
||||
"reply_score_singular": "1 పాయింట్",
|
||||
"reply_score_plural": "{{count}} పాయింట్లు"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "ที่สุด",
|
||||
"reply_sorted_by": "เรียงลำดับตาม",
|
||||
"all_comments": "ความคิดเห็น {{count}} รายการทั้งหมด",
|
||||
"no_comments": "ไม่มีความคิดเห็น (ยัง)"
|
||||
"no_comments": "ไม่มีความคิดเห็น (ยัง)",
|
||||
"reply_score_singular": "1 แต้ม",
|
||||
"reply_score_plural": "{{count}} แต้ม"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "En iyiler",
|
||||
"reply_sorted_by": "Şuna göre sırala",
|
||||
"all_comments": "Tüm {{count}} yorumlar",
|
||||
"no_comments": "Yorum yok (henüz)"
|
||||
"no_comments": "Yorum yok (henüz)",
|
||||
"reply_score_singular": "1 puan",
|
||||
"reply_score_plural": "{{count}} puan"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Найкращі",
|
||||
"reply_sorted_by": "Сортувати за",
|
||||
"all_comments": "Всі {{count}} коментарі",
|
||||
"no_comments": "Немає коментарів (ще)"
|
||||
"no_comments": "Немає коментарів (ще)",
|
||||
"reply_score_singular": "1 бал",
|
||||
"reply_score_plural": "{{count}} бали"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "بہترین",
|
||||
"reply_sorted_by": "کے مطابق ترتیب",
|
||||
"all_comments": "تمام {{count}} تبصرے",
|
||||
"no_comments": "کوئی تبصرہ نہیں (ابھی)"
|
||||
"no_comments": "کوئی تبصرہ نہیں (ابھی)",
|
||||
"reply_score_singular": "1 پوائنٹ",
|
||||
"reply_score_plural": "{{count}} پوائنٹس"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "Tốt nhất",
|
||||
"reply_sorted_by": "Sắp xếp theo",
|
||||
"all_comments": "Tất cả {{count}} bình luận",
|
||||
"no_comments": "Không có bình luận (chưa)"
|
||||
"no_comments": "Không có bình luận (chưa)",
|
||||
"reply_score_singular": "1 điểm",
|
||||
"reply_score_plural": "{{count}} điểm"
|
||||
}
|
||||
@@ -45,5 +45,7 @@
|
||||
"reply_best": "最好的",
|
||||
"reply_sorted_by": "排序方式",
|
||||
"all_comments": "全部 {{count}} 个评论",
|
||||
"no_comments": "暂无评论(还)"
|
||||
"no_comments": "暂无评论(还)",
|
||||
"reply_score_singular": "1 分",
|
||||
"reply_score_plural": "{{count}} 分"
|
||||
}
|
||||
17
src/app.tsx
17
src/app.tsx
@@ -1,9 +1,11 @@
|
||||
import { useEffect } from 'react';
|
||||
import { Route, Routes } from 'react-router-dom';
|
||||
import { Outlet, Route, Routes } from 'react-router-dom';
|
||||
import useTheme from './hooks/use-theme';
|
||||
import styles from './app.module.css';
|
||||
import Home from './components/views/home';
|
||||
import Comments from './components/views/comments';
|
||||
import TopBar from './components/topbar/topbar';
|
||||
import Header from './components/header/header';
|
||||
|
||||
function App() {
|
||||
const [theme] = useTheme();
|
||||
@@ -13,10 +15,19 @@ function App() {
|
||||
document.body.classList.add(theme);
|
||||
}, [theme]);
|
||||
|
||||
const homeLayout = (
|
||||
<>
|
||||
<TopBar />
|
||||
<Header />
|
||||
<Outlet />
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={[styles.app, theme].join(' ')}>
|
||||
<div className={`${styles.app} ${theme}`}>
|
||||
<Routes>
|
||||
<Route path='/:sortType?' element={<Home />}>
|
||||
<Route element={homeLayout}>
|
||||
<Route path='/:sortType?' element={<Home />} />
|
||||
<Route path='p/:subplebbitAddress/c/:commentCid' element={<Comments />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
.wrapper {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.pageName {
|
||||
font-weight: bold;
|
||||
margin-right: 1ex;
|
||||
font-variant: small-caps;
|
||||
font-size: 1.2em;
|
||||
padding: 43px 0 0 15px;
|
||||
}
|
||||
|
||||
.pageName a {
|
||||
@@ -15,13 +18,11 @@
|
||||
list-style: none;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
margin-bottom: -43px;
|
||||
padding-left: 5px;
|
||||
transform: translateY(0.5px);
|
||||
}
|
||||
|
||||
_::-webkit-full-page-media, _:future, :root .tabMenu {
|
||||
margin-bottom: -44px;
|
||||
transform: translateY(0.5px);
|
||||
}
|
||||
|
||||
.tabMenu li {
|
||||
@@ -39,19 +40,33 @@ _::-webkit-full-page-media, _:future, :root .tabMenu {
|
||||
border-bottom: 1px solid var(--background);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.tabMenu {
|
||||
padding-top: 49px;
|
||||
position: absolute;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.wrapper {
|
||||
margin-top: 44px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.tabMenu li a {
|
||||
line-height: 0px;
|
||||
.tabMenu {
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.pageName {
|
||||
padding-top: 47px;
|
||||
position: absolute;
|
||||
margin-left: 80px;
|
||||
order: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.wrapper {
|
||||
margin-top: 47px;
|
||||
}
|
||||
|
||||
.tabMenu {
|
||||
order: 1;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.pageName {
|
||||
order: 2;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ const CommentsButtons: FC = () => {
|
||||
const { title, shortAddress } = subplebbit || {};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles.wrapper}>
|
||||
<span className={styles.pageName}>
|
||||
<Link
|
||||
to={`/p/${subplebbitAddress}`}
|
||||
@@ -27,7 +27,7 @@ const CommentsButtons: FC = () => {
|
||||
<Link to={`/p/${subplebbitAddress}/c/${commentCid}`}>{t('header_comments')}</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ import { useTranslation } from 'react-i18next';
|
||||
import styles from './header.module.css';
|
||||
import useTheme from '../../hooks/use-theme';
|
||||
import AccountBar from './account-bar';
|
||||
import { SortButtons, CommentsButtons } from '../header';
|
||||
import CommentsButtons from '../header/comments-buttons';
|
||||
import SortButtons from '../header/sort-buttons';
|
||||
|
||||
// prettier-ignore
|
||||
const availableLanguages = ['ar', 'bn', 'cs', 'da', 'de', 'el', 'en', 'es', 'fa', 'fi', 'fil', 'fr', 'he', 'hi', 'hu', 'id', 'it', 'ja', 'ko', 'mr', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sq', 'sv', 'te', 'th', 'tr', 'uk', 'ur', 'vi', 'zh'];
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
export {default} from './header';
|
||||
export {default as AccountBar} from './account-bar';
|
||||
export {default as SortButtons} from './sort-buttons';
|
||||
export {default as CommentsButtons} from './comments-buttons';
|
||||
export {default} from './header';
|
||||
@@ -1,7 +1 @@
|
||||
export {default} from './post'
|
||||
export {default as Embed} from './embed'
|
||||
export {default as Expando} from './expando'
|
||||
export {default as ExpandButton} from './expand-button'
|
||||
export {default as Flair} from './flair'
|
||||
export {default as PostTools} from './post-tools'
|
||||
export {default as Thumbnail} from './thumbnail'
|
||||
export {default} from './post';
|
||||
@@ -77,6 +77,7 @@
|
||||
.usertext {
|
||||
font-size: small;
|
||||
unicode-bidi: isolate;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.md {
|
||||
@@ -90,6 +91,11 @@
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.usertext a {
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
list-style-type: none;
|
||||
margin-left: 29px;
|
||||
|
||||
@@ -5,7 +5,9 @@ import { useTranslation } from 'react-i18next';
|
||||
import styles from './reply.module.css';
|
||||
import useReplies from '../../hooks/use-replies';
|
||||
import utils from '../../lib/utils';
|
||||
import { Thumbnail, Expando, ExpandButton } from '../post';
|
||||
import Expando from '../post/expando/';
|
||||
import ExpandButton from '../post/expand-button/';
|
||||
import Thumbnail from '../post/thumbnail/';
|
||||
|
||||
interface ReplyProps {
|
||||
key: number;
|
||||
@@ -18,8 +20,10 @@ const Reply: FC<ReplyProps> = ({ reply }) => {
|
||||
cid,
|
||||
content,
|
||||
depth,
|
||||
downvoteCount,
|
||||
link,
|
||||
timestamp,
|
||||
upvoteCount,
|
||||
} = reply || {};
|
||||
const replies = useReplies(reply);
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
@@ -27,6 +31,11 @@ const Reply: FC<ReplyProps> = ({ reply }) => {
|
||||
const commentMediaInfo = utils.getCommentMediaInfoMemoized(reply);
|
||||
const hasThumbnail = utils.hasThumbnail(commentMediaInfo, link);
|
||||
const { t } = useTranslation();
|
||||
let score = upvoteCount - downvoteCount;
|
||||
if ((upvoteCount === 0 && downvoteCount === 0) || (upvoteCount === 1 && downvoteCount === 0)) {
|
||||
score = 1;
|
||||
}
|
||||
const scoreTranslation = score === 1 ? t('reply_score_singular') : t('reply_score_plural', { count: score });
|
||||
|
||||
return (
|
||||
<div className={styles.reply}>
|
||||
@@ -47,15 +56,24 @@ const Reply: FC<ReplyProps> = ({ reply }) => {
|
||||
>
|
||||
{shortAddress}
|
||||
</Link>
|
||||
<span className={styles.score}>1 point</span>
|
||||
<span className={styles.score}>{scoreTranslation}</span>
|
||||
|
||||
<span className={styles.time}>{utils.getFormattedTime(timestamp)}</span>
|
||||
</p>
|
||||
<div className={styles.usertext}>
|
||||
{hasThumbnail && <Thumbnail commentCid={cid} />}
|
||||
{hasThumbnail && <ExpandButton commentCid={cid} expanded={expanded} hasThumbnail={hasThumbnail} toggleExpanded={toggleExpanded} />}
|
||||
<div className={styles.md}>{content}</div>
|
||||
{link && (
|
||||
<>
|
||||
<a href={link} target='_blank' rel='noopener noreferrer'>
|
||||
({link})
|
||||
</a>
|
||||
<br />
|
||||
<br />
|
||||
</>
|
||||
)}
|
||||
{hasThumbnail && <Expando commentCid={cid} expanded={expanded} showContent={false} />}
|
||||
<div className={styles.md}>{content}</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul className={styles.buttons}>
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
.content {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x: hidden;
|
||||
z-index: 999;
|
||||
background-color: var(--background);
|
||||
}
|
||||
|
||||
.comments {
|
||||
padding: 7px 5px 0px 5px;
|
||||
margin-bottom: 200px;
|
||||
|
||||
@@ -3,8 +3,6 @@ import { useParams } from 'react-router-dom';
|
||||
import { useComment, useSubplebbit } from '@plebbit/plebbit-react-hooks';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import styles from './comments.module.css';
|
||||
import TopBar from '../../topbar';
|
||||
import Header from '../../header';
|
||||
import Post from '../../post';
|
||||
import useReplies from '../../../hooks/use-replies';
|
||||
import Reply from '../../reply/reply';
|
||||
@@ -25,43 +23,38 @@ const Comments: FC = () => {
|
||||
} else {
|
||||
document.title = 'seedit';
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
}, [threadTitle, subplebbitTitle]);
|
||||
|
||||
useEffect(() => {
|
||||
window.scrollTo(0, 0);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={styles.content}>
|
||||
<TopBar />
|
||||
<Header />
|
||||
<div className={styles.comments}>
|
||||
<Post post={comment} shouldExpand={false} />
|
||||
<div className={styles.commentArea}>
|
||||
<div className={styles.commentsTitle}>
|
||||
<span className={styles.title}>
|
||||
{replyCount === 0 ? t('no_comments') : t('all_comments', { count: replyCount })}
|
||||
</span>
|
||||
<div className={styles.comments}>
|
||||
<Post post={comment} shouldExpand={false} />
|
||||
<div className={styles.commentArea}>
|
||||
<div className={styles.commentsTitle}>
|
||||
<span className={styles.title}>{replyCount === 0 ? t('no_comments') : t('all_comments', { count: replyCount })}</span>
|
||||
</div>
|
||||
<div className={styles.menuArea}>
|
||||
<div className={styles.spacer}>
|
||||
<span className={styles.dropdownTitle}>{t('reply_sorted_by')}: </span>
|
||||
<div className={styles.dropdown}>
|
||||
<span className={styles.selected}>{t('reply_best')}</span>
|
||||
</div>
|
||||
<div className={styles.menuArea}>
|
||||
<div className={styles.spacer}>
|
||||
<span className={styles.dropdownTitle}>{t('reply_sorted_by')}: </span>
|
||||
<div className={styles.dropdown}>
|
||||
<span className={styles.selected}>{t('reply_best')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.mdContainer}>
|
||||
<div className={styles.md}>
|
||||
<textarea className={styles.textarea} />
|
||||
</div>
|
||||
<div className={styles.bottomArea}>
|
||||
<button className={styles.save}>{t('post_save')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.mdContainer}>
|
||||
<div className={styles.md}>
|
||||
<textarea className={styles.textarea} />
|
||||
</div>
|
||||
<div className={styles.bottomArea}>
|
||||
<button className={styles.save}>{t('post_save')}</button>
|
||||
</div>
|
||||
<div className={styles.replies}>{replies}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.replies}>{replies}</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { FC, useEffect, useRef } from 'react';
|
||||
import { useLocation, useParams } from 'react-router-dom';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { Virtuoso, VirtuosoHandle, StateSnapshot } from 'react-virtuoso';
|
||||
import { useFeed } from '@plebbit/plebbit-react-hooks';
|
||||
import useDefaultSubplebbits from '../../../hooks/use-default-subplebbits';
|
||||
import styles from './home.module.css';
|
||||
import TopBar from '../../topbar/topbar';
|
||||
import Header from '../../header';
|
||||
import Post from '../../post';
|
||||
import Comments from '../comments/comments';
|
||||
|
||||
const lastVirtuosoStates: { [key: string]: StateSnapshot } = {};
|
||||
|
||||
@@ -16,11 +13,8 @@ const NoPosts = () => 'no posts';
|
||||
const Home: FC = () => {
|
||||
const subplebbitAddresses = useDefaultSubplebbits();
|
||||
const sortType = useParams<{ sortType: string }>().sortType || 'hot';
|
||||
const { subplebbitAddress, commentCid } = useParams();
|
||||
const { feed, hasMore, loadMore } = useFeed({ subplebbitAddresses, sortType });
|
||||
const loadingStateString = 'loading...';
|
||||
const { pathname } = useLocation();
|
||||
const isCommentsModalOpen = pathname === `/p/${subplebbitAddress}/c/${commentCid}`;
|
||||
|
||||
useEffect(() => {
|
||||
document.title = `seedit`;
|
||||
@@ -52,27 +46,19 @@ const Home: FC = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<TopBar />
|
||||
<Header />
|
||||
<div className={styles.content}>
|
||||
{!isCommentsModalOpen && (
|
||||
<Virtuoso
|
||||
increaseViewportBy={{ bottom: 1200, top: 1200 }}
|
||||
overscan={600}
|
||||
totalCount={feed?.length || 0}
|
||||
data={feed}
|
||||
itemContent={(index, post) => <Post index={index} post={post} />}
|
||||
useWindowScroll={!isCommentsModalOpen}
|
||||
components={{ Footer }}
|
||||
endReached={loadMore}
|
||||
ref={virtuosoRef}
|
||||
restoreStateFrom={lastVirtuosoState}
|
||||
initialScrollTop={lastVirtuosoState?.scrollTop}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div style={{ display: isCommentsModalOpen ? 'block' : 'none' }}>
|
||||
<Comments />
|
||||
<Virtuoso
|
||||
increaseViewportBy={{ bottom: 1200, top: 600 }}
|
||||
totalCount={feed?.length || 0}
|
||||
data={feed}
|
||||
itemContent={(index, post) => <Post index={index} post={post} />}
|
||||
useWindowScroll={true}
|
||||
components={{ Footer }}
|
||||
endReached={loadMore}
|
||||
ref={virtuosoRef}
|
||||
restoreStateFrom={lastVirtuosoState}
|
||||
initialScrollTop={lastVirtuosoState?.scrollTop}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user