From 0783374a30315d012aa0fffe76403f3658fbf98e Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Mon, 24 Jun 2024 17:52:41 +0200 Subject: [PATCH 01/10] fix(post): author edit reason was missing --- src/components/post-desktop/post-desktop.tsx | 6 +++--- src/components/post-mobile/post-mobile.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index d4fdcaff..b4ba96c2 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -197,11 +197,11 @@ const PostMessage = ({ post }: PostProps) => { {showOriginal && }
- (Edited at {getFormattedDate(edit?.timestamp)},{' '} + Comment edited at {getFormattedDate(edit?.timestamp)}. {reason && 'Reason: "' + reason + '". '} setShowOriginal(!showOriginal)}> - {showOriginal ? 'hide original' : 'show original'} + Click here - ) + {showOriginal ? ' to hide the original.' : ' to show the original.'}
)} diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 49af16ad..04f8256b 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -154,11 +154,11 @@ const PostMessageMobile = ({ post }: PostProps) => { {showOriginal && }
- (Edited at {getFormattedDate(edit?.timestamp)},{' '} + Comment edited at {getFormattedDate(edit?.timestamp)}. {reason && 'Reason: "' + reason + '". '} setShowOriginal(!showOriginal)}> - {showOriginal ? 'hide original' : 'show original'} + Click here - ) + {showOriginal ? ' to hide the original.' : ' to show the original.'}
)} From a9925209849a120a4ccb8399e589511ee96f449b Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Mon, 24 Jun 2024 17:53:44 +0200 Subject: [PATCH 02/10] style(edit menu): adjust padding --- src/components/edit-menu/edit-menu.module.css | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/edit-menu/edit-menu.module.css b/src/components/edit-menu/edit-menu.module.css index 660a0176..2c7acfdc 100644 --- a/src/components/edit-menu/edit-menu.module.css +++ b/src/components/edit-menu/edit-menu.module.css @@ -90,11 +90,8 @@ @media (max-width: 640px) { .checkbox { + padding-top: 0; padding-left: 0; padding-bottom: 0; } - - .replyCheckbox { - padding-top: 0; - } } \ No newline at end of file From b3bfc7fccc9f90dfd88d51a85629684c5caa58b0 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Mon, 24 Jun 2024 18:26:54 +0200 Subject: [PATCH 03/10] fix(catalog filters): filters changed their opposite value --- src/views/catalog/catalog-filters/catalog-filters.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/catalog/catalog-filters/catalog-filters.tsx b/src/views/catalog/catalog-filters/catalog-filters.tsx index 91e137b5..8169dce2 100644 --- a/src/views/catalog/catalog-filters/catalog-filters.tsx +++ b/src/views/catalog/catalog-filters/catalog-filters.tsx @@ -24,7 +24,7 @@ const FiltersModal = ({ closeModal }: { closeModal: () => void }) => {
{isInCatalogView && ( )} @@ -32,11 +32,11 @@ const FiltersModal = ({ closeModal }: { closeModal: () => void }) => {
NSFW Boards
From 19995ad67079176e57e607a99c1e0b84aa2f28f6 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Mon, 24 Jun 2024 18:31:08 +0200 Subject: [PATCH 04/10] improve translation --- 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/reply-modal/reply-modal.tsx | 2 +- 36 files changed, 71 insertions(+), 36 deletions(-) diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index 01658d6a..699c7a3e 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "عرض لوحات NSFW فقط", "use_catalog": "استخدام الكتالوج", "show_worksafe_boards_only": "عرض لوحات آمنة للعمل فقط", - "show_all_content": "عرض جميع المحتويات" + "show_all_content": "عرض جميع المحتويات", + "link_type": "نوع الرابط" } \ No newline at end of file diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index 7caf99a7..15480aef 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "শুধুমাত্র NSFW বোর্ড দেখান", "use_catalog": "ক্যাটালগ ব্যবহার", "show_worksafe_boards_only": "শুধুমাত্র কাজ-সম্পূর্ণ বোর্ড দেখান", - "show_all_content": "সমস্ত কন্টেন্ট দেখান" + "show_all_content": "সমস্ত কন্টেন্ট দেখান", + "link_type": "লিংক প্রকার" } \ No newline at end of file diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index db1e80ba..1cec4be0 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Zobrazit pouze NSFW desky", "use_catalog": "použít katalog", "show_worksafe_boards_only": "Zobrazit pouze bezpečné pracovní desky", - "show_all_content": "Zobrazit veškerý obsah" + "show_all_content": "Zobrazit veškerý obsah", + "link_type": "Typ odkazu" } \ No newline at end of file diff --git a/public/translations/da/default.json b/public/translations/da/default.json index 91b61d49..5d42443b 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Vis kun NSFW boards", "use_catalog": "brug katalog", "show_worksafe_boards_only": "Vis kun Worksafe boards", - "show_all_content": "Vis alt indhold" + "show_all_content": "Vis alt indhold", + "link_type": "Link type" } \ No newline at end of file diff --git a/public/translations/de/default.json b/public/translations/de/default.json index 10415610..cb89c01b 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Nur NSFW-Boards anzeigen", "use_catalog": "Benutze Katalog", "show_worksafe_boards_only": "Nur sichere Boards anzeigen", - "show_all_content": "Alle Inhalte anzeigen" + "show_all_content": "Alle Inhalte anzeigen", + "link_type": "Linktyp" } \ No newline at end of file diff --git a/public/translations/el/default.json b/public/translations/el/default.json index 8107774a..b90027f5 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Εμφάνιση μόνο NSFW πινάκων", "use_catalog": "χρησιμοποίηση καταλόγου", "show_worksafe_boards_only": "Εμφάνιση μόνο ασφαλών πινάκων εργασίας", - "show_all_content": "Εμφάνιση όλων των περιεχομένων" + "show_all_content": "Εμφάνιση όλων των περιεχομένων", + "link_type": "Τύπος συνδέσμου" } \ No newline at end of file diff --git a/public/translations/en/default.json b/public/translations/en/default.json index f607265b..7ed41f39 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Show NSFW Boards Only", "use_catalog": "use catalog", "show_worksafe_boards_only": "Show Worksafe Boards Only", - "show_all_content": "Show All Content" + "show_all_content": "Show All Content", + "link_type": "Link type" } \ No newline at end of file diff --git a/public/translations/es/default.json b/public/translations/es/default.json index bfcddc4e..05c4b97c 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Mostrar solo tableros NSFW", "use_catalog": "usar catálogo", "show_worksafe_boards_only": "Mostrar solo tableros seguros para el trabajo", - "show_all_content": "Mostrar todo el contenido" + "show_all_content": "Mostrar todo el contenido", + "link_type": "Tipo de enlace" } \ No newline at end of file diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index 287739ca..e14f18ee 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "نمایش تنها بوردهای NSFW", "use_catalog": "استفاده از کاتالوگ", "show_worksafe_boards_only": "نمایش تنها بوردهای ایمن برای کار", - "show_all_content": "نمایش تمام محتوا" + "show_all_content": "نمایش تمام محتوا", + "link_type": "نوع پیوند" } \ No newline at end of file diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index 4e73e738..7936d0f2 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Näytä vain NSFW-laudat", "use_catalog": "käytä luetteloa", "show_worksafe_boards_only": "Näytä vain työturvalliset hallit", - "show_all_content": "Näytä kaikki sisällöt" + "show_all_content": "Näytä kaikki sisällöt", + "link_type": "Linkin tyyppi" } \ No newline at end of file diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index 28dc1e49..42667f4b 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Ipakita lamang ang NSFW na boards", "use_catalog": "gamitin ang catalog", "show_worksafe_boards_only": "Ipakita lamang ang mga Worksafe boards", - "show_all_content": "Ipakita lahat ng nilalaman" + "show_all_content": "Ipakita lahat ng nilalaman", + "link_type": "Uri ng Link" } \ No newline at end of file diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index 76e9f117..6340459c 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Afficher uniquement les boards NSFW", "use_catalog": "utiliser le catalogue", "show_worksafe_boards_only": "Afficher uniquement les tableaux Worksafe", - "show_all_content": "Afficher tout le contenu" + "show_all_content": "Afficher tout le contenu", + "link_type": "Type de lien" } \ No newline at end of file diff --git a/public/translations/he/default.json b/public/translations/he/default.json index 64d08f5a..3ff27b62 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "הצג רק לוחות NSFW", "use_catalog": "השתמש בקטלוג", "show_worksafe_boards_only": "הצג לוחות עבודה בטוחים בלבד", - "show_all_content": "הצג את כל התוכן" + "show_all_content": "הצג את כל התוכן", + "link_type": "סוג קישור" } \ No newline at end of file diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index b1937377..701a263b 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "केवल NSFW बोर्ड्स दिखाएं", "use_catalog": "कैटलॉग का उपयोग करें", "show_worksafe_boards_only": "केवल कामसुरक्षित बोर्ड्स दिखाएं", - "show_all_content": "सभी सामग्री दिखाएं" + "show_all_content": "सभी सामग्री दिखाएं", + "link_type": "लिंक प्रकार" } \ No newline at end of file diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index 8115a529..e3252208 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Csak NSFW táblák mutatása", "use_catalog": "használja a katalógust", "show_worksafe_boards_only": "Csak munkabiztos táblák mutatása", - "show_all_content": "Mutasd az összes tartalmat" + "show_all_content": "Mutasd az összes tartalmat", + "link_type": "Link típusa" } \ No newline at end of file diff --git a/public/translations/id/default.json b/public/translations/id/default.json index f54cf6a0..e9b8274f 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Tampilkan Hanya Board NSFW", "use_catalog": "gunakan katalog", "show_worksafe_boards_only": "Tampilkan Hanya Board Worksafe", - "show_all_content": "Tampilkan Semua Konten" + "show_all_content": "Tampilkan Semua Konten", + "link_type": "Tipe tautan" } \ No newline at end of file diff --git a/public/translations/it/default.json b/public/translations/it/default.json index 976b33ae..df523708 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Mostra solo le board NSFW", "use_catalog": "usa catalogo", "show_worksafe_boards_only": "Mostra solo le board Worksafe", - "show_all_content": "Mostra tutti i contenuti" + "show_all_content": "Mostra tutti i contenuti", + "link_type": "Tipo di link" } \ No newline at end of file diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index e4473623..cdc569a1 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "NSFWボードのみ表示", "use_catalog": "カタログを使用する", "show_worksafe_boards_only": "Worksafeボードのみ表示", - "show_all_content": "すべてのコンテンツを表示" + "show_all_content": "すべてのコンテンツを表示", + "link_type": "リンクの種類" } \ No newline at end of file diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index efac5551..1f6e3a52 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "NSFW 보드만 표시", "use_catalog": "카탈로그 사용", "show_worksafe_boards_only": "작업 안전 보드만 표시", - "show_all_content": "모든 콘텐츠 보기" + "show_all_content": "모든 콘텐츠 보기", + "link_type": "링크 유형" } \ No newline at end of file diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index 587a8adf..e28c143f 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "केवळ NSFW बोर्ड्स दाखवा", "use_catalog": "कॅटलॉग वापरा", "show_worksafe_boards_only": "केवळ कामसुरक्षित बोर्ड्स दाखवा", - "show_all_content": "सर्व सामग्री दाखवा" + "show_all_content": "सर्व सामग्री दाखवा", + "link_type": "लिंक प्रकार" } \ No newline at end of file diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index 904c3309..4c954f19 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Toon alleen NSFW boards", "use_catalog": "gebruik catalogus", "show_worksafe_boards_only": "Toon alleen Worksafe boards", - "show_all_content": "Toon alle inhoud" + "show_all_content": "Toon alle inhoud", + "link_type": "Link type" } \ No newline at end of file diff --git a/public/translations/no/default.json b/public/translations/no/default.json index fa5ccee0..ee0435c2 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Vis kun NSFW boards", "use_catalog": "bruk katalog", "show_worksafe_boards_only": "Vis kun Worksafe boards", - "show_all_content": "Vis allt innhold" + "show_all_content": "Vis allt innhold", + "link_type": "Lenketype" } \ No newline at end of file diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index 30cc417d..ff44cd86 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Pokaż tylko tablice NSFW", "use_catalog": "użyj katalogu", "show_worksafe_boards_only": "Pokaż tylko bezpieczne tablice", - "show_all_content": "Pokaż całą zawartość" + "show_all_content": "Pokaż całą zawartość", + "link_type": "Typ łącza" } \ No newline at end of file diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index ed5384c7..c7ee3f9f 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Mostrar apenas boards NSFW", "use_catalog": "usar catálogo", "show_worksafe_boards_only": "Mostrar apenas boards Worksafe", - "show_all_content": "Mostrar Todo o Conteúdo" + "show_all_content": "Mostrar Todo o Conteúdo", + "link_type": "Tipo de link" } \ No newline at end of file diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index 25825228..6804ca8e 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Afișați doar tablourile NSFW", "use_catalog": "folosește catalogul", "show_worksafe_boards_only": "Afișați doar tablourile Worksafe", - "show_all_content": "Afișați tot conținutul" + "show_all_content": "Afișați tot conținutul", + "link_type": "Tipul linkului" } \ No newline at end of file diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index 9a36865e..dfb7e44d 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Показывать только NSFW доски", "use_catalog": "использовать каталог", "show_worksafe_boards_only": "Показывать только безопасные доски", - "show_all_content": "Показать весь контент" + "show_all_content": "Показать весь контент", + "link_type": "Тип ссылки" } \ No newline at end of file diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index 994e925f..3e65649b 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Shfaq vetëm taulat NSFW", "use_catalog": "përdor katalogun", "show_worksafe_boards_only": "Shfaq vetëm taulat e sigurta të punës", - "show_all_content": "Shfaq të gjitha përmbajtjet" + "show_all_content": "Shfaq të gjitha përmbajtjet", + "link_type": "Lloji i lidhjes" } \ No newline at end of file diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index 65ec292b..3dbdb837 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Visa endast NSFW-styrelser", "use_catalog": "använd katalog", "show_worksafe_boards_only": "Visa endast Worksafe-styrelser", - "show_all_content": "Visa allt innehåll" + "show_all_content": "Visa allt innehåll", + "link_type": "Länktyp" } \ No newline at end of file diff --git a/public/translations/te/default.json b/public/translations/te/default.json index d9ae8516..3c4e2164 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "పనిమాడు బోర్డులను మాత్రమే చూపించు", "use_catalog": "కాటలాగ్ ఉపయోగించు", "show_worksafe_boards_only": "పనిమాడు భద్రపరిచిన బోర్డులను మాత్రమే చూపించు", - "show_all_content": "అన్ని కాంటెంట్ చూపించు" + "show_all_content": "అన్ని కాంటెంట్ చూపించు", + "link_type": "లింక్ రకం" } \ No newline at end of file diff --git a/public/translations/th/default.json b/public/translations/th/default.json index f3c07b41..a6a8cd1f 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "แสดงบอร์ด NSFW เท่านั้น", "use_catalog": "ใช้แคตตาล็อก", "show_worksafe_boards_only": "แสดงบอร์ด Worksafe เท่านั้น", - "show_all_content": "แสดงเนื้อหาทั้งหมด" + "show_all_content": "แสดงเนื้อหาทั้งหมด", + "link_type": "ประเภทลิงก์" } \ No newline at end of file diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index ad1ee355..4c8d6456 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Sadece NSFW Panoları Göster", "use_catalog": "katalog kullan", "show_worksafe_boards_only": "Sadece Worksafe Panoları Göster", - "show_all_content": "Tüm İçeriği Göster" + "show_all_content": "Tüm İçeriği Göster", + "link_type": "Bağlantı türü" } \ No newline at end of file diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index 7c3b1f90..aa7952a9 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Показувати лише NSFW дошки", "use_catalog": "використовуйте каталог", "show_worksafe_boards_only": "Показувати лише безпечні дошки", - "show_all_content": "Показати весь вміст" + "show_all_content": "Показати весь вміст", + "link_type": "Тип посилання" } \ No newline at end of file diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index f3bed83c..f5423019 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "صرف NSFW بورڈز دکھائیں", "use_catalog": "استعمال کیٹالوگ", "show_worksafe_boards_only": "صرف کام سے بچائے گئے بورڈز دکھائیں", - "show_all_content": "تمام مواد دکھائیں" + "show_all_content": "تمام مواد دکھائیں", + "link_type": "لنک کی قسم" } \ No newline at end of file diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index 184e84b8..507d2b9b 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "Chỉ hiển thị bảng NSFW", "use_catalog": "sử dụng danh mục", "show_worksafe_boards_only": "Chỉ hiển thị bảng Worksafe", - "show_all_content": "Hiển thị tất cả nội dung" + "show_all_content": "Hiển thị tất cả nội dung", + "link_type": "Loại liên kết" } \ No newline at end of file diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index 346ee792..9afafdb7 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -193,5 +193,6 @@ "show_nsfw_boards_only": "仅显示NSFW板块", "use_catalog": "使用目录", "show_worksafe_boards_only": "仅显示安全工作板", - "show_all_content": "显示所有内容" + "show_all_content": "显示所有内容", + "link_type": "链接类型" } \ No newline at end of file diff --git a/src/components/reply-modal/reply-modal.tsx b/src/components/reply-modal/reply-modal.tsx index 7884a7c1..48dbd8cc 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -143,7 +143,7 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => {
{url && ( <> - {t('file_type')}: {' '} + {t('link_type')}: {' '} )} From 04edb3cb3475da8bb61c29a640cb1b01e43434d9 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Tue, 25 Jun 2024 22:02:23 +0200 Subject: [PATCH 05/10] 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 | 20 +++++++++++++++----- src/components/post-mobile/post-mobile.tsx | 20 +++++++++++++++----- 37 files changed, 240 insertions(+), 45 deletions(-) diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index 699c7a3e..d94c3256 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -194,5 +194,10 @@ "use_catalog": "استخدام الكتالوج", "show_worksafe_boards_only": "عرض لوحات آمنة للعمل فقط", "show_all_content": "عرض جميع المحتويات", - "link_type": "نوع الرابط" + "link_type": "نوع الرابط", + "comment_edited_at_timestamp": "تم تحرير التعليق في {{timestamp}}.", + "reason_reason": "السبب: \"{{reason}}\".", + "click_here_to_show_original": "<1>انقر هنا لعرض الأصل.", + "click_here_to_hide_original": "<1>انقر هنا لإخفاء الأصل.", + "loading": "جار التحميل" } \ No newline at end of file diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index 15480aef..d2918dcf 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -194,5 +194,10 @@ "use_catalog": "ক্যাটালগ ব্যবহার", "show_worksafe_boards_only": "শুধুমাত্র কাজ-সম্পূর্ণ বোর্ড দেখান", "show_all_content": "সমস্ত কন্টেন্ট দেখান", - "link_type": "লিংক প্রকার" + "link_type": "লিংক প্রকার", + "comment_edited_at_timestamp": "মন্তব্য সম্পাদনা করা হয়েছে {{timestamp}} তারিখে।", + "reason_reason": "কারণ: \"{{reason}}\".", + "click_here_to_show_original": "<1>এখানে ক্লিক করুন অসল দেখানোর জন্য।", + "click_here_to_hide_original": "<1>এখানে ক্লিক করুন অসল লুকাতে।", + "loading": "লোড হচ্ছে" } \ No newline at end of file diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index 1cec4be0..3e997023 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -194,5 +194,10 @@ "use_catalog": "použít katalog", "show_worksafe_boards_only": "Zobrazit pouze bezpečné pracovní desky", "show_all_content": "Zobrazit veškerý obsah", - "link_type": "Typ odkazu" + "link_type": "Typ odkazu", + "comment_edited_at_timestamp": "Komentář byl upraven dne {{timestamp}}.", + "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í" } \ No newline at end of file diff --git a/public/translations/da/default.json b/public/translations/da/default.json index 5d42443b..1aa191bf 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -194,5 +194,10 @@ "use_catalog": "brug katalog", "show_worksafe_boards_only": "Vis kun Worksafe boards", "show_all_content": "Vis alt indhold", - "link_type": "Link type" + "link_type": "Link type", + "comment_edited_at_timestamp": "Kommentaren blev redigeret den {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/de/default.json b/public/translations/de/default.json index cb89c01b..949fae44 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -194,5 +194,10 @@ "use_catalog": "Benutze Katalog", "show_worksafe_boards_only": "Nur sichere Boards anzeigen", "show_all_content": "Alle Inhalte anzeigen", - "link_type": "Linktyp" + "link_type": "Linktyp", + "comment_edited_at_timestamp": "Kommentar bearbeitet am {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/el/default.json b/public/translations/el/default.json index b90027f5..d001b6dd 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -194,5 +194,10 @@ "use_catalog": "χρησιμοποίηση καταλόγου", "show_worksafe_boards_only": "Εμφάνιση μόνο ασφαλών πινάκων εργασίας", "show_all_content": "Εμφάνιση όλων των περιεχομένων", - "link_type": "Τύπος συνδέσμου" + "link_type": "Τύπος συνδέσμου", + "comment_edited_at_timestamp": "Επεξεργασία σχολίου στις {{timestamp}}.", + "reason_reason": "Λόγος: \"{{reason}}\".", + "click_here_to_show_original": "<1>Κάντε κλικ εδώ για να εμφανιστεί το αρχικό.", + "click_here_to_hide_original": "<1>Κάντε κλικ εδώ για να κρύψετε το αρχικό.", + "loading": "Φόρτωση" } \ No newline at end of file diff --git a/public/translations/en/default.json b/public/translations/en/default.json index 7ed41f39..20037068 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -194,5 +194,10 @@ "use_catalog": "use catalog", "show_worksafe_boards_only": "Show Worksafe Boards Only", "show_all_content": "Show All Content", - "link_type": "Link type" + "link_type": "Link type", + "comment_edited_at_timestamp": "Comment edited at {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/es/default.json b/public/translations/es/default.json index 05c4b97c..df435913 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -194,5 +194,10 @@ "use_catalog": "usar catálogo", "show_worksafe_boards_only": "Mostrar solo tableros seguros para el trabajo", "show_all_content": "Mostrar todo el contenido", - "link_type": "Tipo de enlace" + "link_type": "Tipo de enlace", + "comment_edited_at_timestamp": "Comentario editado en {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index e14f18ee..cdac29f1 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -194,5 +194,10 @@ "use_catalog": "استفاده از کاتالوگ", "show_worksafe_boards_only": "نمایش تنها بوردهای ایمن برای کار", "show_all_content": "نمایش تمام محتوا", - "link_type": "نوع پیوند" + "link_type": "نوع پیوند", + "comment_edited_at_timestamp": "ویرایش نظر در {{timestamp}}.", + "reason_reason": "دلیل: \"{{reason}}\".", + "click_here_to_show_original": "<1>برای نمایش اصلی اینجا کلیک کنید.", + "click_here_to_hide_original": "<1>برای پنهان کردن اصل اینجا کلیک کنید.", + "loading": "در حال بارگذاری" } \ No newline at end of file diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index 7936d0f2..9454991b 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -194,5 +194,10 @@ "use_catalog": "käytä luetteloa", "show_worksafe_boards_only": "Näytä vain työturvalliset hallit", "show_all_content": "Näytä kaikki sisällöt", - "link_type": "Linkin tyyppi" + "link_type": "Linkin tyyppi", + "comment_edited_at_timestamp": "Kommentti muokattu {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index 42667f4b..4ada3377 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -194,5 +194,10 @@ "use_catalog": "gamitin ang catalog", "show_worksafe_boards_only": "Ipakita lamang ang mga Worksafe boards", "show_all_content": "Ipakita lahat ng nilalaman", - "link_type": "Uri ng Link" + "link_type": "Uri ng Link", + "comment_edited_at_timestamp": "Inedit na komento sa {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index 6340459c..7b5320ab 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -194,5 +194,10 @@ "use_catalog": "utiliser le catalogue", "show_worksafe_boards_only": "Afficher uniquement les tableaux Worksafe", "show_all_content": "Afficher tout le contenu", - "link_type": "Type de lien" + "link_type": "Type de lien", + "comment_edited_at_timestamp": "Commentaire modifié à {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/he/default.json b/public/translations/he/default.json index 3ff27b62..079ead71 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -194,5 +194,10 @@ "use_catalog": "השתמש בקטלוג", "show_worksafe_boards_only": "הצג לוחות עבודה בטוחים בלבד", "show_all_content": "הצג את כל התוכן", - "link_type": "סוג קישור" + "link_type": "סוג קישור", + "comment_edited_at_timestamp": "התגובה עודכנה ב {{timestamp}}.", + "reason_reason": "סיבה: \"{{reason}}\".", + "click_here_to_show_original": "<1>לחץ כאן כדי להציג את המקור.", + "click_here_to_hide_original": "<1>לחץ כאן כדי להסתיר את המקור.", + "loading": "טוען" } \ No newline at end of file diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index 701a263b..8313442f 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -194,5 +194,10 @@ "use_catalog": "कैटलॉग का उपयोग करें", "show_worksafe_boards_only": "केवल कामसुरक्षित बोर्ड्स दिखाएं", "show_all_content": "सभी सामग्री दिखाएं", - "link_type": "लिंक प्रकार" + "link_type": "लिंक प्रकार", + "comment_edited_at_timestamp": "टिप्पणी {{timestamp}} पर संपादित की गई।", + "reason_reason": "कारण: \"{{reason}}\".", + "click_here_to_show_original": "<1>यहां क्लिक करें मूल दिखाने के लिए।", + "click_here_to_hide_original": "<1>यहां क्लिक करें मूल छुपाने के लिए।", + "loading": "लोड हो रहा है" } \ No newline at end of file diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index e3252208..ca793c3f 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -194,5 +194,10 @@ "use_catalog": "használja a katalógust", "show_worksafe_boards_only": "Csak munkabiztos táblák mutatása", "show_all_content": "Mutasd az összes tartalmat", - "link_type": "Link típusa" + "link_type": "Link típusa", + "comment_edited_at_timestamp": "Hozzászólás szerkesztve itt: {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/id/default.json b/public/translations/id/default.json index e9b8274f..1c0d3c4e 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -194,5 +194,10 @@ "use_catalog": "gunakan katalog", "show_worksafe_boards_only": "Tampilkan Hanya Board Worksafe", "show_all_content": "Tampilkan Semua Konten", - "link_type": "Tipe tautan" + "link_type": "Tipe tautan", + "comment_edited_at_timestamp": "Komentar diedit pada {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/it/default.json b/public/translations/it/default.json index df523708..3036881d 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -194,5 +194,10 @@ "use_catalog": "usa catalogo", "show_worksafe_boards_only": "Mostra solo le board Worksafe", "show_all_content": "Mostra tutti i contenuti", - "link_type": "Tipo di link" + "link_type": "Tipo di link", + "comment_edited_at_timestamp": "Commento modificato il {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index cdc569a1..5320f67d 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -194,5 +194,10 @@ "use_catalog": "カタログを使用する", "show_worksafe_boards_only": "Worksafeボードのみ表示", "show_all_content": "すべてのコンテンツを表示", - "link_type": "リンクの種類" + "link_type": "リンクの種類", + "comment_edited_at_timestamp": "コメントは{{timestamp}}に編集されました。", + "reason_reason": "理由: \"{{reason}}\".", + "click_here_to_show_original": "<1>ここをクリック して元の表示。", + "click_here_to_hide_original": "<1>ここをクリック して元を非表示にする。", + "loading": "読み込み中" } \ No newline at end of file diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index 1f6e3a52..2e3dd7ae 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -194,5 +194,10 @@ "use_catalog": "카탈로그 사용", "show_worksafe_boards_only": "작업 안전 보드만 표시", "show_all_content": "모든 콘텐츠 보기", - "link_type": "링크 유형" + "link_type": "링크 유형", + "comment_edited_at_timestamp": "댓글 편집 날짜: {{timestamp}}", + "reason_reason": "이유: \"{{reason}}\".", + "click_here_to_show_original": "<1>여기를 클릭 하여 원본 표시.", + "click_here_to_hide_original": "<1>여기를 클릭 하여 원본 숨기기.", + "loading": "로딩 중" } \ No newline at end of file diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index e28c143f..076fa2fb 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -194,5 +194,10 @@ "use_catalog": "कॅटलॉग वापरा", "show_worksafe_boards_only": "केवळ कामसुरक्षित बोर्ड्स दाखवा", "show_all_content": "सर्व सामग्री दाखवा", - "link_type": "लिंक प्रकार" + "link_type": "लिंक प्रकार", + "comment_edited_at_timestamp": "टिप्पणी {{timestamp}} वर संपादित केली आहे.", + "reason_reason": "कारण: \"{{reason}}\".", + "click_here_to_show_original": "<1>येथे क्लिक करा मूळ पाहण्यासाठी।", + "click_here_to_hide_original": "<1>येथे क्लिक करा मूळ लपविण्यासाठी।", + "loading": "लोड होत आहे" } \ No newline at end of file diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index 4c954f19..1ee2efda 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -194,5 +194,10 @@ "use_catalog": "gebruik catalogus", "show_worksafe_boards_only": "Toon alleen Worksafe boards", "show_all_content": "Toon alle inhoud", - "link_type": "Link type" + "link_type": "Link type", + "comment_edited_at_timestamp": "Reactie bewerkt op {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/no/default.json b/public/translations/no/default.json index ee0435c2..12e3316c 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -194,5 +194,10 @@ "use_catalog": "bruk katalog", "show_worksafe_boards_only": "Vis kun Worksafe boards", "show_all_content": "Vis allt innhold", - "link_type": "Lenketype" + "link_type": "Lenketype", + "comment_edited_at_timestamp": "Kommentaren ble redigert på {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index ff44cd86..f71b8e93 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -194,5 +194,10 @@ "use_catalog": "użyj katalogu", "show_worksafe_boards_only": "Pokaż tylko bezpieczne tablice", "show_all_content": "Pokaż całą zawartość", - "link_type": "Typ łącza" + "link_type": "Typ łącza", + "comment_edited_at_timestamp": "Komentarz edytowany o {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index c7ee3f9f..424ebb93 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -194,5 +194,10 @@ "use_catalog": "usar catálogo", "show_worksafe_boards_only": "Mostrar apenas boards Worksafe", "show_all_content": "Mostrar Todo o Conteúdo", - "link_type": "Tipo de link" + "link_type": "Tipo de link", + "comment_edited_at_timestamp": "Comentário editado em {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index 6804ca8e..c2c0f442 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -194,5 +194,10 @@ "use_catalog": "folosește catalogul", "show_worksafe_boards_only": "Afișați doar tablourile Worksafe", "show_all_content": "Afișați tot conținutul", - "link_type": "Tipul linkului" + "link_type": "Tipul linkului", + "comment_edited_at_timestamp": "Comentariu editat la {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index dfb7e44d..e36972bb 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -194,5 +194,10 @@ "use_catalog": "использовать каталог", "show_worksafe_boards_only": "Показывать только безопасные доски", "show_all_content": "Показать весь контент", - "link_type": "Тип ссылки" + "link_type": "Тип ссылки", + "comment_edited_at_timestamp": "Комментарий изменён {{timestamp}}.", + "reason_reason": "Причина: \"{{reason}}\".", + "click_here_to_show_original": "<1>Нажмите здесь для отображения оригинала.", + "click_here_to_hide_original": "<1>Нажмите здесь чтобы скрыть оригинал.", + "loading": "Загрузка" } \ No newline at end of file diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index 3e65649b..66830a3d 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -194,5 +194,10 @@ "use_catalog": "përdor katalogun", "show_worksafe_boards_only": "Shfaq vetëm taulat e sigurta të punës", "show_all_content": "Shfaq të gjitha përmbajtjet", - "link_type": "Lloji i lidhjes" + "link_type": "Lloji i lidhjes", + "comment_edited_at_timestamp": "Komenti është ndryshuar në {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index 3dbdb837..e375d452 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -194,5 +194,10 @@ "use_catalog": "använd katalog", "show_worksafe_boards_only": "Visa endast Worksafe-styrelser", "show_all_content": "Visa allt innehåll", - "link_type": "Länktyp" + "link_type": "Länktyp", + "comment_edited_at_timestamp": "Kommentaren redigerades den {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/te/default.json b/public/translations/te/default.json index 3c4e2164..03981811 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -194,5 +194,10 @@ "use_catalog": "కాటలాగ్ ఉపయోగించు", "show_worksafe_boards_only": "పనిమాడు భద్రపరిచిన బోర్డులను మాత్రమే చూపించు", "show_all_content": "అన్ని కాంటెంట్ చూపించు", - "link_type": "లింక్ రకం" + "link_type": "లింక్ రకం", + "comment_edited_at_timestamp": "వ్యాఖ్యను {{timestamp}} లో సవరించబడింది.", + "reason_reason": "కారణం: \"{{reason}}\".", + "click_here_to_show_original": "<1>ఇక్కడ క్లిక్ చేయండి అసలు చూపించడానికి.", + "click_here_to_hide_original": "<1>ఇక్కడ క్లిక్ చేయండి అసలు దాచడానికి.", + "loading": "లోడ్ అవుతోంది" } \ No newline at end of file diff --git a/public/translations/th/default.json b/public/translations/th/default.json index a6a8cd1f..a1427646 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -194,5 +194,10 @@ "use_catalog": "ใช้แคตตาล็อก", "show_worksafe_boards_only": "แสดงบอร์ด Worksafe เท่านั้น", "show_all_content": "แสดงเนื้อหาทั้งหมด", - "link_type": "ประเภทลิงก์" + "link_type": "ประเภทลิงก์", + "comment_edited_at_timestamp": "แก้ไขความคิดเห็นที่ {{timestamp}}", + "reason_reason": "เหตุผล: \"{{reason}}\".", + "click_here_to_show_original": "<1>คลิกที่นี่ เพื่อแสดงข้อมูลต้นฉบับ", + "click_here_to_hide_original": "<1>คลิกที่นี่ เพื่อซ่อนข้อมูลต้นฉบับ", + "loading": "กำลังโหลด" } \ No newline at end of file diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index 4c8d6456..b65333c4 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -194,5 +194,10 @@ "use_catalog": "katalog kullan", "show_worksafe_boards_only": "Sadece Worksafe Panoları Göster", "show_all_content": "Tüm İçeriği Göster", - "link_type": "Bağlantı türü" + "link_type": "Bağlantı türü", + "comment_edited_at_timestamp": "Yorum {{timestamp}} tarihinde düzenlendi.", + "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" } \ No newline at end of file diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index aa7952a9..65358007 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -194,5 +194,10 @@ "use_catalog": "використовуйте каталог", "show_worksafe_boards_only": "Показувати лише безпечні дошки", "show_all_content": "Показати весь вміст", - "link_type": "Тип посилання" + "link_type": "Тип посилання", + "comment_edited_at_timestamp": "Коментар було відредаговано {{timestamp}}.", + "reason_reason": "Причина: \"{{reason}}\".", + "click_here_to_show_original": "<1>Натисніть тут для відображення оригіналу.", + "click_here_to_hide_original": "<1>Натисніть тут для приховання оригіналу.", + "loading": "Завантаження" } \ No newline at end of file diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index f5423019..0934c423 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -194,5 +194,10 @@ "use_catalog": "استعمال کیٹالوگ", "show_worksafe_boards_only": "صرف کام سے بچائے گئے بورڈز دکھائیں", "show_all_content": "تمام مواد دکھائیں", - "link_type": "لنک کی قسم" + "link_type": "لنک کی قسم", + "comment_edited_at_timestamp": "تبدیل کی گئی تبدیلی کا {{timestamp}}۔", + "reason_reason": "وجہ: \"{{reason}}\".", + "click_here_to_show_original": "<1>یہاں کلک کریں تاکہ اصل دکھائی دے۔", + "click_here_to_hide_original": "<1>یہاں کلک کریں تاکہ اصل چھپ جائے۔", + "loading": "لوڈ ہو رہا ہے" } \ No newline at end of file diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index 507d2b9b..626ef549 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -194,5 +194,10 @@ "use_catalog": "sử dụng danh mục", "show_worksafe_boards_only": "Chỉ hiển thị bảng Worksafe", "show_all_content": "Hiển thị tất cả nội dung", - "link_type": "Loại liên kết" + "link_type": "Loại liên kết", + "comment_edited_at_timestamp": "Bình luận được chỉnh sửa lúc {{timestamp}}.", + "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" } \ No newline at end of file diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index 9afafdb7..758dcaa3 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -194,5 +194,10 @@ "use_catalog": "使用目录", "show_worksafe_boards_only": "仅显示安全工作板", "show_all_content": "显示所有内容", - "link_type": "链接类型" + "link_type": "链接类型", + "comment_edited_at_timestamp": "评论于{{timestamp}}进行了编辑。", + "reason_reason": "原因: \"{{reason}}\".", + "click_here_to_show_original": "<1>点击这里 显示原文。", + "click_here_to_hide_original": "<1>点击这里 隐藏原文。", + "loading": "加载中" } \ 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 b4ba96c2..af0350fe 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -197,11 +197,21 @@ const PostMessage = ({ post }: PostProps) => { {showOriginal && }
- Comment edited at {getFormattedDate(edit?.timestamp)}. {reason && 'Reason: "' + reason + '". '} - setShowOriginal(!showOriginal)}> - Click here - - {showOriginal ? ' to hide the original.' : ' to show the original.'} + {t('comment_edited_at_timestamp', { timestamp: getFormattedDate(edit?.timestamp), interpolation: { escapeValue: false } })} + {reason && <> {t('reason_reason', { reason: reason, interpolation: { escapeValue: false } })}} + {showOriginal ? ( + setShowOriginal(!showOriginal)} /> }} + /> + ) : ( + setShowOriginal(!showOriginal)} /> }} + /> + )}
)} diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 04f8256b..2dce2f3b 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -154,11 +154,21 @@ const PostMessageMobile = ({ post }: PostProps) => { {showOriginal && }
- Comment edited at {getFormattedDate(edit?.timestamp)}. {reason && 'Reason: "' + reason + '". '} - setShowOriginal(!showOriginal)}> - Click here - - {showOriginal ? ' to hide the original.' : ' to show the original.'} + {t('comment_edited_at_timestamp', { timestamp: getFormattedDate(edit?.timestamp), interpolation: { escapeValue: false } })} + {reason && <> {t('reason_reason', { reason: reason, interpolation: { escapeValue: false } })}} + {showOriginal ? ( + setShowOriginal(!showOriginal)} /> }} + /> + ) : ( + setShowOriginal(!showOriginal)} /> }} + /> + )}
)} From c8f62a754df5bd063e08374515353149c032260e Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Wed, 26 Jun 2024 18:10:51 +0200 Subject: [PATCH 06/10] fix undefined --- src/components/comment-media/comment-media.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/comment-media/comment-media.tsx b/src/components/comment-media/comment-media.tsx index a21ad044..fdc48e74 100644 --- a/src/components/comment-media/comment-media.tsx +++ b/src/components/comment-media/comment-media.tsx @@ -151,7 +151,7 @@ const CommentMedia = ({ commentMediaInfo, isFloatingEmbed, post, showThumbnail, {url && } - {isMobile && type &&
{`${post?.spoiler && `${t('spoiler')} - `} ${getDisplayMediaInfoType(type, t)}`}
} + {isMobile && type &&
{`${post?.spoiler ? `${t('spoiler')} - ` : ''} ${getDisplayMediaInfoType(type, t)}`}
}
{!showThumbnail && }
From 972964dedafea109f2674a0fffff58e461b59912 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Wed, 26 Jun 2024 18:20:25 +0200 Subject: [PATCH 07/10] feat(reply modal): greentext by selecting text --- src/components/post-desktop/post-desktop.tsx | 2 +- src/components/post-mobile/post-mobile.tsx | 2 +- src/components/reply-modal/reply-modal.tsx | 20 ++++++++++++++------ src/hooks/use-reply-modal.ts | 9 +++++++-- src/stores/use-selected-text-store.ts | 15 +++++++++++++++ 5 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 src/stores/use-selected-text-store.ts diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index af0350fe..46e98413 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -78,7 +78,7 @@ const PostInfo = ({ openReplyModal, post, roles, isHidden }: PostProps) => { {!cid ? ( {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} ) : ( - openReplyModal && openReplyModal(cid)}> + openReplyModal && openReplyModal(cid)}> {shortCid} )} diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index 2dce2f3b..7112493a 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -89,7 +89,7 @@ const PostInfoAndMedia = ({ openReplyModal, post, roles }: PostProps) => { {!cid ? ( {state === 'failed' || stateString === 'Failed' ? 'Failed' : 'Pending'} ) : ( - openReplyModal && openReplyModal(cid)}> + openReplyModal && openReplyModal(cid)}> {shortCid} )} diff --git a/src/components/reply-modal/reply-modal.tsx b/src/components/reply-modal/reply-modal.tsx index 48dbd8cc..c559aeaa 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -7,6 +7,7 @@ import Plebbit from '@plebbit/plebbit-js/dist/browser/index.js'; import { getFormattedTimeAgo } from '../../lib/utils/time-utils'; import { isValidURL } from '../../lib/utils/url-utils'; import { isAllView, isSubscriptionsView } from '../../lib/utils/view-utils'; +import useSelectedTextStore from '../../stores/use-selected-text-store'; import useReply from '../../hooks/use-reply'; import useIsMobile from '../../hooks/use-is-mobile'; import styles from './reply-modal.module.css'; @@ -23,14 +24,12 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { const { t } = useTranslation(); const { subplebbitAddress } = useParams() as { subplebbitAddress: string }; const { setContent, resetContent, replyIndex, publishReply } = useReply({ cid: parentCid, subplebbitAddress }); - const account = useAccount(); const { displayName } = account?.author || {}; - const [url, setUrl] = useState(''); - - const textRef = useRef(null); + const textRef = useRef(null); const urlRef = useRef(null); + const { selectedText } = useSelectedTextStore(); const onPublishReply = () => { const currentContent = textRef.current?.value || ''; @@ -89,6 +88,15 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { ) : `The subplebbit might be offline and publishing might fail.`; + const setTextRef = (ref: HTMLTextAreaElement | null) => { + if (ref) { + textRef.current = ref; + !isMobile && ref.focus(); + const len = ref.value.length; + ref.setSelectionRange(len, len); + } + }; + const modalContent = (
@@ -130,12 +138,12 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { cols={48} rows={3} wrap='soft' - ref={textRef} + ref={setTextRef} + defaultValue={selectedText} onChange={(e) => { const content = e.target.value.replace(/\n/g, '\n\n'); setContent.content(content); }} - autoFocus={!isMobile} // autofocus causes auto scroll to top on mobile />
{!(isInAllView || isInSubscriptionsView) && offlineAlert} diff --git a/src/hooks/use-reply-modal.ts b/src/hooks/use-reply-modal.ts index d15cc2b1..3dc66472 100644 --- a/src/hooks/use-reply-modal.ts +++ b/src/hooks/use-reply-modal.ts @@ -1,21 +1,26 @@ import { useState, useCallback } from 'react'; import useIsMobile from './use-is-mobile'; +import useSelectedTextStore from '../stores/use-selected-text-store'; const useReplyModal = () => { const [showReplyModal, setShowReplyModal] = useState(false); const [activeCid, setActiveCid] = useState(null); + const { resetSelectedText, setSelectedText } = useSelectedTextStore(); // on mobile, the position is absolute instead of fixed, so we need to calculate the top position const isMobile = useIsMobile(); const [scrollY, setScrollY] = useState(0); const closeModal = useCallback(() => { + resetSelectedText(); setActiveCid(null); setShowReplyModal(false); - }, []); + }, [resetSelectedText]); const openReplyModal = useCallback( (cid: string) => { + let text = document.getSelection()?.toString(); + text && setSelectedText(`>${text}\n`); if (isMobile) { const currentScrollY = window.scrollY; setScrollY(currentScrollY); @@ -27,7 +32,7 @@ const useReplyModal = () => { setShowReplyModal(true); } }, - [activeCid, isMobile], + [activeCid, isMobile, setSelectedText], ); return { activeCid, closeModal, openReplyModal, scrollY, showReplyModal }; diff --git a/src/stores/use-selected-text-store.ts b/src/stores/use-selected-text-store.ts new file mode 100644 index 00000000..48f5d683 --- /dev/null +++ b/src/stores/use-selected-text-store.ts @@ -0,0 +1,15 @@ +import { create } from 'zustand'; + +interface SelectedTextState { + selectedText: string; + setSelectedText: (text: string) => void; + resetSelectedText: () => void; +} + +const useSelectedTextStore = create((set) => ({ + selectedText: '', + setSelectedText: (text) => set({ selectedText: text }), + resetSelectedText: () => set({ selectedText: '' }), +})); + +export default useSelectedTextStore; From 5835a087c9cd8c999a78b3679d4e5c7dc6b5650d Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Wed, 26 Jun 2024 18:20:59 +0200 Subject: [PATCH 08/10] Update themes.css --- src/themes.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/themes.css b/src/themes.css index fa176761..0a54d42a 100644 --- a/src/themes.css +++ b/src/themes.css @@ -808,7 +808,7 @@ --challenge-modal-background-color: #282a2e; --challenge-modal-border: 1px solid #111; --challenge-modal-title-background-color: #282a2e; - --challenge-modal-title-text-color: #b0cab9; + --challenge-modal-title-text-color: #c5c8c6; --challenge-modal-title-border: unset; --challenge-modal-title-font-size: 10pt; --challenge-modal-title-font-weight: 700; From dc6ea9e9822a5cb42c3b4871df5baf7525974b98 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Wed, 26 Jun 2024 21:27:28 +0200 Subject: [PATCH 09/10] fix performance, styling --- src/components/post-desktop/post-desktop.tsx | 4 +- src/components/post-mobile/post-mobile.tsx | 4 +- src/hooks/use-reply-modal.ts | 44 ++++++++++---------- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index 46e98413..43f14bc4 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -197,8 +197,8 @@ const PostMessage = ({ post }: PostProps) => { {showOriginal && }
- {t('comment_edited_at_timestamp', { timestamp: getFormattedDate(edit?.timestamp), interpolation: { escapeValue: false } })} - {reason && <> {t('reason_reason', { reason: reason, interpolation: { escapeValue: false } })}} + {t('comment_edited_at_timestamp', { timestamp: getFormattedDate(edit?.timestamp), interpolation: { escapeValue: false } })}{' '} + {reason && <>{t('reason_reason', { reason: reason, interpolation: { escapeValue: false } })} } {showOriginal ? ( { {showOriginal && }
- {t('comment_edited_at_timestamp', { timestamp: getFormattedDate(edit?.timestamp), interpolation: { escapeValue: false } })} - {reason && <> {t('reason_reason', { reason: reason, interpolation: { escapeValue: false } })}} + {t('comment_edited_at_timestamp', { timestamp: getFormattedDate(edit?.timestamp), interpolation: { escapeValue: false } })}{' '} + {reason && <>{t('reason_reason', { reason: reason, interpolation: { escapeValue: false } })} } {showOriginal ? ( { const [activeCid, setActiveCid] = useState(null); const { resetSelectedText, setSelectedText } = useSelectedTextStore(); - // on mobile, the position is absolute instead of fixed, so we need to calculate the top position + // on mobile, the css position is absolute instead of fixed, so we need to calculate the top position const isMobile = useIsMobile(); const [scrollY, setScrollY] = useState(0); - const closeModal = useCallback(() => { + const closeModal = () => { resetSelectedText(); setActiveCid(null); setShowReplyModal(false); - }, [resetSelectedText]); + }; - const openReplyModal = useCallback( - (cid: string) => { - let text = document.getSelection()?.toString(); - text && setSelectedText(`>${text}\n`); - if (isMobile) { - const currentScrollY = window.scrollY; - setScrollY(currentScrollY); - } - if (activeCid && activeCid !== cid) { - return; - } else if (!activeCid) { - setActiveCid(cid); - setShowReplyModal(true); - } - }, - [activeCid, isMobile, setSelectedText], - ); + const getSelectedText = () => { + let text = document.getSelection()?.toString(); + text && setSelectedText(`>${text}\n`); + }; + + const openReplyModal = (cid: string) => { + getSelectedText(); + + if (isMobile) { + const currentScrollY = window.scrollY; + setScrollY(currentScrollY); + } + + if (activeCid && activeCid !== cid) { + return; + } + setActiveCid(cid); + setShowReplyModal(true); + }; return { activeCid, closeModal, openReplyModal, scrollY, showReplyModal }; }; From 890419dfc3c6ff856a7788f085b6b761764629a2 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Wed, 26 Jun 2024 22:20:45 +0200 Subject: [PATCH 10/10] style(reply modal): improve design of c/cid on top of content --- .../reply-modal/reply-modal.module.css | 12 ++--- src/components/reply-modal/reply-modal.tsx | 45 +++++++++++-------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/components/reply-modal/reply-modal.module.css b/src/components/reply-modal/reply-modal.module.css index ada47ed3..8daaf256 100644 --- a/src/components/reply-modal/reply-modal.module.css +++ b/src/components/reply-modal/reply-modal.module.css @@ -62,7 +62,6 @@ .content textarea { vertical-align: top; - padding-top: 18px; } .footer button { @@ -81,14 +80,9 @@ padding-top: 2px; } -.parentCid { - color: var(--post-form-field-input-color); - position: absolute; - width: auto; - background-color: var(--post-form-field-input-background-color, white); - padding: 2px; - left: 1px; - top: 1px; +.publishButton { + width: 75px; + filter: var(--filter80) } .offlineBoard { diff --git a/src/components/reply-modal/reply-modal.tsx b/src/components/reply-modal/reply-modal.tsx index c559aeaa..b4a1a440 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -23,7 +23,7 @@ interface ReplyModalProps { const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { const { t } = useTranslation(); const { subplebbitAddress } = useParams() as { subplebbitAddress: string }; - const { setContent, resetContent, replyIndex, publishReply } = useReply({ cid: parentCid, subplebbitAddress }); + const { setContent, publishReply } = useReply({ cid: parentCid, subplebbitAddress }); const account = useAccount(); const { displayName } = account?.author || {}; const [url, setUrl] = useState(''); @@ -45,15 +45,9 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { return; } publishReply(); + closeModal(); }; - useEffect(() => { - if (typeof replyIndex === 'number') { - closeModal(); - resetContent(); - } - }, [replyIndex, resetContent, closeModal]); - const nodeRef = useRef(null); const isMobile = useIsMobile(); @@ -97,6 +91,23 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { } }; + const contentPrefix = `c/${parentCid && Plebbit.getShortCid(parentCid)}\n`; + + const handleContentInput = (e: React.ChangeEvent) => { + const { value } = e.target; + if (!value.startsWith(contentPrefix)) { + e.target.value = contentPrefix + value.slice(contentPrefix.length); + } + }; + + const handleContentChange = (e: React.ChangeEvent) => { + // remove the prefix from the content to publish, and also add newlines for markdown + const contentWithoutPrefix = e.target.value.slice(contentPrefix.length).replace(/\n/g, '\n\n'); + if (textRef.current && textRef.current.value !== contentWithoutPrefix) { + setContent.content(contentWithoutPrefix); + } + }; + const modalContent = (
@@ -131,19 +142,15 @@ const ReplyModal = ({ closeModal, parentCid, scrollY }: ReplyModalProps) => { />
- - {`c/${parentCid && Plebbit.getShortCid(parentCid)}`} -