From 6eb521f5016fc9ca3c9cce485a2068a9ed58478c Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Sun, 30 Jun 2024 11:47:09 +0200 Subject: [PATCH 01/13] style: update mobile UI spacing, colors --- src/components/board-buttons/board-buttons.module.css | 7 +++++-- src/components/board-buttons/board-buttons.tsx | 2 +- src/components/board-header/board-header.module.css | 4 ++-- src/components/board-header/board-header.tsx | 9 ++++++--- src/components/topbar/topbar.module.css | 4 +++- .../catalog/catalog-filters/catalog-filters.module.css | 4 ++++ src/views/catalog/catalog-filters/catalog-filters.tsx | 2 +- 7 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/components/board-buttons/board-buttons.module.css b/src/components/board-buttons/board-buttons.module.css index 423986ec..a1c3a79a 100644 --- a/src/components/board-buttons/board-buttons.module.css +++ b/src/components/board-buttons/board-buttons.module.css @@ -1,11 +1,14 @@ .mobileBoardButtons { text-align: center; - margin-bottom: 10px; +} + +.addMargin { + margin-bottom: 7px; } .mobileBoardButtons button { - margin: 0 2px; text-transform: capitalize; + margin: 5px 2px; } .mobileBoardButtons a, .desktopBoardButtons a { diff --git a/src/components/board-buttons/board-buttons.tsx b/src/components/board-buttons/board-buttons.tsx index aa109f6c..979500b7 100644 --- a/src/components/board-buttons/board-buttons.tsx +++ b/src/components/board-buttons/board-buttons.tsx @@ -185,7 +185,7 @@ export const MobileBoardButtons = () => { const subplebbitAddress = params?.subplebbitAddress || accountComment?.subplebbitAddress; return ( -
+
[ { return (
-
- -
+ {!useIsMobile() && ( +
+ +
+ )}
{title || `p/${shortAddress || subplebbitAddress}`} {isBoardOffline && } diff --git a/src/components/topbar/topbar.module.css b/src/components/topbar/topbar.module.css index 2afdf59b..bfb22c83 100644 --- a/src/components/topbar/topbar.module.css +++ b/src/components/topbar/topbar.module.css @@ -44,6 +44,7 @@ background-color: var(--topbar-mobile-background-color); border-bottom: var(--topbar-mobile-border-bottom); font-size: var(--topbar-mobile-font-size); + color: var(--topbar-mobile-button-text-color); position: fixed; width: 100%; z-index: 3; @@ -72,6 +73,7 @@ .boardSelect { float: left; + color: var(--homepage-box-link-text-color); } .pageJump { @@ -81,8 +83,8 @@ .pageJump a, .pageJump span { padding-right: 5px; - color: var(--homepage-box-link-text-color); text-decoration: var(--homepage-box-link-text-decoration); + cursor: pointer; } @media (max-width: 640px) { diff --git a/src/views/catalog/catalog-filters/catalog-filters.module.css b/src/views/catalog/catalog-filters/catalog-filters.module.css index 4ef358e7..843bd8cd 100644 --- a/src/views/catalog/catalog-filters/catalog-filters.module.css +++ b/src/views/catalog/catalog-filters/catalog-filters.module.css @@ -19,6 +19,10 @@ cursor: pointer; } +.filtersButton { + text-transform: capitalize; +} + .modal label, .modal button, .modal select { cursor: pointer; } diff --git a/src/views/catalog/catalog-filters/catalog-filters.tsx b/src/views/catalog/catalog-filters/catalog-filters.tsx index 8169dce2..2d64bb46 100644 --- a/src/views/catalog/catalog-filters/catalog-filters.tsx +++ b/src/views/catalog/catalog-filters/catalog-filters.tsx @@ -57,7 +57,7 @@ const CatalogFilters = () => { return ( <> - setShowModal(true)}> + setShowModal(true)}> {t('filters')} {showModal && } From ac476ba7fdd255bfa197eb7ac14f86ca27f834e6 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Sun, 30 Jun 2024 11:54:54 +0200 Subject: [PATCH 02/13] fix spoiler image displacement --- src/components/comment-media/comment-media.module.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/comment-media/comment-media.module.css b/src/components/comment-media/comment-media.module.css index 698f79ed..aede97f2 100644 --- a/src/components/comment-media/comment-media.module.css +++ b/src/components/comment-media/comment-media.module.css @@ -22,6 +22,8 @@ } .spoiler { + width: 100px; + height: 100px; margin: 3px 20px 5px 20px; } From 7aafd7312791d81a2252c914a44fecc037c57a7c Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Sun, 30 Jun 2024 12:06:56 +0200 Subject: [PATCH 03/13] add translations --- public/translations/ar/default.json | 5 ++++- public/translations/bn/default.json | 5 ++++- public/translations/cs/default.json | 5 ++++- public/translations/da/default.json | 5 ++++- public/translations/de/default.json | 5 ++++- public/translations/el/default.json | 5 ++++- public/translations/en/default.json | 5 ++++- public/translations/es/default.json | 5 ++++- public/translations/fa/default.json | 5 ++++- public/translations/fi/default.json | 5 ++++- public/translations/fil/default.json | 5 ++++- public/translations/fr/default.json | 5 ++++- public/translations/he/default.json | 5 ++++- public/translations/hi/default.json | 5 ++++- public/translations/hu/default.json | 5 ++++- public/translations/id/default.json | 5 ++++- public/translations/it/default.json | 5 ++++- public/translations/ja/default.json | 5 ++++- public/translations/ko/default.json | 5 ++++- public/translations/mr/default.json | 5 ++++- public/translations/nl/default.json | 5 ++++- public/translations/no/default.json | 5 ++++- public/translations/pl/default.json | 5 ++++- public/translations/pt/default.json | 5 ++++- public/translations/ro/default.json | 5 ++++- public/translations/ru/default.json | 5 ++++- public/translations/sq/default.json | 5 ++++- public/translations/sv/default.json | 5 ++++- public/translations/te/default.json | 5 ++++- public/translations/th/default.json | 5 ++++- public/translations/tr/default.json | 5 ++++- public/translations/uk/default.json | 5 ++++- public/translations/ur/default.json | 5 ++++- public/translations/vi/default.json | 5 ++++- public/translations/zh/default.json | 5 ++++- src/components/catalog-row/catalog-row.module.css | 1 + src/components/catalog-row/catalog-row.tsx | 14 ++++++++++---- 37 files changed, 151 insertions(+), 39 deletions(-) diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index d94c3256..69cfc8fc 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -199,5 +199,8 @@ "reason_reason": "السبب: \"{{reason}}\".", "click_here_to_show_original": "<1>انقر هنا لعرض الأصل.", "click_here_to_hide_original": "<1>انقر هنا لإخفاء الأصل.", - "loading": "جار التحميل" + "loading": "جار التحميل", + "posted_by": "نشر بواسطة", + "by": "بواسطة", + "last_reply_by": "آخر رد بواسطة" } \ No newline at end of file diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index d2918dcf..9c113b63 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -199,5 +199,8 @@ "reason_reason": "কারণ: \"{{reason}}\".", "click_here_to_show_original": "<1>এখানে ক্লিক করুন অসল দেখানোর জন্য।", "click_here_to_hide_original": "<1>এখানে ক্লিক করুন অসল লুকাতে।", - "loading": "লোড হচ্ছে" + "loading": "লোড হচ্ছে", + "posted_by": "পোস্ট করেছেন", + "by": "দ্বারা", + "last_reply_by": "শেষ উত্তর দেননি" } \ No newline at end of file diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index 3e997023..26b5359a 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -199,5 +199,8 @@ "reason_reason": "Důvod: \"{{reason}}\".", "click_here_to_show_original": "Klikněte <1>zde pro zobrazení původního.", "click_here_to_hide_original": "Klikněte <1>zde pro skrytí původního.", - "loading": "Načítání" + "loading": "Načítání", + "posted_by": "Publikoval(a)", + "by": "od", + "last_reply_by": "Poslední odpověď od" } \ No newline at end of file diff --git a/public/translations/da/default.json b/public/translations/da/default.json index 1aa191bf..f3a42ca2 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -199,5 +199,8 @@ "reason_reason": "Grund: \"{{reason}}\".", "click_here_to_show_original": "<1>Klik her for at vise originalen.", "click_here_to_hide_original": "<1>Klik her for at skjule originalen.", - "loading": "Indlæser" + "loading": "Indlæser", + "posted_by": "Skrevet af", + "by": "af", + "last_reply_by": "Seneste svar fra" } \ No newline at end of file diff --git a/public/translations/de/default.json b/public/translations/de/default.json index 949fae44..f3c670cc 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -199,5 +199,8 @@ "reason_reason": "Grund: \"{{reason}}\".", "click_here_to_show_original": "<1>Hier klicken, um das Original anzuzeigen.", "click_here_to_hide_original": "<1>Hier klicken, um das Original zu verstecken.", - "loading": "Laden" + "loading": "Laden", + "posted_by": "Geschrieben von", + "by": "von", + "last_reply_by": "Letzte Antwort von" } \ No newline at end of file diff --git a/public/translations/el/default.json b/public/translations/el/default.json index d001b6dd..2f8b4af9 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -199,5 +199,8 @@ "reason_reason": "Λόγος: \"{{reason}}\".", "click_here_to_show_original": "<1>Κάντε κλικ εδώ για να εμφανιστεί το αρχικό.", "click_here_to_hide_original": "<1>Κάντε κλικ εδώ για να κρύψετε το αρχικό.", - "loading": "Φόρτωση" + "loading": "Φόρτωση", + "posted_by": "Δημοσιεύτηκε από", + "by": "από", + "last_reply_by": "Τελευταία απάντηση από" } \ No newline at end of file diff --git a/public/translations/en/default.json b/public/translations/en/default.json index 20037068..3c5dbb87 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -199,5 +199,8 @@ "reason_reason": "Reason: \"{{reason}}\".", "click_here_to_show_original": "<1>Click here to show the original.", "click_here_to_hide_original": "<1>Click here to hide the original.", - "loading": "Loading" + "loading": "Loading", + "posted_by": "Posted by", + "by": "by", + "last_reply_by": "Last reply by" } \ No newline at end of file diff --git a/public/translations/es/default.json b/public/translations/es/default.json index df435913..0daec4e4 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -199,5 +199,8 @@ "reason_reason": "Motivo: \"{{reason}}\".", "click_here_to_show_original": "<1>Haga clic aquí para mostrar el original.", "click_here_to_hide_original": "<1>Haga clic aquí para ocultar el original.", - "loading": "Cargando" + "loading": "Cargando", + "posted_by": "Publicado por", + "by": "por", + "last_reply_by": "Última respuesta de" } \ No newline at end of file diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index cdac29f1..16f8613c 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -199,5 +199,8 @@ "reason_reason": "دلیل: \"{{reason}}\".", "click_here_to_show_original": "<1>برای نمایش اصلی اینجا کلیک کنید.", "click_here_to_hide_original": "<1>برای پنهان کردن اصل اینجا کلیک کنید.", - "loading": "در حال بارگذاری" + "loading": "در حال بارگذاری", + "posted_by": "ارسال شده توسط", + "by": "توسط", + "last_reply_by": "آخرین پاسخ توسط" } \ No newline at end of file diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index 9454991b..46e61a01 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -199,5 +199,8 @@ "reason_reason": "Syy: \"{{reason}}\".", "click_here_to_show_original": "<1>Klikkaa tästä näyttääksesi alkuperäisen.", "click_here_to_hide_original": "<1>Klikkaa tästä piilottaaksesi alkuperäisen.", - "loading": "Lataa" + "loading": "Lataa", + "posted_by": "Lähettäjä", + "by": "kirjoittanut", + "last_reply_by": "Viimeisin vastaus" } \ No newline at end of file diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index 4ada3377..fb57bf02 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -199,5 +199,8 @@ "reason_reason": "Dahilan: \"{{reason}}\".", "click_here_to_show_original": "<1>I-click dito upang ipakita ang orihinal.", "click_here_to_hide_original": "<1>I-click dito upang itago ang orihinal.", - "loading": "Naglo-load" + "loading": "Naglo-load", + "posted_by": "Nai-post ni", + "by": "ni", + "last_reply_by": "Huling sagot ni" } \ No newline at end of file diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index 7b5320ab..b6d75704 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -199,5 +199,8 @@ "reason_reason": "Raison: \"{{reason}}\".", "click_here_to_show_original": "<1>Cliquez ici pour afficher l'original.", "click_here_to_hide_original": "<1>Cliquez ici pour masquer l'original.", - "loading": "Chargement" + "loading": "Chargement", + "posted_by": "Posté par", + "by": "par", + "last_reply_by": "Dernière réponse par" } \ No newline at end of file diff --git a/public/translations/he/default.json b/public/translations/he/default.json index 079ead71..1dc3c3d5 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -199,5 +199,8 @@ "reason_reason": "סיבה: \"{{reason}}\".", "click_here_to_show_original": "<1>לחץ כאן כדי להציג את המקור.", "click_here_to_hide_original": "<1>לחץ כאן כדי להסתיר את המקור.", - "loading": "טוען" + "loading": "טוען", + "posted_by": "פורסם על ידי", + "by": "על ידי", + "last_reply_by": "תגובה אחרונה מאת" } \ No newline at end of file diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index 8313442f..9abdf9e4 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -199,5 +199,8 @@ "reason_reason": "कारण: \"{{reason}}\".", "click_here_to_show_original": "<1>यहां क्लिक करें मूल दिखाने के लिए।", "click_here_to_hide_original": "<1>यहां क्लिक करें मूल छुपाने के लिए।", - "loading": "लोड हो रहा है" + "loading": "लोड हो रहा है", + "posted_by": "द्वारा लिखित", + "by": "द्वारा", + "last_reply_by": "अंतिम उत्तर दिया गया है" } \ No newline at end of file diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index ca793c3f..8bc66fd0 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -199,5 +199,8 @@ "reason_reason": "Ok: \"{{reason}}\".", "click_here_to_show_original": "<1>Kattints ide az eredeti megjelenítéséhez.", "click_here_to_hide_original": "<1>Kattints ide az eredeti elrejtéséhez.", - "loading": "Betöltés" + "loading": "Betöltés", + "posted_by": "Írta", + "by": "által", + "last_reply_by": "Utolsó válasz írta" } \ No newline at end of file diff --git a/public/translations/id/default.json b/public/translations/id/default.json index 1c0d3c4e..ec2ddd84 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -199,5 +199,8 @@ "reason_reason": "Alasan: \"{{reason}}\".", "click_here_to_show_original": "<1>Klik di sini untuk menampilkan aslinya.", "click_here_to_hide_original": "<1>Klik di sini untuk menyembunyikan aslinya.", - "loading": "Memuat" + "loading": "Memuat", + "posted_by": "Diposting oleh", + "by": "oleh", + "last_reply_by": "Balasan terakhir oleh" } \ No newline at end of file diff --git a/public/translations/it/default.json b/public/translations/it/default.json index 3036881d..34a0458f 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -199,5 +199,8 @@ "reason_reason": "Motivo: \"{{reason}}\".", "click_here_to_show_original": "<1>Clicca qui per mostrare l'originale.", "click_here_to_hide_original": "<1>Clicca qui per nascondere l'originale.", - "loading": "Caricamento" + "loading": "Caricamento", + "posted_by": "Pubblicato da", + "by": "da", + "last_reply_by": "Ultima risposta da" } \ No newline at end of file diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index 5320f67d..a35b4360 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -199,5 +199,8 @@ "reason_reason": "理由: \"{{reason}}\".", "click_here_to_show_original": "<1>ここをクリック して元の表示。", "click_here_to_hide_original": "<1>ここをクリック して元を非表示にする。", - "loading": "読み込み中" + "loading": "読み込み中", + "posted_by": "投稿者", + "by": "によって", + "last_reply_by": "最後の返信者" } \ No newline at end of file diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index 2e3dd7ae..4ca5b423 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -199,5 +199,8 @@ "reason_reason": "이유: \"{{reason}}\".", "click_here_to_show_original": "<1>여기를 클릭 하여 원본 표시.", "click_here_to_hide_original": "<1>여기를 클릭 하여 원본 숨기기.", - "loading": "로딩 중" + "loading": "로딩 중", + "posted_by": "작성자", + "by": "작성자:", + "last_reply_by": "마지막 답글 작성자:" } \ No newline at end of file diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index 076fa2fb..1f846c55 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -199,5 +199,8 @@ "reason_reason": "कारण: \"{{reason}}\".", "click_here_to_show_original": "<1>येथे क्लिक करा मूळ पाहण्यासाठी।", "click_here_to_hide_original": "<1>येथे क्लिक करा मूळ लपविण्यासाठी।", - "loading": "लोड होत आहे" + "loading": "लोड होत आहे", + "posted_by": "ने टप्पल केला", + "by": "व्यक्ती", + "last_reply_by": "शेवटचा प्रतिसाद व्यक्ती" } \ No newline at end of file diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index 1ee2efda..407834c4 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -199,5 +199,8 @@ "reason_reason": "Reden: \"{{reason}}\".", "click_here_to_show_original": "<1>Klik hier om de originele te tonen.", "click_here_to_hide_original": "<1>Klik hier om de originele te verbergen.", - "loading": "Laden" + "loading": "Laden", + "posted_by": "Geplaatst door", + "by": "door", + "last_reply_by": "Laatste reactie door" } \ No newline at end of file diff --git a/public/translations/no/default.json b/public/translations/no/default.json index 12e3316c..505bca3f 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -199,5 +199,8 @@ "reason_reason": "Årsak: \"{{reason}}\".", "click_here_to_show_original": "<1>Klikk her for å vise originalen.", "click_here_to_hide_original": "<1>Klikk her for å skjule originalen.", - "loading": "Laster" + "loading": "Laster", + "posted_by": "Skrevet av", + "by": "av", + "last_reply_by": "Siste svar fra" } \ No newline at end of file diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index f71b8e93..8d974897 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -199,5 +199,8 @@ "reason_reason": "Powód: \"{{reason}}\".", "click_here_to_show_original": "<1>Kliknij tutaj, aby pokazać oryginał.", "click_here_to_hide_original": "<1>Kliknij tutaj, aby ukryć oryginał.", - "loading": "Ładowanie" + "loading": "Ładowanie", + "posted_by": "Opublikowane przez", + "by": "przez", + "last_reply_by": "Ostatnia odpowiedź od" } \ No newline at end of file diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index 424ebb93..90b4bc10 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -199,5 +199,8 @@ "reason_reason": "Razão: \"{{reason}}\".", "click_here_to_show_original": "<1>Clique aqui para mostrar o original.", "click_here_to_hide_original": "<1>Clique aqui para ocultar o original.", - "loading": "Carregando" + "loading": "Carregando", + "posted_by": "Postado por", + "by": "por", + "last_reply_by": "Última resposta por" } \ No newline at end of file diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index c2c0f442..86e486ec 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -199,5 +199,8 @@ "reason_reason": "Motiv: \"{{reason}}\".", "click_here_to_show_original": "<1>Click aici pentru a arăta originalul.", "click_here_to_hide_original": "<1>Click aici pentru a ascunde originalul.", - "loading": "Încărcare" + "loading": "Încărcare", + "posted_by": "Postat de", + "by": "de către", + "last_reply_by": "Ultima răspuns de la" } \ No newline at end of file diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index e36972bb..7d2a6767 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -199,5 +199,8 @@ "reason_reason": "Причина: \"{{reason}}\".", "click_here_to_show_original": "<1>Нажмите здесь для отображения оригинала.", "click_here_to_hide_original": "<1>Нажмите здесь чтобы скрыть оригинал.", - "loading": "Загрузка" + "loading": "Загрузка", + "posted_by": "Опубликовано", + "by": "от", + "last_reply_by": "Последний ответ от" } \ No newline at end of file diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index 66830a3d..ee24594b 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -199,5 +199,8 @@ "reason_reason": "Arsye: \"{{reason}}\".", "click_here_to_show_original": "<1>Kliko këtu për të treguar origjinalin.", "click_here_to_hide_original": "<1>Kliko këtu për të fshehur origjinalin.", - "loading": "Ngarkimi" + "loading": "Ngarkimi", + "posted_by": "Postuar nga", + "by": "nga", + "last_reply_by": "Përgjigje e fundit nga" } \ No newline at end of file diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index e375d452..6fbed85d 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -199,5 +199,8 @@ "reason_reason": "Anledning: \"{{reason}}\".", "click_here_to_show_original": "<1>Klicka här för att visa original.", "click_here_to_hide_original": "<1>Klicka här för att dölja original.", - "loading": "Laddar" + "loading": "Laddar", + "posted_by": "Postat av", + "by": "av", + "last_reply_by": "Senaste svar av" } \ No newline at end of file diff --git a/public/translations/te/default.json b/public/translations/te/default.json index 03981811..01345f6e 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -199,5 +199,8 @@ "reason_reason": "కారణం: \"{{reason}}\".", "click_here_to_show_original": "<1>ఇక్కడ క్లిక్ చేయండి అసలు చూపించడానికి.", "click_here_to_hide_original": "<1>ఇక్కడ క్లిక్ చేయండి అసలు దాచడానికి.", - "loading": "లోడ్ అవుతోంది" + "loading": "లోడ్ అవుతోంది", + "posted_by": "పోస్ట్ చేసినవాడు", + "by": "ద్వారా", + "last_reply_by": "చివరి సమాధానం ఇచ్చింది" } \ No newline at end of file diff --git a/public/translations/th/default.json b/public/translations/th/default.json index a1427646..121da9fa 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -199,5 +199,8 @@ "reason_reason": "เหตุผล: \"{{reason}}\".", "click_here_to_show_original": "<1>คลิกที่นี่ เพื่อแสดงข้อมูลต้นฉบับ", "click_here_to_hide_original": "<1>คลิกที่นี่ เพื่อซ่อนข้อมูลต้นฉบับ", - "loading": "กำลังโหลด" + "loading": "กำลังโหลด", + "posted_by": "โพสต์โดย", + "by": "โดย", + "last_reply_by": "การตอบคำถามล่าสุดโดย" } \ No newline at end of file diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index b65333c4..efef0ed8 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -199,5 +199,8 @@ "reason_reason": "Sebep: \"{{reason}}\".", "click_here_to_show_original": "<1>Buraya tıklayın orijinali göstermek için.", "click_here_to_hide_original": "<1>Buraya tıklayın orijinali gizlemek için.", - "loading": "Yükleniyor" + "loading": "Yükleniyor", + "posted_by": "Tarafından gönderildi", + "by": "tarafından", + "last_reply_by": "Son cevap" } \ No newline at end of file diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index 65358007..25734130 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -199,5 +199,8 @@ "reason_reason": "Причина: \"{{reason}}\".", "click_here_to_show_original": "<1>Натисніть тут для відображення оригіналу.", "click_here_to_hide_original": "<1>Натисніть тут для приховання оригіналу.", - "loading": "Завантаження" + "loading": "Завантаження", + "posted_by": "Опубліковано", + "by": "від", + "last_reply_by": "Остання відповідь від" } \ No newline at end of file diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index 0934c423..f2b54313 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -199,5 +199,8 @@ "reason_reason": "وجہ: \"{{reason}}\".", "click_here_to_show_original": "<1>یہاں کلک کریں تاکہ اصل دکھائی دے۔", "click_here_to_hide_original": "<1>یہاں کلک کریں تاکہ اصل چھپ جائے۔", - "loading": "لوڈ ہو رہا ہے" + "loading": "لوڈ ہو رہا ہے", + "posted_by": "پوسٹ کیا گیا", + "by": "کے ذریعے", + "last_reply_by": "آخری جواب دیا گیا" } \ No newline at end of file diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index 626ef549..c28f7ab8 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -199,5 +199,8 @@ "reason_reason": "Lý do: \"{{reason}}\".", "click_here_to_show_original": "<1>Nhấp vào đây để hiển thị nguyên bản.", "click_here_to_hide_original": "<1>Nhấp vào đây để ẩn nguyên bản.", - "loading": "Đang tải" + "loading": "Đang tải", + "posted_by": "Được đăng bởi", + "by": "bởi", + "last_reply_by": "Trả lời cuối cùng bởi" } \ No newline at end of file diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index 758dcaa3..f5834ffb 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -199,5 +199,8 @@ "reason_reason": "原因: \"{{reason}}\".", "click_here_to_show_original": "<1>点击这里 显示原文。", "click_here_to_hide_original": "<1>点击这里 隐藏原文。", - "loading": "加载中" + "loading": "加载中", + "posted_by": "由...发布", + "by": "由...发布", + "last_reply_by": "最后回复者" } \ No newline at end of file diff --git a/src/components/catalog-row/catalog-row.module.css b/src/components/catalog-row/catalog-row.module.css index 3b6da2a8..5f0e7333 100644 --- a/src/components/catalog-row/catalog-row.module.css +++ b/src/components/catalog-row/catalog-row.module.css @@ -77,6 +77,7 @@ } .meta { + cursor: help; font-size: 11px; line-height: 8px; padding: 2px 0 1px 0; diff --git a/src/components/catalog-row/catalog-row.tsx b/src/components/catalog-row/catalog-row.tsx index ba3e532f..ccbc0878 100644 --- a/src/components/catalog-row/catalog-row.tsx +++ b/src/components/catalog-row/catalog-row.tsx @@ -233,7 +233,7 @@ const CatalogPost = ({ post }: { post: Comment }) => { ) : ( threadIcons )} -
+
R: {replyCount || '0'} {linkCount > 0 && ( @@ -252,8 +252,14 @@ const CatalogPost = ({ post }: { post: Comment }) => { showPortal && createPortal(
- {title} - {' by '} + {title ? ( + <> + {title} + {t('by')} + + ) : ( + t('posted_by') + )}{' '} {author?.displayName || _.capitalize(t('anonymous'))} {isCatalogPostAuthorMod && {` ## Board ${catalogPostAuthorRole}`}} @@ -261,7 +267,7 @@ const CatalogPost = ({ post }: { post: Comment }) => { {getFormattedTimeAgo(timestamp)} {replyCount > 0 && (
- Last reply by{' '} + {t('last_reply_by')}{' '} {lastReply?.author?.displayName || _.capitalize(t('anonymous'))} {isLastReplyAuthorMod && ` ## Board ${lastReplyAuthorRole}`} From ed393d0c72b9796895b1407b755e8a228c60c60f Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Sun, 30 Jun 2024 15:38:34 +0200 Subject: [PATCH 04/13] Update edit-menu.tsx --- src/components/edit-menu/edit-menu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/edit-menu/edit-menu.tsx b/src/components/edit-menu/edit-menu.tsx index 4e6aa990..97228d1a 100644 --- a/src/components/edit-menu/edit-menu.tsx +++ b/src/components/edit-menu/edit-menu.tsx @@ -118,7 +118,7 @@ const EditMenu = ({ isAccountMod, isAccountCommentAuthor, isCommentAuthorMod, po return ( <> - cid && setIsEditMenuOpen(!isEditMenuOpen)} checked={isEditMenuOpen} /> + setIsEditMenuOpen(cid && (isAccountCommentAuthor || isAccountMod) ? !isEditMenuOpen : false)} checked={isEditMenuOpen} /> {isEditMenuOpen && (isAccountCommentAuthor || isAccountMod) && ( From 06e18289a4d8b46f9b6e41d98d87aa16b02ceb68 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Sun, 30 Jun 2024 21:50:50 +0200 Subject: [PATCH 05/13] feat(styles): remember style selection per sfw or nsfw category, instead of single board --- .../board-buttons/board-buttons.tsx | 46 ++++++++----------- src/hooks/use-initial-theme.ts | 15 +++--- src/hooks/use-theme.ts | 29 ++++++++---- src/stores/use-theme-store.ts | 37 ++++++++++----- 4 files changed, 73 insertions(+), 54 deletions(-) diff --git a/src/components/board-buttons/board-buttons.tsx b/src/components/board-buttons/board-buttons.tsx index 979500b7..0106a50e 100644 --- a/src/components/board-buttons/board-buttons.tsx +++ b/src/components/board-buttons/board-buttons.tsx @@ -172,6 +172,24 @@ export const TimeFilter = ({ isInAllView, isInCatalogView, isInSubscriptionsView ); }; +const AdButton = () => { + return ( +
+ [ + { + e.preventDefault(); + alert('work in progress'); + }} + > + Plebbit Leaderboard + + ] +
+ ); +}; + export const MobileBoardButtons = () => { const params = useParams(); const location = useLocation(); @@ -186,19 +204,7 @@ export const MobileBoardButtons = () => { return (
-
- [ - { - e.preventDefault(); - alert('work in progress'); - }} - > - Vote for Boards - - ] -
+
{isInPostView || isInPendingPostPage ? ( <> @@ -248,19 +254,7 @@ export const DesktopBoardButtons = () => { return ( <>
-
- [ - { - e.preventDefault(); - alert('work in progress'); - }} - > - Vote for Boards - - ] -
+
{isInPostView || isInPendingPostPage ? ( diff --git a/src/hooks/use-initial-theme.ts b/src/hooks/use-initial-theme.ts index d445f83c..5ec6209c 100644 --- a/src/hooks/use-initial-theme.ts +++ b/src/hooks/use-initial-theme.ts @@ -15,21 +15,18 @@ const useInitialTheme = () => { const isInAllView = isAllView(location.pathname, params); const isInSubscriptionsView = isSubscriptionsView(location.pathname, params); - if (isInAllView || isInSubscriptionsView) { - const userTheme = getTheme(isInAllView ? 'all' : 'subscriptions'); - return userTheme || 'yotsuba-b'; + if (isInAllView) { + return getTheme('all') || 'yotsuba-b'; + } else if (isInSubscriptionsView) { + return getTheme('subscriptions') || 'yotsuba-b'; } else if (isInHomeView || isInNotFoundView) { return 'yotsuba'; } else if (subplebbitAddress) { - const userTheme = getTheme(subplebbitAddress); - if (userTheme) { - return userTheme; - } const subplebbit = subplebbits.find((s) => s.address === subplebbitAddress); if (subplebbit && subplebbit.tags && subplebbit.tags.some((tag) => nsfwTags.includes(tag))) { - return 'yotsuba'; + return getTheme('nsfw') || 'yotsuba'; } - return 'yotsuba-b'; + return getTheme('sfw') || 'yotsuba-b'; } return 'yotsuba'; }; diff --git a/src/hooks/use-theme.ts b/src/hooks/use-theme.ts index 9011d9c0..b6b7734b 100644 --- a/src/hooks/use-theme.ts +++ b/src/hooks/use-theme.ts @@ -2,7 +2,9 @@ import { useState, useEffect } from 'react'; import { useLocation, useParams } from 'react-router-dom'; import { isAllView, isSubscriptionsView } from '../lib/utils/view-utils'; import useThemeStore from '../stores/use-theme-store'; +import useDefaultSubplebbits from './use-default-subplebbits'; import useInitialTheme from './use-initial-theme'; +import { nsfwTags } from '../views/home/home'; const themeClasses = ['yotsuba', 'yotsuba-b', 'futaba', 'burichan', 'tomorrow', 'photon']; @@ -15,10 +17,11 @@ const updateThemeClass = (newTheme: string) => { const useTheme = (): [string, (theme: string) => void] => { const location = useLocation(); - const params = useParams(); + const params = useParams<{ subplebbitAddress: string }>(); const setThemeStore = useThemeStore((state) => state.setTheme); const getTheme = useThemeStore((state) => state.getTheme); const loadThemes = useThemeStore((state) => state.loadThemes); + const subplebbits = useDefaultSubplebbits(); const initialTheme = useInitialTheme(); const [theme, setLocalTheme] = useState(() => initialTheme); @@ -41,30 +44,40 @@ const useTheme = (): [string, (theme: string) => void] => { const isInSubscriptionsView = isSubscriptionsView(location.pathname, params); let storedTheme = null; - if (subplebbitAddress) { - storedTheme = getTheme(subplebbitAddress); - } else if (isInAllView) { + if (isInAllView) { storedTheme = getTheme('all'); } else if (isInSubscriptionsView) { storedTheme = getTheme('subscriptions'); + } else if (subplebbitAddress) { + const subplebbit = subplebbits.find((s) => s.address === subplebbitAddress); + if (subplebbit && subplebbit.tags && subplebbit.tags.some((tag) => nsfwTags.includes(tag))) { + storedTheme = getTheme('nsfw'); + } else { + storedTheme = getTheme('sfw'); + } } const themeToSet = storedTheme || initialTheme; setLocalTheme(themeToSet); updateThemeClass(themeToSet); - }, [initialTheme, location.pathname, params, getTheme, themesLoaded]); + }, [initialTheme, location.pathname, params, getTheme, themesLoaded, subplebbits]); const setSubplebbitTheme = async (newTheme: string) => { const subplebbitAddress = params?.subplebbitAddress; const isInAllView = isAllView(location.pathname, params); const isInSubscriptionsView = isSubscriptionsView(location.pathname, params); - if (subplebbitAddress) { - await setThemeStore(subplebbitAddress, newTheme); - } else if (isInAllView) { + if (isInAllView) { await setThemeStore('all', newTheme); } else if (isInSubscriptionsView) { await setThemeStore('subscriptions', newTheme); + } else if (subplebbitAddress) { + const subplebbit = subplebbits.find((s) => s.address === subplebbitAddress); + if (subplebbit && subplebbit.tags && subplebbit.tags.some((tag) => nsfwTags.includes(tag))) { + await setThemeStore('nsfw', newTheme); + } else { + await setThemeStore('sfw', newTheme); + } } setLocalTheme(newTheme); diff --git a/src/stores/use-theme-store.ts b/src/stores/use-theme-store.ts index 85c68e91..95fe3941 100644 --- a/src/stores/use-theme-store.ts +++ b/src/stores/use-theme-store.ts @@ -2,9 +2,14 @@ import { create, StoreApi } from 'zustand'; import localForageLru from '@plebbit/plebbit-react-hooks/dist/lib/localforage-lru/index.js'; interface ThemeState { - themes: Record; - setTheme: (subplebbitAddress: string, theme: string) => void; - getTheme: (subplebbitAddress: string) => string | null; + themes: { + nsfw: string; + sfw: string; + all: string; + subscriptions: string; + }; + setTheme: (category: keyof ThemeState['themes'], theme: string) => void; + getTheme: (category: keyof ThemeState['themes']) => string | null; loadThemes: () => Promise; } @@ -14,20 +19,30 @@ const themeStore = localForageLru.createInstance({ }); const useThemeStore = create((set: StoreApi['setState'], get: StoreApi['getState']) => ({ - themes: {}, - setTheme: async (subplebbitAddress: string, theme: string) => { + themes: { + nsfw: 'yotsuba', + sfw: 'yotsuba-b', + all: 'yotsuba-b', + subscriptions: 'yotsuba-b', + }, + setTheme: async (category, theme) => { const currentThemes = get().themes; - const updatedThemes = { ...currentThemes, [subplebbitAddress]: theme }; - await themeStore.setItem(subplebbitAddress, theme); + const updatedThemes = { ...currentThemes, [category]: theme }; + await themeStore.setItem(category, theme); set({ themes: updatedThemes }); }, - getTheme: (subplebbitAddress: string) => { + getTheme: (category) => { const currentThemes = get().themes; - return currentThemes[subplebbitAddress] || null; + return currentThemes[category] || null; }, loadThemes: async () => { - const entries: [string, string][] = await themeStore.entries(); - const themes: Record = {}; + const entries: [keyof ThemeState['themes'], string][] = await themeStore.entries(); + const themes: Record = { + nsfw: 'yotsuba', + sfw: 'yotsuba-b', + all: 'yotsuba-b', + subscriptions: 'yotsuba-b', + }; entries.forEach(([key, value]) => { themes[key] = value; }); From d78ce84db407cbb364e447fec7ec74e4741e08d7 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Mon, 1 Jul 2024 10:26:38 +0200 Subject: [PATCH 06/13] feat(post): clicking "+" button next to "omitted replies" message shows all replies --- public/translations/ar/default.json | 3 +- public/translations/bn/default.json | 3 +- public/translations/cs/default.json | 3 +- public/translations/da/default.json | 3 +- public/translations/de/default.json | 3 +- public/translations/el/default.json | 3 +- public/translations/en/default.json | 3 +- public/translations/es/default.json | 3 +- public/translations/fa/default.json | 3 +- public/translations/fi/default.json | 3 +- public/translations/fil/default.json | 3 +- public/translations/fr/default.json | 3 +- public/translations/he/default.json | 3 +- public/translations/hi/default.json | 3 +- public/translations/hu/default.json | 3 +- public/translations/id/default.json | 3 +- public/translations/it/default.json | 3 +- public/translations/ja/default.json | 3 +- public/translations/ko/default.json | 3 +- public/translations/mr/default.json | 3 +- public/translations/nl/default.json | 3 +- public/translations/no/default.json | 3 +- public/translations/pl/default.json | 3 +- public/translations/pt/default.json | 3 +- public/translations/ro/default.json | 3 +- public/translations/ru/default.json | 3 +- public/translations/sq/default.json | 3 +- public/translations/sv/default.json | 3 +- public/translations/te/default.json | 3 +- public/translations/th/default.json | 3 +- public/translations/tr/default.json | 3 +- public/translations/uk/default.json | 3 +- public/translations/ur/default.json | 3 +- public/translations/vi/default.json | 3 +- public/translations/zh/default.json | 3 +- src/components/post-desktop/post-desktop.tsx | 50 +++++++++++++------- src/components/post-mobile/post-mobile.tsx | 27 ++++++----- src/hooks/use-author-address-click.ts | 10 ++-- src/themes.css | 6 --- src/views/post/post.module.css | 13 +++-- src/views/post/post.tsx | 1 + 41 files changed, 132 insertions(+), 80 deletions(-) diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index 69cfc8fc..671175e8 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -202,5 +202,6 @@ "loading": "جار التحميل", "posted_by": "نشر بواسطة", "by": "بواسطة", - "last_reply_by": "آخر رد بواسطة" + "last_reply_by": "آخر رد بواسطة", + "showing_all_replies": "عرض جميع الردود." } \ No newline at end of file diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index 9c113b63..4b19ba58 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -202,5 +202,6 @@ "loading": "লোড হচ্ছে", "posted_by": "পোস্ট করেছেন", "by": "দ্বারা", - "last_reply_by": "শেষ উত্তর দেননি" + "last_reply_by": "শেষ উত্তর দেননি", + "showing_all_replies": "সব উত্তর দেখাচ্ছি।" } \ No newline at end of file diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index 26b5359a..e334a1e3 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -202,5 +202,6 @@ "loading": "Načítání", "posted_by": "Publikoval(a)", "by": "od", - "last_reply_by": "Poslední odpověď od" + "last_reply_by": "Poslední odpověď od", + "showing_all_replies": "Zobrazuji všechny odpovědi." } \ No newline at end of file diff --git a/public/translations/da/default.json b/public/translations/da/default.json index f3a42ca2..358ad224 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -202,5 +202,6 @@ "loading": "Indlæser", "posted_by": "Skrevet af", "by": "af", - "last_reply_by": "Seneste svar fra" + "last_reply_by": "Seneste svar fra", + "showing_all_replies": "Viser alle svar." } \ No newline at end of file diff --git a/public/translations/de/default.json b/public/translations/de/default.json index f3c670cc..659b0a3b 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -202,5 +202,6 @@ "loading": "Laden", "posted_by": "Geschrieben von", "by": "von", - "last_reply_by": "Letzte Antwort von" + "last_reply_by": "Letzte Antwort von", + "showing_all_replies": "Zeige alle Antworten." } \ No newline at end of file diff --git a/public/translations/el/default.json b/public/translations/el/default.json index 2f8b4af9..1cb495d1 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -202,5 +202,6 @@ "loading": "Φόρτωση", "posted_by": "Δημοσιεύτηκε από", "by": "από", - "last_reply_by": "Τελευταία απάντηση από" + "last_reply_by": "Τελευταία απάντηση από", + "showing_all_replies": "Εμφανίζονται όλες οι απαντήσεις." } \ No newline at end of file diff --git a/public/translations/en/default.json b/public/translations/en/default.json index 3c5dbb87..620e9167 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -202,5 +202,6 @@ "loading": "Loading", "posted_by": "Posted by", "by": "by", - "last_reply_by": "Last reply by" + "last_reply_by": "Last reply by", + "showing_all_replies": "Showing all replies." } \ No newline at end of file diff --git a/public/translations/es/default.json b/public/translations/es/default.json index 0daec4e4..44bbd0a3 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -202,5 +202,6 @@ "loading": "Cargando", "posted_by": "Publicado por", "by": "por", - "last_reply_by": "Última respuesta de" + "last_reply_by": "Última respuesta de", + "showing_all_replies": "Mostrando todas las respuestas." } \ No newline at end of file diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index 16f8613c..36871609 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -202,5 +202,6 @@ "loading": "در حال بارگذاری", "posted_by": "ارسال شده توسط", "by": "توسط", - "last_reply_by": "آخرین پاسخ توسط" + "last_reply_by": "آخرین پاسخ توسط", + "showing_all_replies": "نمایش تمام پاسخ‌ها." } \ No newline at end of file diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index 46e61a01..dd41091c 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -202,5 +202,6 @@ "loading": "Lataa", "posted_by": "Lähettäjä", "by": "kirjoittanut", - "last_reply_by": "Viimeisin vastaus" + "last_reply_by": "Viimeisin vastaus", + "showing_all_replies": "Näytetään kaikki vastaukset." } \ No newline at end of file diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index fb57bf02..eb86b9c7 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -202,5 +202,6 @@ "loading": "Naglo-load", "posted_by": "Nai-post ni", "by": "ni", - "last_reply_by": "Huling sagot ni" + "last_reply_by": "Huling sagot ni", + "showing_all_replies": "Nagpapakita ng lahat ng mga sagot." } \ No newline at end of file diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index b6d75704..000db99d 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -202,5 +202,6 @@ "loading": "Chargement", "posted_by": "Posté par", "by": "par", - "last_reply_by": "Dernière réponse par" + "last_reply_by": "Dernière réponse par", + "showing_all_replies": "Affichage de toutes les réponses." } \ No newline at end of file diff --git a/public/translations/he/default.json b/public/translations/he/default.json index 1dc3c3d5..a2b070b9 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -202,5 +202,6 @@ "loading": "טוען", "posted_by": "פורסם על ידי", "by": "על ידי", - "last_reply_by": "תגובה אחרונה מאת" + "last_reply_by": "תגובה אחרונה מאת", + "showing_all_replies": "מציג את כל התגובות." } \ No newline at end of file diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index 9abdf9e4..b6a792cf 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -202,5 +202,6 @@ "loading": "लोड हो रहा है", "posted_by": "द्वारा लिखित", "by": "द्वारा", - "last_reply_by": "अंतिम उत्तर दिया गया है" + "last_reply_by": "अंतिम उत्तर दिया गया है", + "showing_all_replies": "सभी उत्तर दिखा रहा है।" } \ No newline at end of file diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index 8bc66fd0..a5250c72 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -202,5 +202,6 @@ "loading": "Betöltés", "posted_by": "Írta", "by": "által", - "last_reply_by": "Utolsó válasz írta" + "last_reply_by": "Utolsó válasz írta", + "showing_all_replies": "Az összes válasz megjelenítése." } \ No newline at end of file diff --git a/public/translations/id/default.json b/public/translations/id/default.json index ec2ddd84..9c63471d 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -202,5 +202,6 @@ "loading": "Memuat", "posted_by": "Diposting oleh", "by": "oleh", - "last_reply_by": "Balasan terakhir oleh" + "last_reply_by": "Balasan terakhir oleh", + "showing_all_replies": "Menampilkan semua balasan." } \ No newline at end of file diff --git a/public/translations/it/default.json b/public/translations/it/default.json index 34a0458f..89fb6abe 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -202,5 +202,6 @@ "loading": "Caricamento", "posted_by": "Pubblicato da", "by": "da", - "last_reply_by": "Ultima risposta da" + "last_reply_by": "Ultima risposta da", + "showing_all_replies": "Mostrando tutte le risposte." } \ No newline at end of file diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index a35b4360..7d7b8654 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -202,5 +202,6 @@ "loading": "読み込み中", "posted_by": "投稿者", "by": "によって", - "last_reply_by": "最後の返信者" + "last_reply_by": "最後の返信者", + "showing_all_replies": "すべての返信を表示しています。" } \ No newline at end of file diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index 4ca5b423..380ea33f 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -202,5 +202,6 @@ "loading": "로딩 중", "posted_by": "작성자", "by": "작성자:", - "last_reply_by": "마지막 답글 작성자:" + "last_reply_by": "마지막 답글 작성자:", + "showing_all_replies": "모든 답글을 표시합니다." } \ No newline at end of file diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index 1f846c55..227adb3d 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -202,5 +202,6 @@ "loading": "लोड होत आहे", "posted_by": "ने टप्पल केला", "by": "व्यक्ती", - "last_reply_by": "शेवटचा प्रतिसाद व्यक्ती" + "last_reply_by": "शेवटचा प्रतिसाद व्यक्ती", + "showing_all_replies": "सर्व प्रतिसाद दाखवत आहे." } \ No newline at end of file diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index 407834c4..840b56b7 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -202,5 +202,6 @@ "loading": "Laden", "posted_by": "Geplaatst door", "by": "door", - "last_reply_by": "Laatste reactie door" + "last_reply_by": "Laatste reactie door", + "showing_all_replies": "Alle antwoorden weergeven." } \ No newline at end of file diff --git a/public/translations/no/default.json b/public/translations/no/default.json index 505bca3f..391da8e1 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -202,5 +202,6 @@ "loading": "Laster", "posted_by": "Skrevet av", "by": "av", - "last_reply_by": "Siste svar fra" + "last_reply_by": "Siste svar fra", + "showing_all_replies": "Viser alle svar." } \ No newline at end of file diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index 8d974897..9a7005f9 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -202,5 +202,6 @@ "loading": "Ładowanie", "posted_by": "Opublikowane przez", "by": "przez", - "last_reply_by": "Ostatnia odpowiedź od" + "last_reply_by": "Ostatnia odpowiedź od", + "showing_all_replies": "Wyświetlanie wszystkich odpowiedzi." } \ No newline at end of file diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index 90b4bc10..e370ce5e 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -202,5 +202,6 @@ "loading": "Carregando", "posted_by": "Postado por", "by": "por", - "last_reply_by": "Última resposta por" + "last_reply_by": "Última resposta por", + "showing_all_replies": "Mostrando todas as respostas." } \ No newline at end of file diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index 86e486ec..3918f135 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -202,5 +202,6 @@ "loading": "Încărcare", "posted_by": "Postat de", "by": "de către", - "last_reply_by": "Ultima răspuns de la" + "last_reply_by": "Ultima răspuns de la", + "showing_all_replies": "Afișare toate răspunsurile." } \ No newline at end of file diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index 7d2a6767..cb7b55db 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -202,5 +202,6 @@ "loading": "Загрузка", "posted_by": "Опубликовано", "by": "от", - "last_reply_by": "Последний ответ от" + "last_reply_by": "Последний ответ от", + "showing_all_replies": "Показываются все ответы." } \ No newline at end of file diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index ee24594b..89499c2c 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -202,5 +202,6 @@ "loading": "Ngarkimi", "posted_by": "Postuar nga", "by": "nga", - "last_reply_by": "Përgjigje e fundit nga" + "last_reply_by": "Përgjigje e fundit nga", + "showing_all_replies": "Duke treguar të gjitha përgjigjet." } \ No newline at end of file diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index 6fbed85d..d8a294a9 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -202,5 +202,6 @@ "loading": "Laddar", "posted_by": "Postat av", "by": "av", - "last_reply_by": "Senaste svar av" + "last_reply_by": "Senaste svar av", + "showing_all_replies": "Visar alla svar." } \ No newline at end of file diff --git a/public/translations/te/default.json b/public/translations/te/default.json index 01345f6e..b20d39b8 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -202,5 +202,6 @@ "loading": "లోడ్ అవుతోంది", "posted_by": "పోస్ట్ చేసినవాడు", "by": "ద్వారా", - "last_reply_by": "చివరి సమాధానం ఇచ్చింది" + "last_reply_by": "చివరి సమాధానం ఇచ్చింది", + "showing_all_replies": "అన్ని సమాధానాలను చూపుతుంది." } \ No newline at end of file diff --git a/public/translations/th/default.json b/public/translations/th/default.json index 121da9fa..1ad41cda 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -202,5 +202,6 @@ "loading": "กำลังโหลด", "posted_by": "โพสต์โดย", "by": "โดย", - "last_reply_by": "การตอบคำถามล่าสุดโดย" + "last_reply_by": "การตอบคำถามล่าสุดโดย", + "showing_all_replies": "กำลังแสดงคำตอบทั้งหมด" } \ No newline at end of file diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index efef0ed8..f948010c 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -202,5 +202,6 @@ "loading": "Yükleniyor", "posted_by": "Tarafından gönderildi", "by": "tarafından", - "last_reply_by": "Son cevap" + "last_reply_by": "Son cevap", + "showing_all_replies": "Tüm yanıtlar gösteriliyor." } \ No newline at end of file diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index 25734130..29acc103 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -202,5 +202,6 @@ "loading": "Завантаження", "posted_by": "Опубліковано", "by": "від", - "last_reply_by": "Остання відповідь від" + "last_reply_by": "Остання відповідь від", + "showing_all_replies": "Показуються всі відповіді." } \ No newline at end of file diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index f2b54313..ba91ed20 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -202,5 +202,6 @@ "loading": "لوڈ ہو رہا ہے", "posted_by": "پوسٹ کیا گیا", "by": "کے ذریعے", - "last_reply_by": "آخری جواب دیا گیا" + "last_reply_by": "آخری جواب دیا گیا", + "showing_all_replies": "تمام جوابات دکھا رہا ہے۔" } \ No newline at end of file diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index c28f7ab8..0f7167f3 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -202,5 +202,6 @@ "loading": "Đang tải", "posted_by": "Được đăng bởi", "by": "bởi", - "last_reply_by": "Trả lời cuối cùng bởi" + "last_reply_by": "Trả lời cuối cùng bởi", + "showing_all_replies": "Đang hiển thị tất cả các phản hồi." } \ No newline at end of file diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index f5834ffb..cc1e61b0 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -202,5 +202,6 @@ "loading": "加载中", "posted_by": "由...发布", "by": "由...发布", - "last_reply_by": "最后回复者" + "last_reply_by": "最后回复者", + "showing_all_replies": "显示所有回复。" } \ No newline at end of file diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index d30ab423..bddfaba8 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -23,9 +23,20 @@ import PostMenuDesktop from './post-menu-desktop'; import ReplyQuotePreview from '../reply-quote-preview'; import Tooltip from '../tooltip'; import { PostProps } from '../../views/post/post'; +import { create } from 'zustand'; import _ from 'lodash'; -const PostInfo = ({ openReplyModal, post, roles, isHidden }: PostProps) => { +interface ShowOmittedRepliesState { + showOmittedReplies: boolean; + setShowOmittedReplies: (showOmittedReplies: boolean) => void; +} + +const useShowOmittedReplies = create((set) => ({ + showOmittedReplies: false, + setShowOmittedReplies: (showOmittedReplies: boolean) => set({ showOmittedReplies }), +})); + +const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: PostProps) => { const { t } = useTranslation(); const { author, cid, locked, pinned, parentCid, postCid, replyCount, shortCid, state, subplebbitAddress, timestamp } = post || {}; const title = post?.title?.trim(); @@ -36,6 +47,7 @@ const PostInfo = ({ openReplyModal, post, roles, isHidden }: PostProps) => { const { isDescription, isRules } = post || {}; // custom properties, not from api const stateString = useStateString(post); const isReply = parentCid; + const { showOmittedReplies } = useShowOmittedReplies(); const params = useParams(); const location = useLocation(); @@ -49,7 +61,7 @@ const PostInfo = ({ openReplyModal, post, roles, isHidden }: PostProps) => { const { isCommentAuthorMod, isAccountMod, isAccountCommentAuthor } = useEditCommentPrivileges({ commentAuthorAddress: address, subplebbitAddress }); const handleUserAddressClick = useAuthorAddressClick(); - let numberOfPostsByAuthor = document.querySelectorAll(`[data-author-address="${shortAddress}"]`).length; + const numberOfPostsByAuthor = document.querySelectorAll(`[data-author-address="${shortAddress}"][data-post-cid="${postCid}"]`).length; return (
@@ -87,13 +99,13 @@ const PostInfo = ({ openReplyModal, post, roles, isHidden }: PostProps) => { handleUserAddressClick(shortAddress || accountShortAddress)} + onClick={() => handleUserAddressClick(shortAddress || accountShortAddress, postCid)} > {shortAddress || accountShortAddress} } content={`${numberOfPostsByAuthor} ${numberOfPostsByAuthor === 1 ? 'post' : 'posts'} by this user address`} - showTooltip={isInPostPageView} + showTooltip={isInPostPageView || showOmittedReplies || postReplyCount < 6} /> ){' '} @@ -279,7 +291,7 @@ const PostMessage = ({ post }: PostProps) => { ); }; -const Reply = ({ openReplyModal, reply, roles }: PostProps) => { +const Reply = ({ openReplyModal, postReplyCount, reply, roles }: PostProps) => { let post = reply; // handle pending mod or author edit const { editedComment } = useEditedComment({ comment: reply }); @@ -287,7 +299,7 @@ const Reply = ({ openReplyModal, reply, roles }: PostProps) => { post = editedComment; } - const { cid, content, link, subplebbitAddress } = post || {}; + const { author, cid, content, link, postCid, subplebbitAddress } = post || {}; const isRouteLinkToReply = useLocation().pathname.startsWith(`/p/${subplebbitAddress}/c/${cid}`); const { hidden } = useHide({ cid }); @@ -297,9 +309,10 @@ const Reply = ({ openReplyModal, reply, roles }: PostProps) => {
- + {link && !hidden && isValidURL(link) && } {content && !hidden && }
@@ -308,7 +321,8 @@ const Reply = ({ openReplyModal, reply, roles }: PostProps) => { }; const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies = true }: PostProps) => { - const { cid, content, link, pinned, replyCount, subplebbitAddress } = post || {}; + const { t } = useTranslation(); + const { author, cid, content, link, pinned, postCid, replyCount, subplebbitAddress } = post || {}; const { isDescription, isRules } = post || {}; // custom properties, not from api const params = useParams(); const location = useLocation(); @@ -323,6 +337,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies const totallinksCount = useCountLinksInReplies(post); const repliesCount = pinned ? replyCount : replyCount - 5; const linksCount = pinned ? totallinksCount : totallinksCount - visiblelinksCount; + const { showOmittedReplies, setShowOmittedReplies } = useShowOmittedReplies(); // scroll to reply if pathname is reply permalink (backlink) const replyRefs = useRef<(HTMLDivElement | null)[]>([]); @@ -348,7 +363,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies )} -
+
{link && !isHidden && isValidURL(link) && } {!isHidden && !content &&
} @@ -356,10 +371,13 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies
{!isHidden && !isDescription && !isRules && !isInPendingPostView && (replies.length > 5 || (pinned && replies.length > 0)) && !isInPostPageView && ( - - - - {linksCount > 0 ? ( + setShowOmittedReplies(!showOmittedReplies)} + /> + {showOmittedReplies ? ( + t('showing_all_replies') + ) : linksCount > 0 ? ( ( + (showAllReplies || showOmittedReplies ? replies : replies.slice(-5)).map((reply, index) => (
(replyRefs.current[index] = el)}> - +
))}
diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 501b54f2..2d6adb62 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -21,9 +21,9 @@ import Tooltip from '../tooltip'; import { PostProps } from '../../views/post/post'; import _ from 'lodash'; -const PostInfoAndMedia = ({ openReplyModal, post, roles }: PostProps) => { +const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: PostProps) => { const { t } = useTranslation(); - const { author, cid, link, locked, parentCid, pinned, shortCid, state, subplebbitAddress, timestamp } = post || {}; + const { author, cid, link, locked, parentCid, pinned, postCid, shortCid, state, subplebbitAddress, timestamp } = post || {}; const title = post?.title?.trim(); const { isDescription, isRules } = post || {}; // custom properties, not from api const { address, shortAddress } = author || {}; @@ -49,7 +49,7 @@ const PostInfoAndMedia = ({ openReplyModal, post, roles }: PostProps) => { const stateString = useStateString(post); const handleUserAddressClick = useAuthorAddressClick(); - const numberOfPostsByAuthor = document.querySelectorAll(`[data-author-address="${shortAddress}"]`).length; + const numberOfPostsByAuthor = document.querySelectorAll(`[data-author-address="${shortAddress}"][data-post-cid="${postCid}"]`).length; return ( <> @@ -79,13 +79,13 @@ const PostInfoAndMedia = ({ openReplyModal, post, roles }: PostProps) => { handleUserAddressClick(shortAddress || accountShortAddress)} + onClick={() => handleUserAddressClick(shortAddress || accountShortAddress, postCid)} > {shortAddress || accountShortAddress} } content={`${numberOfPostsByAuthor} ${numberOfPostsByAuthor === 1 ? 'post' : 'posts'} by this user address`} - showTooltip={isInPostPageView} + showTooltip={isInPostPageView || postReplyCount < 6} /> ){' '} @@ -234,14 +234,14 @@ const PostMessageMobile = ({ post }: PostProps) => { ); }; -const Reply = ({ openReplyModal, reply, roles }: PostProps) => { +const Reply = ({ openReplyModal, postReplyCount, reply, roles }: PostProps) => { let post = reply; // handle pending mod or author edit const { editedComment } = useEditedComment({ comment: reply }); if (editedComment) { post = editedComment; } - const { cid, content, subplebbitAddress } = post || {}; + const { author, cid, content, postCid, subplebbitAddress } = post || {}; const isRouteLinkToReply = useLocation().pathname.startsWith(`/p/${subplebbitAddress}/c/${cid}`); const { hidden } = useHide({ cid }); @@ -251,9 +251,10 @@ const Reply = ({ openReplyModal, reply, roles }: PostProps) => {
- + {content && !hidden && }
@@ -264,7 +265,7 @@ const Reply = ({ openReplyModal, reply, roles }: PostProps) => { const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies = true }: PostProps) => { const { t } = useTranslation(); - const { cid, content, pinned, replyCount, subplebbitAddress } = post || {}; + const { author, cid, content, pinned, postCid, replyCount, subplebbitAddress } = post || {}; const { isDescription, isRules } = post || {}; // custom properties, not from api const params = useParams(); const location = useLocation(); @@ -306,8 +307,8 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies = )}
-
- +
+ {content && }
{!isInPostView && !isInPendingPostView && showReplies && ( @@ -333,7 +334,7 @@ const PostMobile = ({ openReplyModal, post, roles, showAllReplies, showReplies = showReplies && (showAllReplies ? replies : replies.slice(-5)).map((reply, index) => (
(replyRefs.current[index] = el)}> - +
))}
diff --git a/src/hooks/use-author-address-click.ts b/src/hooks/use-author-address-click.ts index 76ef510a..4cca13e2 100644 --- a/src/hooks/use-author-address-click.ts +++ b/src/hooks/use-author-address-click.ts @@ -1,11 +1,7 @@ -import { useParams } from 'react-router-dom'; - const useAuthorAddressClick = () => { - const { commentCid } = useParams<{ commentCid: string }>(); - - const handleUserAddressClick = (shortAddress: string) => { + const handleUserAddressClick = (shortAddress: string, postCid: string) => { // Select the elements corresponding to the clicked short address - const elements = document.querySelectorAll(`[data-author-address="${shortAddress}"]`); + const elements = document.querySelectorAll(`[data-author-address="${shortAddress}"][data-post-cid="${postCid}"]`); // Check if the clicked address is already highlighted const isAlreadyHighlighted = Array.from(elements).some((element) => element.classList.contains('highlight')); @@ -21,7 +17,7 @@ const useAuthorAddressClick = () => { // Highlight the new elements, excluding the element matching the cid if it is the OP post elements.forEach((element) => { - if (element.getAttribute('data-cid') !== commentCid) { + if (element.getAttribute('data-cid') !== element.getAttribute('data-post-cid')) { element.classList.add('highlight'); } }); diff --git a/src/themes.css b/src/themes.css index ebd4b670..d74e37b4 100644 --- a/src/themes.css +++ b/src/themes.css @@ -103,7 +103,6 @@ --post-menu-desktop-btn-opacity: 0.8; --post-menu-desktop-button-color-hover: red; --post-greentext-color: #789922; - --post-replies-expand-button-background-image: url("/public/assets/buttons/plus-red.png"); /* post form */ --post-form-toggle-font-size: 22px; @@ -309,7 +308,6 @@ --post-menu-desktop-btn-opacity: 0.8; --post-menu-desktop-button-color-hover: #d00; --post-greentext-color: #789922; - --post-replies-expand-button-background-image: url("/public/assets/buttons/plus-blue.png"); /* post form */ --post-form-toggle-font-size: 22px; @@ -496,7 +494,6 @@ --post-menu-desktop-btn-opacity: 0.8; --post-menu-desktop-button-color-hover: red; --post-greentext-color: #789922; - --post-replies-expand-button-background-image: url("/public/assets/buttons/plus-red.png"); /* post form */ --post-form-toggle-font-size: 22px; @@ -679,7 +676,6 @@ --post-menu-desktop-btn-opacity: 0.8; --post-menu-desktop-button-color-hover: #d00; --post-greentext-color: #789922; - --post-replies-expand-button-background-image: url("/public/assets/buttons/plus-blue.png"); /* post form */ --post-form-toggle-font-size: 22px; @@ -867,7 +863,6 @@ --post-menu-desktop-btn-opacity: 0.8; --post-menu-desktop-button-color-hover: #81a2be; --post-greentext-color: #b5bd68; - --post-replies-expand-button-background-image: url("/public/assets/buttons/plus-dark.png"); /* post form */ --post-form-toggle-font-size: 22px; @@ -1069,7 +1064,6 @@ --post-menu-desktop-btn-opacity: 0.8; --post-menu-desktop-button-color-hover: #FF3300; --post-greentext-color: #789922; - --post-replies-expand-button-background-image: url("/public/assets/buttons/plus-photon.png"); /* post mobile */ --post-mobile-background-color: #eee; diff --git a/src/views/post/post.module.css b/src/views/post/post.module.css index faecac10..14d3c20a 100644 --- a/src/views/post/post.module.css +++ b/src/views/post/post.module.css @@ -179,14 +179,13 @@ color: var(--post-mobile-abbr-text-color); } -.postDesktop .summary .expandButtonWrapper { +.postDesktop .summary .omittedRepliesButtonWrapper { position: absolute; top: 8px; left: 2px; } -.postDesktop .summary .expandButton { - background-image: var(--post-replies-expand-button-background-image); +.postDesktop .summary .omittedRepliesButtonWrapper { background-repeat: no-repeat; background-position: center; width: 18px; @@ -196,6 +195,14 @@ cursor: pointer; } +.postDesktop .summary .hideOmittedReplies { + background-image: var(--post-hide-button-background-image); +} + +.postDesktop .summary .showOmittedReplies { + background-image: var(--post-unhide-button-background-image); +} + .postDesktop .summary a { color: var(--post-link-text-color); text-decoration: var(--post-content-link-text-decoration); diff --git a/src/views/post/post.tsx b/src/views/post/post.tsx index 1b36fa40..429e7cdf 100644 --- a/src/views/post/post.tsx +++ b/src/views/post/post.tsx @@ -17,6 +17,7 @@ export interface PostProps { index?: number; isHidden?: boolean; post?: any; + postReplyCount?: number; reply?: any; roles?: Role[]; showAllReplies?: boolean; From 713739b02f1572164f1923b48b4e4d19b0c48ebe Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Mon, 1 Jul 2024 10:33:11 +0200 Subject: [PATCH 07/13] feat(post): clicking "+" button next to "omitted replies" message shows all replies --- .../board-buttons/board-buttons.module.css | 19 ---------------- .../board-buttons/board-buttons.tsx | 22 ------------------- src/components/topbar/topbar.tsx | 10 +++++++++ 3 files changed, 10 insertions(+), 41 deletions(-) diff --git a/src/components/board-buttons/board-buttons.module.css b/src/components/board-buttons/board-buttons.module.css index a1c3a79a..36a20ac2 100644 --- a/src/components/board-buttons/board-buttons.module.css +++ b/src/components/board-buttons/board-buttons.module.css @@ -54,29 +54,10 @@ padding-top: 15px; } -.adButton { - text-align: center; - font-size: 10px; -} - -.adButton a { - text-decoration: none; - color: var(--button-desktop-text-color); - -} -.adButton a:hover { - cursor: pointer; - color: var(--button-desktop-text-color-hover); -} - @media (max-width: 640px) { .desktopBoardButtons { display: none; } - - .adButton { - display: inline-flex; - } } @media (min-width: 640px) { diff --git a/src/components/board-buttons/board-buttons.tsx b/src/components/board-buttons/board-buttons.tsx index 0106a50e..fbcc9be4 100644 --- a/src/components/board-buttons/board-buttons.tsx +++ b/src/components/board-buttons/board-buttons.tsx @@ -172,24 +172,6 @@ export const TimeFilter = ({ isInAllView, isInCatalogView, isInSubscriptionsView ); }; -const AdButton = () => { - return ( -
- [ - { - e.preventDefault(); - alert('work in progress'); - }} - > - Plebbit Leaderboard - - ] -
- ); -}; - export const MobileBoardButtons = () => { const params = useParams(); const location = useLocation(); @@ -204,8 +186,6 @@ export const MobileBoardButtons = () => { return (
- -
{isInPostView || isInPendingPostPage ? ( <> @@ -253,8 +233,6 @@ export const DesktopBoardButtons = () => { return ( <> -
-
{isInPostView || isInPendingPostPage ? ( diff --git a/src/components/topbar/topbar.tsx b/src/components/topbar/topbar.tsx index 59f054ee..3e02f6b5 100644 --- a/src/components/topbar/topbar.tsx +++ b/src/components/topbar/topbar.tsx @@ -90,6 +90,16 @@ const TopBarDesktop = () => { > Create + ] [ + { + e.preventDefault(); + alert('work in progress'); + }} + > + Vote + ] )} From 385740c36fac78bc3cb99fa3ffcf845131bbfa57 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Mon, 1 Jul 2024 10:40:20 +0200 Subject: [PATCH 08/13] Update post-desktop.tsx --- src/components/post-desktop/post-desktop.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index bddfaba8..92fa6ebc 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -365,7 +365,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies )}
{link && !isHidden && isValidURL(link) && } - + {!isHidden && !content &&
} {!isHidden && content && }
From eb6751ab255b9716a869d33c4d75f91667e26c04 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Mon, 1 Jul 2024 10:54:27 +0200 Subject: [PATCH 09/13] chore: add translations --- public/translations/ar/default.json | 7 ++++++- public/translations/bn/default.json | 7 ++++++- public/translations/cs/default.json | 7 ++++++- public/translations/da/default.json | 7 ++++++- public/translations/de/default.json | 7 ++++++- public/translations/el/default.json | 7 ++++++- public/translations/en/default.json | 7 ++++++- public/translations/es/default.json | 7 ++++++- public/translations/fa/default.json | 7 ++++++- public/translations/fi/default.json | 7 ++++++- public/translations/fil/default.json | 7 ++++++- public/translations/fr/default.json | 7 ++++++- public/translations/he/default.json | 7 ++++++- public/translations/hi/default.json | 7 ++++++- public/translations/hu/default.json | 7 ++++++- public/translations/id/default.json | 7 ++++++- public/translations/it/default.json | 7 ++++++- public/translations/ja/default.json | 7 ++++++- public/translations/ko/default.json | 7 ++++++- public/translations/mr/default.json | 7 ++++++- public/translations/nl/default.json | 7 ++++++- public/translations/no/default.json | 7 ++++++- public/translations/pl/default.json | 7 ++++++- public/translations/pt/default.json | 7 ++++++- public/translations/ro/default.json | 7 ++++++- public/translations/ru/default.json | 7 ++++++- public/translations/sq/default.json | 7 ++++++- public/translations/sv/default.json | 7 ++++++- public/translations/te/default.json | 7 ++++++- public/translations/th/default.json | 7 ++++++- public/translations/tr/default.json | 7 ++++++- public/translations/uk/default.json | 7 ++++++- public/translations/ur/default.json | 7 ++++++- public/translations/vi/default.json | 7 ++++++- public/translations/zh/default.json | 7 ++++++- src/components/post-desktop/post-desktop.tsx | 12 ++++-------- src/components/post-mobile/post-mobile.tsx | 12 ++++-------- 37 files changed, 218 insertions(+), 51 deletions(-) diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index 671175e8..245c6c33 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -203,5 +203,10 @@ "posted_by": "نشر بواسطة", "by": "بواسطة", "last_reply_by": "آخر رد بواسطة", - "showing_all_replies": "عرض جميع الردود." + "showing_all_replies": "عرض جميع الردود.", + "x_posts_by_this_user_address": "{{number}} مشاركات من هذا العنوان للمستخدم", + "1_post_by_this_user_address": "مشاركة واحدة من هذا العنوان للمستخدم", + "highlight_posts": "تسليط الضوء على المشاركات من خلال هذا العنوان للمستخدم", + "display_name_too_long": "اسم العرض طويل جداً", + "title_too_long": "العنوان طويل جداً" } \ No newline at end of file diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index 4b19ba58..5e8e65d4 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -203,5 +203,10 @@ "posted_by": "পোস্ট করেছেন", "by": "দ্বারা", "last_reply_by": "শেষ উত্তর দেননি", - "showing_all_replies": "সব উত্তর দেখাচ্ছি।" + "showing_all_replies": "সব উত্তর দেখাচ্ছি।", + "x_posts_by_this_user_address": "এই ব্যবহারকারী ঠিকানা দ্বারা {{number}} টি পোস্ট", + "1_post_by_this_user_address": "এই ব্যবহারকারী ঠিকানা দ্বারা 1 টি পোস্ট", + "highlight_posts": "এই ব্যবহারকারী ঠিকানা দ্বারা পোস্টগুলি হাইলাইট করুন", + "display_name_too_long": "প্রদর্শনী নাম অত্যন্ত দীর্ঘ", + "title_too_long": "শিরোনাম অত্যন্ত দীর্ঘ" } \ No newline at end of file diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index e334a1e3..b8fde27a 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -203,5 +203,10 @@ "posted_by": "Publikoval(a)", "by": "od", "last_reply_by": "Poslední odpověď od", - "showing_all_replies": "Zobrazuji všechny odpovědi." + "showing_all_replies": "Zobrazuji všechny odpovědi.", + "x_posts_by_this_user_address": "{{number}} příspěvků od tohoto uživatelského adresy", + "1_post_by_this_user_address": "1 příspěvek od tohoto uživatelského adresy", + "highlight_posts": "Zvýraznit příspěvky z této uživatelské adresy", + "display_name_too_long": "Zobrazované jméno je příliš dlouhé", + "title_too_long": "Název je příliš dlouhý" } \ No newline at end of file diff --git a/public/translations/da/default.json b/public/translations/da/default.json index 358ad224..a56fc54f 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -203,5 +203,10 @@ "posted_by": "Skrevet af", "by": "af", "last_reply_by": "Seneste svar fra", - "showing_all_replies": "Viser alle svar." + "showing_all_replies": "Viser alle svar.", + "x_posts_by_this_user_address": "{{number}} indlæg fra denne brugeradresse", + "1_post_by_this_user_address": "1 indlæg fra denne brugeradresse", + "highlight_posts": "Fremhæv indlæg fra denne brugeradresse", + "display_name_too_long": "Visningsnavn for langt", + "title_too_long": "Titel for lang" } \ No newline at end of file diff --git a/public/translations/de/default.json b/public/translations/de/default.json index 659b0a3b..08e707c5 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -203,5 +203,10 @@ "posted_by": "Geschrieben von", "by": "von", "last_reply_by": "Letzte Antwort von", - "showing_all_replies": "Zeige alle Antworten." + "showing_all_replies": "Zeige alle Antworten.", + "x_posts_by_this_user_address": "{{number}} Beiträge von dieser Benutzeradresse", + "1_post_by_this_user_address": "1 Beitrag von dieser Benutzeradresse", + "highlight_posts": "Beiträge von dieser Benutzeradresse hervorheben", + "display_name_too_long": "Angezeigter Name zu lang", + "title_too_long": "Titel zu lang" } \ No newline at end of file diff --git a/public/translations/el/default.json b/public/translations/el/default.json index 1cb495d1..da355264 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -203,5 +203,10 @@ "posted_by": "Δημοσιεύτηκε από", "by": "από", "last_reply_by": "Τελευταία απάντηση από", - "showing_all_replies": "Εμφανίζονται όλες οι απαντήσεις." + "showing_all_replies": "Εμφανίζονται όλες οι απαντήσεις.", + "x_posts_by_this_user_address": "{{number}} δημοσιεύσεις από αυτήν τη διεύθυνση χρήστη", + "1_post_by_this_user_address": "1 δημοσίευση από αυτήν τη διεύθυνση χρήστη", + "highlight_posts": "Επισήμανση δημοσιεύσεων από αυτήν τη διεύθυνση χρήστη", + "display_name_too_long": "Το όνομα εμφάνισης είναι πολύ μεγάλο", + "title_too_long": "Το τίτλος είναι πολύ μεγάλος" } \ No newline at end of file diff --git a/public/translations/en/default.json b/public/translations/en/default.json index 620e9167..d1dabacf 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -203,5 +203,10 @@ "posted_by": "Posted by", "by": "by", "last_reply_by": "Last reply by", - "showing_all_replies": "Showing all replies." + "showing_all_replies": "Showing all replies.", + "x_posts_by_this_user_address": "{{number}} posts by this user address", + "1_post_by_this_user_address": "1 post by this user address", + "highlight_posts": "Highlight posts by this user address", + "display_name_too_long": "display name too long", + "title_too_long": "title too long" } \ No newline at end of file diff --git a/public/translations/es/default.json b/public/translations/es/default.json index 44bbd0a3..f334e235 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -203,5 +203,10 @@ "posted_by": "Publicado por", "by": "por", "last_reply_by": "Última respuesta de", - "showing_all_replies": "Mostrando todas las respuestas." + "showing_all_replies": "Mostrando todas las respuestas.", + "x_posts_by_this_user_address": "{{number}} publicaciones de esta dirección de usuario", + "1_post_by_this_user_address": "1 publicación de esta dirección de usuario", + "highlight_posts": "Resaltar publicaciones de esta dirección de usuario", + "display_name_too_long": "nombre de visualización demasiado largo", + "title_too_long": "título demasiado largo" } \ No newline at end of file diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index 36871609..03162074 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -203,5 +203,10 @@ "posted_by": "ارسال شده توسط", "by": "توسط", "last_reply_by": "آخرین پاسخ توسط", - "showing_all_replies": "نمایش تمام پاسخ‌ها." + "showing_all_replies": "نمایش تمام پاسخ‌ها.", + "x_posts_by_this_user_address": "{{number}} پست از این آدرس کاربر", + "1_post_by_this_user_address": "1 پست از این آدرس کاربر", + "highlight_posts": "برجسته سازی پست ها از این آدرس کاربر", + "display_name_too_long": "نام نمایشی خیلی طولانی است", + "title_too_long": "عنوان خیلی طولانی است" } \ No newline at end of file diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index dd41091c..182eda56 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -203,5 +203,10 @@ "posted_by": "Lähettäjä", "by": "kirjoittanut", "last_reply_by": "Viimeisin vastaus", - "showing_all_replies": "Näytetään kaikki vastaukset." + "showing_all_replies": "Näytetään kaikki vastaukset.", + "x_posts_by_this_user_address": "Tästä käyttäjän osoitteesta {{number}} viestiä", + "1_post_by_this_user_address": "1 viesti tästä käyttäjän osoitteesta", + "highlight_posts": "Korosta tämän käyttäjän osoitteen viestit", + "display_name_too_long": "Näyttönimi liian pitkä", + "title_too_long": "Otsikko on liian pitkä" } \ No newline at end of file diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index eb86b9c7..052f9fdf 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -203,5 +203,10 @@ "posted_by": "Nai-post ni", "by": "ni", "last_reply_by": "Huling sagot ni", - "showing_all_replies": "Nagpapakita ng lahat ng mga sagot." + "showing_all_replies": "Nagpapakita ng lahat ng mga sagot.", + "x_posts_by_this_user_address": "{{number}} mga post mula sa user address na ito", + "1_post_by_this_user_address": "1 post mula sa user address na ito", + "highlight_posts": "I-highlight ang mga post mula sa user address na ito", + "display_name_too_long": "ang display name ay masyadong mahaba", + "title_too_long": "ang pamagat ay masyadong mahaba" } \ No newline at end of file diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index 000db99d..46609bdb 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -203,5 +203,10 @@ "posted_by": "Posté par", "by": "par", "last_reply_by": "Dernière réponse par", - "showing_all_replies": "Affichage de toutes les réponses." + "showing_all_replies": "Affichage de toutes les réponses.", + "x_posts_by_this_user_address": "{{number}} messages de cette adresse utilisateur", + "1_post_by_this_user_address": "1 message de cette adresse utilisateur", + "highlight_posts": "Mettre en évidence les messages de cette adresse utilisateur", + "display_name_too_long": "nom d'affichage trop long", + "title_too_long": "titre trop long" } \ No newline at end of file diff --git a/public/translations/he/default.json b/public/translations/he/default.json index a2b070b9..8e506b56 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -203,5 +203,10 @@ "posted_by": "פורסם על ידי", "by": "על ידי", "last_reply_by": "תגובה אחרונה מאת", - "showing_all_replies": "מציג את כל התגובות." + "showing_all_replies": "מציג את כל התגובות.", + "x_posts_by_this_user_address": "{{number}} הודעות מכתובת המשתמש הזו", + "1_post_by_this_user_address": "1 הודעה מכתובת המשתמש הזו", + "highlight_posts": "הדגשת הודעות מכתובת המשתמש הזו", + "display_name_too_long": "שם התצוגה ארוך מדי", + "title_too_long": "הכותרת ארוכה מדי" } \ No newline at end of file diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index b6a792cf..ee27124a 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -203,5 +203,10 @@ "posted_by": "द्वारा लिखित", "by": "द्वारा", "last_reply_by": "अंतिम उत्तर दिया गया है", - "showing_all_replies": "सभी उत्तर दिखा रहा है।" + "showing_all_replies": "सभी उत्तर दिखा रहा है।", + "x_posts_by_this_user_address": "इस उपयोगकर्ता पते से {{number}} पोस्ट", + "1_post_by_this_user_address": "इस उपयोगकर्ता पते से 1 पोस्ट", + "highlight_posts": "इस उपयोगकर्ता पते से पोस्ट्स को हाइलाइट करें", + "display_name_too_long": "प्रदर्शन नाम बहुत लंबा है", + "title_too_long": "शीर्षक बहुत लंबा है" } \ No newline at end of file diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index a5250c72..651a3557 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -203,5 +203,10 @@ "posted_by": "Írta", "by": "által", "last_reply_by": "Utolsó válasz írta", - "showing_all_replies": "Az összes válasz megjelenítése." + "showing_all_replies": "Az összes válasz megjelenítése.", + "x_posts_by_this_user_address": "{{number}} bejegyzés ebből a felhasználói címből", + "1_post_by_this_user_address": "1 bejegyzés ebből a felhasználói címből", + "highlight_posts": "Kiemelt bejegyzések ebből a felhasználói címből", + "display_name_too_long": "a megjelenített név túl hosszú", + "title_too_long": "a cím túl hosszú" } \ No newline at end of file diff --git a/public/translations/id/default.json b/public/translations/id/default.json index 9c63471d..ae421bbe 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -203,5 +203,10 @@ "posted_by": "Diposting oleh", "by": "oleh", "last_reply_by": "Balasan terakhir oleh", - "showing_all_replies": "Menampilkan semua balasan." + "showing_all_replies": "Menampilkan semua balasan.", + "x_posts_by_this_user_address": "{{number}} posting dari alamat pengguna ini", + "1_post_by_this_user_address": "1 posting dari alamat pengguna ini", + "highlight_posts": "Sorot posting dari alamat pengguna ini", + "display_name_too_long": "nama tampilan terlalu panjang", + "title_too_long": "judul terlalu panjang" } \ No newline at end of file diff --git a/public/translations/it/default.json b/public/translations/it/default.json index 89fb6abe..9344a06e 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -203,5 +203,10 @@ "posted_by": "Pubblicato da", "by": "da", "last_reply_by": "Ultima risposta da", - "showing_all_replies": "Mostrando tutte le risposte." + "showing_all_replies": "Mostrando tutte le risposte.", + "x_posts_by_this_user_address": "{{number}} post da questo indirizzo di utente", + "1_post_by_this_user_address": "1 post da questo indirizzo di utente", + "highlight_posts": "Evidenziare i post da questo indirizzo di utente", + "display_name_too_long": "nome visualizzato troppo lungo", + "title_too_long": "titolo troppo lungo" } \ No newline at end of file diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index 7d7b8654..92ab239f 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -203,5 +203,10 @@ "posted_by": "投稿者", "by": "によって", "last_reply_by": "最後の返信者", - "showing_all_replies": "すべての返信を表示しています。" + "showing_all_replies": "すべての返信を表示しています。", + "x_posts_by_this_user_address": "このユーザーアドレスからの投稿数:{{number}}", + "1_post_by_this_user_address": "このユーザーアドレスからの1件の投稿", + "highlight_posts": "このユーザーアドレスによる投稿を強調表示する", + "display_name_too_long": "表示名が長すぎます", + "title_too_long": "タイトルが長すぎます" } \ No newline at end of file diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index 380ea33f..e12edd73 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -203,5 +203,10 @@ "posted_by": "작성자", "by": "작성자:", "last_reply_by": "마지막 답글 작성자:", - "showing_all_replies": "모든 답글을 표시합니다." + "showing_all_replies": "모든 답글을 표시합니다.", + "x_posts_by_this_user_address": "이 사용자 주소로부터 {{number}}개의 게시물", + "1_post_by_this_user_address": "이 사용자 주소로부터 1개의 게시물", + "highlight_posts": "이 사용자 주소의 게시물 강조 표시", + "display_name_too_long": "표시 이름이 너무 깁니다", + "title_too_long": "제목이 너무 깁니다" } \ No newline at end of file diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index 227adb3d..bc2291f6 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -203,5 +203,10 @@ "posted_by": "ने टप्पल केला", "by": "व्यक्ती", "last_reply_by": "शेवटचा प्रतिसाद व्यक्ती", - "showing_all_replies": "सर्व प्रतिसाद दाखवत आहे." + "showing_all_replies": "सर्व प्रतिसाद दाखवत आहे.", + "x_posts_by_this_user_address": "या वापरकर्त्याचे {{number}} पोस्ट्स", + "1_post_by_this_user_address": "या वापरकर्त्याची 1 पोस्ट", + "highlight_posts": "या वापरकर्त्याच्या पत्त्यापासून पोस्ट्स हायलाइट करा", + "display_name_too_long": "डिस्प्ले नाम खूप लांब आहे", + "title_too_long": "शीर्षक खूप लांब आहे" } \ No newline at end of file diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index 840b56b7..d0e48fc2 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -203,5 +203,10 @@ "posted_by": "Geplaatst door", "by": "door", "last_reply_by": "Laatste reactie door", - "showing_all_replies": "Alle antwoorden weergeven." + "showing_all_replies": "Alle antwoorden weergeven.", + "x_posts_by_this_user_address": "{{number}} berichten van dit gebruikersadres", + "1_post_by_this_user_address": "1 bericht van dit gebruikersadres", + "highlight_posts": "Berichten van dit gebruikersadres markeren", + "display_name_too_long": "weergavenaam te lang", + "title_too_long": "titel te lang" } \ No newline at end of file diff --git a/public/translations/no/default.json b/public/translations/no/default.json index 391da8e1..1da1387e 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -203,5 +203,10 @@ "posted_by": "Skrevet av", "by": "av", "last_reply_by": "Siste svar fra", - "showing_all_replies": "Viser alle svar." + "showing_all_replies": "Viser alle svar.", + "x_posts_by_this_user_address": "{{number}} innlegg fra denne brukeradressen", + "1_post_by_this_user_address": "1 innlegg fra denne brukeradressen", + "highlight_posts": "Fremhev innlegg fra denne brukeradressen", + "display_name_too_long": "visningsnavn for langt", + "title_too_long": "tittel for lang" } \ No newline at end of file diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index 9a7005f9..76c796cc 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -203,5 +203,10 @@ "posted_by": "Opublikowane przez", "by": "przez", "last_reply_by": "Ostatnia odpowiedź od", - "showing_all_replies": "Wyświetlanie wszystkich odpowiedzi." + "showing_all_replies": "Wyświetlanie wszystkich odpowiedzi.", + "x_posts_by_this_user_address": "{{number}} postów z tego adresu użytkownika", + "1_post_by_this_user_address": "1 post z tego adresu użytkownika", + "highlight_posts": "Wyróżnij posty z tego adresu użytkownika", + "display_name_too_long": "nazwa wyświetlana jest zbyt długa", + "title_too_long": "tytuł jest zbyt długi" } \ No newline at end of file diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index e370ce5e..2e7b8908 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -203,5 +203,10 @@ "posted_by": "Postado por", "by": "por", "last_reply_by": "Última resposta por", - "showing_all_replies": "Mostrando todas as respostas." + "showing_all_replies": "Mostrando todas as respostas.", + "x_posts_by_this_user_address": "{{number}} postagens deste endereço de usuário", + "1_post_by_this_user_address": "1 postagem deste endereço de usuário", + "highlight_posts": "Destacar postagens deste endereço de usuário", + "display_name_too_long": "nome de exibição muito longo", + "title_too_long": "título muito longo" } \ No newline at end of file diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index 3918f135..906b0f8c 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -203,5 +203,10 @@ "posted_by": "Postat de", "by": "de către", "last_reply_by": "Ultima răspuns de la", - "showing_all_replies": "Afișare toate răspunsurile." + "showing_all_replies": "Afișare toate răspunsurile.", + "x_posts_by_this_user_address": "{{number}} mesaje de la această adresă de utilizator", + "1_post_by_this_user_address": "1 mesaj de la această adresă de utilizator", + "highlight_posts": "Evidențiați mesajele de la această adresă de utilizator", + "display_name_too_long": "numele afișat este prea lung", + "title_too_long": "titlul este prea lung" } \ No newline at end of file diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index cb7b55db..e00f567f 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -203,5 +203,10 @@ "posted_by": "Опубликовано", "by": "от", "last_reply_by": "Последний ответ от", - "showing_all_replies": "Показываются все ответы." + "showing_all_replies": "Показываются все ответы.", + "x_posts_by_this_user_address": "{{number}} сообщений с этого адреса пользователя", + "1_post_by_this_user_address": "1 сообщение с этого адреса пользователя", + "highlight_posts": "Выделить сообщения с этого адреса пользователя", + "display_name_too_long": "отображаемое имя слишком длинное", + "title_too_long": "заголовок слишком длинный" } \ No newline at end of file diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index 89499c2c..1d51b708 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -203,5 +203,10 @@ "posted_by": "Postuar nga", "by": "nga", "last_reply_by": "Përgjigje e fundit nga", - "showing_all_replies": "Duke treguar të gjitha përgjigjet." + "showing_all_replies": "Duke treguar të gjitha përgjigjet.", + "x_posts_by_this_user_address": "{{number}} postime nga ky adresa e përdoruesit", + "1_post_by_this_user_address": "1 postim nga ky adresa e përdoruesit", + "highlight_posts": "Shëno postime nga ky adresa e përdoruesit", + "display_name_too_long": "emri i shfaqur është shumë i gjatë", + "title_too_long": "titulli shumë i gjatë" } \ No newline at end of file diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index d8a294a9..39e56524 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -203,5 +203,10 @@ "posted_by": "Postat av", "by": "av", "last_reply_by": "Senaste svar av", - "showing_all_replies": "Visar alla svar." + "showing_all_replies": "Visar alla svar.", + "x_posts_by_this_user_address": "{{number}} inlägg från denna användaradress", + "1_post_by_this_user_address": "1 inlägg från denna användaradress", + "highlight_posts": "Markera inlägg från denna användaradress", + "display_name_too_long": "visningsnamn för långt", + "title_too_long": "titel för långt" } \ No newline at end of file diff --git a/public/translations/te/default.json b/public/translations/te/default.json index b20d39b8..59adf675 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -203,5 +203,10 @@ "posted_by": "పోస్ట్ చేసినవాడు", "by": "ద్వారా", "last_reply_by": "చివరి సమాధానం ఇచ్చింది", - "showing_all_replies": "అన్ని సమాధానాలను చూపుతుంది." + "showing_all_replies": "అన్ని సమాధానాలను చూపుతుంది.", + "x_posts_by_this_user_address": "ఈ వాడుకరి చిరునామ నుండి {{number}} పోస్టులు", + "1_post_by_this_user_address": "ఈ వాడుకరి చిరునామ నుండి 1 పోస్టు", + "highlight_posts": "ఈ వాడుకరి చిరునామ నుండి పోస్టులను హైలైట్ చేయండి", + "display_name_too_long": "ప్రదర్శన పేరు చాలా నీటిగా ఉంది", + "title_too_long": "శీర్షిక చాలా పొడవుగా ఉంది" } \ No newline at end of file diff --git a/public/translations/th/default.json b/public/translations/th/default.json index 1ad41cda..812ef895 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -203,5 +203,10 @@ "posted_by": "โพสต์โดย", "by": "โดย", "last_reply_by": "การตอบคำถามล่าสุดโดย", - "showing_all_replies": "กำลังแสดงคำตอบทั้งหมด" + "showing_all_replies": "กำลังแสดงคำตอบทั้งหมด", + "x_posts_by_this_user_address": "{{number}} โพสต์โดยที่อยู่ผู้ใช้นี้", + "1_post_by_this_user_address": "1 โพสต์โดยที่อยู่ผู้ใช้นี้", + "highlight_posts": "เน้นโพสต์โดยที่อยู่ผู้ใช้นี้", + "display_name_too_long": "ชื่อที่แสดงนามสกุลยาวเกินไป", + "title_too_long": "ชื่อเรื่องยาวเกินไป" } \ No newline at end of file diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index f948010c..ca345a46 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -203,5 +203,10 @@ "posted_by": "Tarafından gönderildi", "by": "tarafından", "last_reply_by": "Son cevap", - "showing_all_replies": "Tüm yanıtlar gösteriliyor." + "showing_all_replies": "Tüm yanıtlar gösteriliyor.", + "x_posts_by_this_user_address": "Bu kullanıcı adresinden {{number}} gönderi", + "1_post_by_this_user_address": "Bu kullanıcı adresinden 1 gönderi", + "highlight_posts": "Bu kullanıcı adresinden gelen gönderileri vurgula", + "display_name_too_long": "görünen adı çok uzun", + "title_too_long": "başlık çok uzun" } \ No newline at end of file diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index 29acc103..e9e318a9 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -203,5 +203,10 @@ "posted_by": "Опубліковано", "by": "від", "last_reply_by": "Остання відповідь від", - "showing_all_replies": "Показуються всі відповіді." + "showing_all_replies": "Показуються всі відповіді.", + "x_posts_by_this_user_address": "{{number}} повідомлень з цієї адреси користувача", + "1_post_by_this_user_address": "1 повідомлення з цієї адреси користувача", + "highlight_posts": "Виділити повідомлення з цієї адреси користувача", + "display_name_too_long": "ім'я відображається занадто довге", + "title_too_long": "заголовок відображається занадто довгий" } \ No newline at end of file diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index ba91ed20..0e938893 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -203,5 +203,10 @@ "posted_by": "پوسٹ کیا گیا", "by": "کے ذریعے", "last_reply_by": "آخری جواب دیا گیا", - "showing_all_replies": "تمام جوابات دکھا رہا ہے۔" + "showing_all_replies": "تمام جوابات دکھا رہا ہے۔", + "x_posts_by_this_user_address": "اس صارف ایڈریس کے {{number}} پوسٹس", + "1_post_by_this_user_address": "1 پوسٹ اس صارف ایڈریس کے", + "highlight_posts": "اس صارف ایڈریس کے ذریعے پوسٹس کو ہائی لائٹ کریں", + "display_name_too_long": "ڈسپلے نام بہت لمبا ہے", + "title_too_long": "عنوان بہت لمبا ہے" } \ No newline at end of file diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index 0f7167f3..d21eb671 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -203,5 +203,10 @@ "posted_by": "Được đăng bởi", "by": "bởi", "last_reply_by": "Trả lời cuối cùng bởi", - "showing_all_replies": "Đang hiển thị tất cả các phản hồi." + "showing_all_replies": "Đang hiển thị tất cả các phản hồi.", + "x_posts_by_this_user_address": "{{number}} bài đăng từ địa chỉ người dùng này", + "1_post_by_this_user_address": "1 bài đăng từ địa chỉ người dùng này", + "highlight_posts": "Đánh dấu bài đăng từ địa chỉ người dùng này", + "display_name_too_long": "tên hiển thị quá dài", + "title_too_long": "tiêu đề quá dài" } \ No newline at end of file diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index cc1e61b0..f7764168 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -203,5 +203,10 @@ "posted_by": "由...发布", "by": "由...发布", "last_reply_by": "最后回复者", - "showing_all_replies": "显示所有回复。" + "showing_all_replies": "显示所有回复。", + "x_posts_by_this_user_address": "此用户地址的{{number}}篇帖子", + "1_post_by_this_user_address": "此用户地址的1篇帖子", + "highlight_posts": "突出显示此用户地址的帖子", + "display_name_too_long": "显示名称太长", + "title_too_long": "标题太长" } \ No newline at end of file diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 92fa6ebc..cfe4222d 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -72,7 +72,7 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: ) : ( {title.slice(0, 75) + '(...)'} } - content={title.length < 1000 ? title : title.slice(0, 1000) + '... title too long'} + content={title.length < 1000 ? title : title.slice(0, 1000) + `... ${t('title_too_long')}`} /> ))} @@ -83,7 +83,7 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: ) : ( {displayName.slice(0, 20) + '(...)'}} - content={displayName.length < 1000 ? displayName : displayName.slice(0, 1000) + '... display name too long'} + content={displayName.length < 1000 ? displayName : displayName.slice(0, 1000) + `... ${t('display_name_too_long')}`} /> ) ) : ( @@ -96,15 +96,11 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: (u/ handleUserAddressClick(shortAddress || accountShortAddress, postCid)} - > + handleUserAddressClick(shortAddress || accountShortAddress, postCid)}> {shortAddress || accountShortAddress} } - content={`${numberOfPostsByAuthor} ${numberOfPostsByAuthor === 1 ? 'post' : 'posts'} by this user address`} + content={`${numberOfPostsByAuthor === 1 ? t('1_post_by_this_user_address') : t('x_posts_by_this_user_address', { number: numberOfPostsByAuthor })}`} showTooltip={isInPostPageView || showOmittedReplies || postReplyCount < 6} /> ){' '} diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 2d6adb62..5bdf18eb 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -63,7 +63,7 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P ) : ( {displayName.slice(0, 20) + '(...)'}} - content={displayName.length < 1000 ? displayName : displayName.slice(0, 1000) + '... display name too long'} + content={displayName.length < 1000 ? displayName : displayName.slice(0, 1000) + `... ${t('display_name_too_long')}`} /> ) ) : ( @@ -76,15 +76,11 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P (u/ handleUserAddressClick(shortAddress || accountShortAddress, postCid)} - > + handleUserAddressClick(shortAddress || accountShortAddress, postCid)}> {shortAddress || accountShortAddress} } - content={`${numberOfPostsByAuthor} ${numberOfPostsByAuthor === 1 ? 'post' : 'posts'} by this user address`} + content={`${numberOfPostsByAuthor === 1 ? t('1_post_by_this_user_address') : t('x_posts_by_this_user_address', { number: numberOfPostsByAuthor })}`} showTooltip={isInPostPageView || postReplyCount < 6} /> ){' '} @@ -106,7 +102,7 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P ) : ( {title.slice(0, 30) + '(...)'}} - content={title.length < 1000 ? title : title.slice(0, 1000) + '... title too long'} + content={title.length < 1000 ? title : title.slice(0, 1000) + `... ${t('title_too_long')}`} /> ))} From 38e1c7865417943329956e960a33b4fd50315692 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Mon, 1 Jul 2024 19:00:54 +0200 Subject: [PATCH 10/13] fix(catalog post): floating post preview was not visible on mobile --- src/components/catalog-row/catalog-row.tsx | 49 ++++++++++++---------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/src/components/catalog-row/catalog-row.tsx b/src/components/catalog-row/catalog-row.tsx index ccbc0878..f312d14b 100644 --- a/src/components/catalog-row/catalog-row.tsx +++ b/src/components/catalog-row/catalog-row.tsx @@ -16,6 +16,7 @@ import PostMenuDesktop from '../post-desktop/post-menu-desktop'; import styles from './catalog-row.module.css'; import Markdown from '../markdown'; import _ from 'lodash'; +import useWindowWidth from '../../hooks/use-window-width'; interface CatalogPostMediaProps { commentMediaInfo: any; @@ -133,9 +134,10 @@ const CatalogPost = ({ post }: { post: Comment }) => { const [hoveredCid, setHoveredCid] = useState(null); const [showPortal, setShowPortal] = useState(false); const placementRef = useRef('right-start'); - const availableWidthRef = useRef(0); const timeoutRef = useRef(null); + const windowWidth = useWindowWidth(); + const { refs, floatingStyles, update } = useFloating({ open: showPortal, placement: placementRef.current, @@ -143,12 +145,26 @@ const CatalogPost = ({ post }: { post: Comment }) => { shift({ padding: 10 }), offset({ mainAxis: 5 }), size({ - apply({ availableWidth, elements }) { - availableWidthRef.current = availableWidth; - if (availableWidth >= 250) { - elements.floating.style.maxWidth = `${availableWidth - 12}px`; - } else if (placementRef.current === 'right-start') { - placementRef.current = 'left-start'; + apply({ elements }) { + const referenceElement = refs.reference.current; + if (referenceElement) { + const availableWidthToTheRight = windowWidth - (referenceElement.getBoundingClientRect().left + referenceElement.getBoundingClientRect().width); + const availableWidthToTheLeft = referenceElement.getBoundingClientRect().left; + const minWidth = windowWidth * 0.25; + + if (availableWidthToTheRight >= minWidth) { + placementRef.current = 'right-start'; + elements.floating.style.maxWidth = `${availableWidthToTheRight - 40}px`; + } else if (availableWidthToTheLeft >= minWidth) { + placementRef.current = 'left-start'; + elements.floating.style.maxWidth = `${availableWidthToTheLeft - 25}px`; + } else if (availableWidthToTheRight > availableWidthToTheLeft) { + placementRef.current = 'right-start'; + elements.floating.style.maxWidth = `${availableWidthToTheRight - 40}px`; + } else { + placementRef.current = 'left-start'; + elements.floating.style.maxWidth = `${availableWidthToTheLeft - 25}px`; + } } }, }), @@ -157,21 +173,8 @@ const CatalogPost = ({ post }: { post: Comment }) => { }); useEffect(() => { - const handleResize = () => { - const availableWidth = availableWidthRef.current; - if (availableWidth >= 250) { - placementRef.current = 'right-start'; - } else { - placementRef.current = 'left-start'; - } - update(); - }; - - window.addEventListener('resize', handleResize); - return () => { - window.removeEventListener('resize', handleResize); - }; - }, [update]); + update(); + }, [update, windowWidth]); const lastReply = useComment({ commentCid: lastChildCid }); @@ -248,7 +251,7 @@ const CatalogPost = ({ post }: { post: Comment }) => { {(showOPComment || isTextOnlyThread) && (hasThumbnail ? postContent : {postContent})}
- {hoveredCid === cid && + {(hoveredCid === cid || isDescription) && showPortal && createPortal(
From 60d7af174402d087ad636468be9af2fa7a7c1ce4 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Tue, 2 Jul 2024 08:55:55 +0200 Subject: [PATCH 11/13] Update post-desktop.tsx --- src/components/post-desktop/post-desktop.tsx | 24 ++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index cfe4222d..172f4a4a 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -27,13 +27,19 @@ import { create } from 'zustand'; import _ from 'lodash'; interface ShowOmittedRepliesState { - showOmittedReplies: boolean; - setShowOmittedReplies: (showOmittedReplies: boolean) => void; + showOmittedReplies: Record; + setShowOmittedReplies: (cid: string, showOmittedReplies: boolean) => void; } const useShowOmittedReplies = create((set) => ({ - showOmittedReplies: false, - setShowOmittedReplies: (showOmittedReplies: boolean) => set({ showOmittedReplies }), + showOmittedReplies: {}, + setShowOmittedReplies: (cid, showOmittedReplies) => + set((state) => ({ + showOmittedReplies: { + ...state.showOmittedReplies, + [cid]: showOmittedReplies, + }, + })), })); const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: PostProps) => { @@ -101,7 +107,7 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: } content={`${numberOfPostsByAuthor === 1 ? t('1_post_by_this_user_address') : t('x_posts_by_this_user_address', { number: numberOfPostsByAuthor })}`} - showTooltip={isInPostPageView || showOmittedReplies || postReplyCount < 6} + showTooltip={isInPostPageView || showOmittedReplies[postCid] || postReplyCount < 6} /> ){' '} @@ -368,10 +374,10 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies {!isHidden && !isDescription && !isRules && !isInPendingPostView && (replies.length > 5 || (pinned && replies.length > 0)) && !isInPostPageView && ( setShowOmittedReplies(!showOmittedReplies)} + className={`${showOmittedReplies[cid] ? styles.hideOmittedReplies : styles.showOmittedReplies} ${styles.omittedRepliesButtonWrapper}`} + onClick={() => setShowOmittedReplies(cid, !showOmittedReplies[cid])} /> - {showOmittedReplies ? ( + {showOmittedReplies[cid] ? ( t('showing_all_replies') ) : linksCount > 0 ? ( ( + (showAllReplies || showOmittedReplies[cid] ? replies : replies.slice(-5)).map((reply, index) => (
(replyRefs.current[index] = el)}>
From 3730e4b4c1d872d80f816dfc3cc93e0a8be70f58 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Tue, 2 Jul 2024 09:08:24 +0200 Subject: [PATCH 12/13] Update post-desktop.tsx --- src/components/post-desktop/post-desktop.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 172f4a4a..9747c2c1 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -85,10 +85,10 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: {displayName ? ( displayName.length <= 20 ? ( - {displayName} + displayName ) : ( {displayName.slice(0, 20) + '(...)'}} + children={displayName.slice(0, 20) + '(...)'} content={displayName.length < 1000 ? displayName : displayName.slice(0, 1000) + `... ${t('display_name_too_long')}`} /> ) @@ -392,7 +392,7 @@ const PostDesktop = ({ openReplyModal, post, roles, showAllReplies, showReplies
)} {!isHidden && - !(pinned && !isInPostPageView) && + !(pinned && !isInPostPageView && !showOmittedReplies[cid]) && !isInPendingPostView && !isDescription && !isRules && From 66cc23c404f158c839bc1382aab2f0db3181a78a Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Tue, 2 Jul 2024 13:32:50 +0200 Subject: [PATCH 13/13] feat: add FAQ page --- package.json | 1 + src/app.tsx | 5 +- src/components/post-desktop/post-desktop.tsx | 2 +- src/modules.d.ts | 2 + src/views/faq/faq.module.css | 123 ++++++++++++++++ src/views/faq/faq.tsx | 145 +++++++++++++++++++ src/views/faq/index.ts | 1 + src/views/home/home.tsx | 12 +- src/views/home/index.ts | 2 +- yarn.lock | 9 +- 10 files changed, 288 insertions(+), 14 deletions(-) create mode 100644 src/views/faq/faq.module.css create mode 100644 src/views/faq/faq.tsx create mode 100644 src/views/faq/index.ts diff --git a/package.json b/package.json index db435258..2ec62b61 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "react-i18next": "13.2.2", "react-markdown": "8.0.6", "react-router-dom": "6.16.0", + "react-router-hash-link": "2.4.3", "react-scripts": "5.0.1", "react-virtuoso": "4.7.8", "rehype-sanitize": "5.0.1", diff --git a/src/app.tsx b/src/app.tsx index d735a1a1..599aa91f 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -5,6 +5,7 @@ import useIsMobile from './hooks/use-is-mobile'; import styles from './app.module.css'; import Board from './views/board'; import Catalog from './views/catalog'; +import FAQ from './views/faq'; import Home from './views/home'; import NotFound from './views/not-found'; import PendingPost from './views/pending-post'; @@ -81,6 +82,9 @@ const App = () => { }> } /> + } /> + } /> + }> } /> } /> @@ -108,7 +112,6 @@ const App = () => { } /> } /> - } />
diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 9747c2c1..73635faa 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -107,7 +107,7 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: } content={`${numberOfPostsByAuthor === 1 ? t('1_post_by_this_user_address') : t('x_posts_by_this_user_address', { number: numberOfPostsByAuthor })}`} - showTooltip={isInPostPageView || showOmittedReplies[postCid] || postReplyCount < 6} + showTooltip={isInPostPageView || showOmittedReplies[postCid] || (postReplyCount < 6 && !pinned)} /> ){' '} diff --git a/src/modules.d.ts b/src/modules.d.ts index 0bfc6acd..9d2f2b5d 100644 --- a/src/modules.d.ts +++ b/src/modules.d.ts @@ -8,3 +8,5 @@ declare module 'ext-name'; declare module 'lodash'; declare module 'react-draggable'; + +declare module 'react-router-hash-link'; diff --git a/src/views/faq/faq.module.css b/src/views/faq/faq.module.css new file mode 100644 index 00000000..fa6ce7d3 --- /dev/null +++ b/src/views/faq/faq.module.css @@ -0,0 +1,123 @@ +.content { + width: 100%; + height: 100%; + margin: auto; + text-align: left; + width: 750px; + min-width: 750px; +} + +.box { + position: relative; + margin-bottom: 0.5em; + padding-bottom: 0.5em; + border: 1px solid var(--homepage-box-border-color); +} + +.boxBar { + padding-left: 0.5em; + line-height: 2em; + text-transform: capitalize; +} + +.boxBar h2 { + font-size: 131%; + font-weight: 700; +} + +.boxContent { + line-height: 1.5em; + font-size: 93%; + padding: 0.5em; + padding-top: 0.25em; + padding-bottom: 0; + line-height: 1.5em; + color: #000; +} + +.infoBox { + background: var(--homepage-box-background-color); + color: var(--homepage-infobox-text-color); +} + +.infoBox .boxBar { + background: var(--homepage-box-bar-background-color); + color: var(--homepage-box-bar-text-color); +} + +.leftBox { + float: left; + width: 49.1%; + background: #efe; + color: #060; +} + +.leftBox .boxBar { + background: #9c6; + color: #060; +} + +.rightBox { + float: right; + width: 49.1%; + background: #eff; + color: #006; +} + +.rightBox .boxBar { + background: #59a; + color: #fff; +} + +.list { + margin: 1em; + margin-left: 4em; +} + +.list ul { + margin-left: 1em; + margin-bottom: .5em; +} + +.box ul li { + list-style: disc outside; +} + +.leftBox a:visited { + color: #00e; + text-decoration: underline; +} + +.rightBox dl { + margin: 1em; +} + +.rightBox .first { + padding-top: 0; +} + +.rightBox dt { + padding-top: 1em; + margin-bottom: .5em; + font-weight: 700; + color: #006; +} + +.rightBox dd { + margin-left: 1em; + padding-bottom: 1.5em; + border-bottom: solid #006 1px; +} + +@media (max-width: 640px) { + .content { + min-width: 0; + width: auto; + padding: 10px; + } + + .rightBox, .leftBox { + float: none; + width: auto; + } +} \ No newline at end of file diff --git a/src/views/faq/faq.tsx b/src/views/faq/faq.tsx new file mode 100644 index 00000000..fa7c09e2 --- /dev/null +++ b/src/views/faq/faq.tsx @@ -0,0 +1,145 @@ +import { HashLink } from 'react-router-hash-link'; +import { Footer, HomeLogo } from '../home'; +import styles from './faq.module.css'; + +const FAQ = () => { + return ( +
+
+ +
+
+

Frequently Asked Questions

+
+
+ Welcome to Plebchan's Frequently Asked Questions page. Please remember that Plebchan does not have + global admins or rules. +
+
+
+
+
+

Questions

+
+
+
    +
  • + + Basics + +
      +
    • + What is Plebchan? +
    • +
        +
      • + How do I access the boards? +
      • +
      +
    • + What should I know before I post? +
    • +
        +
      • + How do I post anonymously? +
      • +
      • + Can I register a username? +
      • +
      • + How do I post an image? +
      • +
      • + Can I upload an image? +
      • +
      • + Must I post an image? +
      • +
      • + Can I reply with an image? +
      • +
      +
    +
  • +
+
+
+
+
+

Basics

+
+
+
+
+ What is Plebchan? +
+
+ Plebchan is a serverless, adminless, decentralized 4chan alternative where any pleb can create and own unlimited boards. All data comes from the Plebbit + protocol, it's all text including links from which media is embedded, shared peer-to-peer. Users do not need to register an account before participating + in the community. +
+
How do I access the boards?
+
+ Anyone can access any board at a any time by simply knowing its address. Paste it in the search box, located in the homepage or at the top of the board + pages. Hit enter, and you will connect peer-to-peer to the board owner. Each board is completely independent and moderates itself, the board admin has + full ownership of their board. +
+
What should I know before I post?
+
+ Whatever community you decide to post to, please remember to read the rules and guidelines of that board. Each board is independent and has its own + rules and guidelines. If you are unsure about the rules, you should try to ask the board owner or the community. +
+
How do I post anonymously?
+
+ To post as "Anonymous", simply do not fill in the [Name] field when submitting content. Plebchan uses the Plebbit protocol to function, which does not + leak IP addresses of people who post. This means that when you post on Plebchan, no board admin can know your IP address, nor can the app itself. + However, the Plebbit protocol is not fully anonymous, it uses IPFS, which means your IP address is part of a public P2P swarm, similarly to BitTorrent. +
+
Can I register a username?
+
+ You already have one, it's automatically generated by the app and you can find it in the settings. It's the address of your generated account file, and + you can change it to something readable (e.g., "myname.eth") by purchasing a crypto domain like ENS (Ethereum Name Service) and resolving your account + address with it. +
+
+ By default, Anon Mode is enabled in the settings, which automatically generates and enables a new username per thread you visit. These anon mode + usernames stem from the currently active account file, which you can backup. +
+
How do I post an image?
+
+ You need a link to the image, ideally using an image hosting service, like Imgur. Paste the link to the image in the [Link] field when submitting + content. Plebchan will attempt to load the media from the link and show its type next to the [Link] field. If the link type is "webpage", the link is + not an image, and you should try another link. +
+
+ You can also post videos, audios and gifs by pasting their direct links. Plebchan also supports the following websites to embed media without a direct + link: YouTube, Twitter/X, Reddit, Twitch, TikTok, Instagram, Odysee, Bitchute, Streamable, Spotify and Soundcloud. +
+
Can I upload an image?
+
+ No, because Plebchan is a client for the Plebbit protocol, which is text-only (including links, from which media is embedded by clients). However, + Plebbit uses IPFS, so in theory Plebchan could upload media to IPFS, and then post the direct IPFS link for the media. This is not enabled on Plebchan + because loading media from IPFS is extremely slow, at the moment (because most people have slow internet). +
+
Must I post an image?
+
+ It depends on the board. Each board has its own rules, and a board owner might decide to only allow posts with images in their community. Plebchan + automatically filters out text-only threads in the catalog view, and you can disable this in the [Filters] menu. +
+
Can I reply with an image?
+
+ Yes. To reply to a thread with an image of your own, fill in the post box as you normally would, making sure to specify a direct image link (e.g., + ending in .png or .jpeg) in the "Link" field. Plebchan will attempt to load the image, and if it worked it will show the Link type as "image", next to + the field, before posting. If the Link type is "webpage", the link is not an image, and you should try another link. +
+
+
+
+
+
+
+
+ ); +}; + +export default FAQ; diff --git a/src/views/faq/index.ts b/src/views/faq/index.ts new file mode 100644 index 00000000..bed122e8 --- /dev/null +++ b/src/views/faq/index.ts @@ -0,0 +1 @@ +export { default } from './faq'; diff --git a/src/views/home/home.tsx b/src/views/home/home.tsx index fc99129b..1dc481b7 100644 --- a/src/views/home/home.tsx +++ b/src/views/home/home.tsx @@ -133,7 +133,7 @@ const downloadAppLink = (() => { const isElectron = window.isElectron === true; const commitRef = process.env.REACT_APP_COMMIT_REF; -const Footer = () => { +export const Footer = () => { const { t } = useTranslation(); return ( <> @@ -151,15 +151,7 @@ const Footer = () => { )}
  • - { - e.preventDefault(); - alert('work in progress'); - }} - > - FAQ - + FAQ
  • diff --git a/src/views/home/index.ts b/src/views/home/index.ts index 1b862780..101c8830 100644 --- a/src/views/home/index.ts +++ b/src/views/home/index.ts @@ -1 +1 @@ -export { HomeLogo, default } from './home'; +export { HomeLogo, Footer, default } from './home'; diff --git a/yarn.lock b/yarn.lock index d3742fe6..746d6bb8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14038,7 +14038,7 @@ prompts@^2.0.1, prompts@^2.3.2, prompts@^2.4.2: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.0.0, prop-types@^15.8.1: +prop-types@^15.0.0, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -14354,6 +14354,13 @@ react-router-dom@6.16.0: "@remix-run/router" "1.9.0" react-router "6.16.0" +react-router-hash-link@^2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/react-router-hash-link/-/react-router-hash-link-2.4.3.tgz#570824d53d6c35ce94d73a46c8e98673a127bf08" + integrity sha512-NU7GWc265m92xh/aYD79Vr1W+zAIXDWp3L2YZOYP4rCqPnJ6LI6vh3+rKgkidtYijozHclaEQTAHaAaMWPVI4A== + dependencies: + prop-types "^15.7.2" + react-router@6.16.0: version "6.16.0" resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.16.0.tgz#abbf3d5bdc9c108c9b822a18be10ee004096fb81"