diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json
index 6f05409a..ed9cb73b 100644
--- a/public/translations/ar/default.json
+++ b/public/translations/ar/default.json
@@ -323,5 +323,8 @@
"wallet_number": "المحفظة #{{index}}",
"view_more": "عرض المزيد",
"submit_community": "قدم مجتمعك",
- "hide_avatars_from_replies": "إخفاء الصور الرمزية من الردود"
+ "hide_avatars_from_replies": "إخفاء الصور الرمزية من الردود",
+ "yes": "نعم",
+ "no": "لا",
+ "are_you_sure": "هل أنت متأكد؟"
}
\ No newline at end of file
diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json
index 2288db16..77643eda 100644
--- a/public/translations/bn/default.json
+++ b/public/translations/bn/default.json
@@ -323,5 +323,8 @@
"wallet_number": "ওয়ালেট #{{index}}",
"view_more": "আরও দেখুন",
"submit_community": "আপনার সম্প্রদায় জমা দিন",
- "hide_avatars_from_replies": "প্রতিক্রিয়া থেকে অ্যাভাটারগুলি লুকান"
+ "hide_avatars_from_replies": "প্রতিক্রিয়া থেকে অ্যাভাটারগুলি লুকান",
+ "yes": "হ্যাঁ",
+ "no": "না",
+ "are_you_sure": "আপনি কি নিশ্চিত?"
}
\ No newline at end of file
diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json
index 949d7c59..dab9c9f5 100644
--- a/public/translations/cs/default.json
+++ b/public/translations/cs/default.json
@@ -323,5 +323,8 @@
"wallet_number": "peněženka #{{index}}",
"view_more": "zobrazit více",
"submit_community": "Odešlete svou komunitu",
- "hide_avatars_from_replies": "Skrýt avatary v odpovědích"
+ "hide_avatars_from_replies": "Skrýt avatary v odpovědích",
+ "yes": "ano",
+ "no": "ne",
+ "are_you_sure": "Jste si jistí?"
}
\ No newline at end of file
diff --git a/public/translations/da/default.json b/public/translations/da/default.json
index 2bb6b20c..520c7f1c 100644
--- a/public/translations/da/default.json
+++ b/public/translations/da/default.json
@@ -323,5 +323,8 @@
"wallet_number": "tegneboks #{{index}}",
"view_more": "se mere",
"submit_community": "Indsend dit fællesskab",
- "hide_avatars_from_replies": "Skjul avatarer fra svar"
+ "hide_avatars_from_replies": "Skjul avatarer fra svar",
+ "yes": "ja",
+ "no": "nej",
+ "are_you_sure": "Er du sikker?"
}
\ No newline at end of file
diff --git a/public/translations/de/default.json b/public/translations/de/default.json
index 372460ed..31cf1ab6 100644
--- a/public/translations/de/default.json
+++ b/public/translations/de/default.json
@@ -323,5 +323,8 @@
"wallet_number": "Wallet #{{index}}",
"view_more": "mehr anzeigen",
"submit_community": "Reichen Sie Ihre Gemeinschaft ein",
- "hide_avatars_from_replies": "Avatare in Antworten ausblenden"
+ "hide_avatars_from_replies": "Avatare in Antworten ausblenden",
+ "yes": "ja",
+ "no": "nein",
+ "are_you_sure": "Bist du sicher?"
}
\ No newline at end of file
diff --git a/public/translations/el/default.json b/public/translations/el/default.json
index 8a0bce05..5a4603ea 100644
--- a/public/translations/el/default.json
+++ b/public/translations/el/default.json
@@ -323,5 +323,8 @@
"wallet_number": "πορτοφόλι #{{index}}",
"view_more": "δείτε περισσότερα",
"submit_community": "Υποβάλετε την κοινότητά σας",
- "hide_avatars_from_replies": "Απόκρυψη avatar από τις απαντήσεις"
+ "hide_avatars_from_replies": "Απόκρυψη avatar από τις απαντήσεις",
+ "yes": "ναι",
+ "no": "όχι",
+ "are_you_sure": "Είσαι σίγουρος;"
}
\ No newline at end of file
diff --git a/public/translations/en/default.json b/public/translations/en/default.json
index b6f8b60a..dd23736a 100644
--- a/public/translations/en/default.json
+++ b/public/translations/en/default.json
@@ -323,5 +323,8 @@
"wallet_number": "wallet #{{index}}",
"view_more": "view more",
"submit_community": "Submit your community",
- "hide_avatars_from_replies": "Hide avatars from replies"
+ "hide_avatars_from_replies": "Hide avatars from replies",
+ "yes": "yes",
+ "no": "no",
+ "are_you_sure": "Are you sure?"
}
\ No newline at end of file
diff --git a/public/translations/es/default.json b/public/translations/es/default.json
index 261172bd..5fb7fd17 100644
--- a/public/translations/es/default.json
+++ b/public/translations/es/default.json
@@ -323,5 +323,8 @@
"wallet_number": "billetera #{{index}}",
"view_more": "ver más",
"submit_community": "Envía tu comunidad",
- "hide_avatars_from_replies": "Ocultar avatares de las respuestas"
+ "hide_avatars_from_replies": "Ocultar avatares de las respuestas",
+ "yes": "sí",
+ "no": "no",
+ "are_you_sure": "¿Estás seguro?"
}
\ No newline at end of file
diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json
index 60efd580..93f13b84 100644
--- a/public/translations/fa/default.json
+++ b/public/translations/fa/default.json
@@ -323,5 +323,8 @@
"wallet_number": "کیف پول #{{index}}",
"view_more": "مشاهده بیشتر",
"submit_community": "جامعه خود را ارسال کنید",
- "hide_avatars_from_replies": "تصاویر پروفایل را از پاسخها پنهان کن"
+ "hide_avatars_from_replies": "تصاویر پروفایل را از پاسخها پنهان کن",
+ "yes": "بله",
+ "no": "نه",
+ "are_you_sure": "آیا مطمئن هستید؟"
}
\ No newline at end of file
diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json
index 87401ea4..bac08096 100644
--- a/public/translations/fi/default.json
+++ b/public/translations/fi/default.json
@@ -323,5 +323,8 @@
"wallet_number": "lompakko #{{index}}",
"view_more": "näytä lisää",
"submit_community": "Lähetä yhteisösi",
- "hide_avatars_from_replies": "Piilota avatarit vastauksista"
+ "hide_avatars_from_replies": "Piilota avatarit vastauksista",
+ "yes": "kyllä",
+ "no": "ei",
+ "are_you_sure": "Oletko varma?"
}
\ No newline at end of file
diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json
index 0ffecc2a..0e8143f2 100644
--- a/public/translations/fil/default.json
+++ b/public/translations/fil/default.json
@@ -323,5 +323,8 @@
"wallet_number": "wallet #{{index}}",
"view_more": "tingnan pa",
"submit_community": "I-submit ang iyong komunidad",
- "hide_avatars_from_replies": "Itago ang mga avatar mula sa mga sagot"
+ "hide_avatars_from_replies": "Itago ang mga avatar mula sa mga sagot",
+ "yes": "oo",
+ "no": "hindi",
+ "are_you_sure": "Sigurado ka ba?"
}
\ No newline at end of file
diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json
index 61950de2..5794cbe5 100644
--- a/public/translations/fr/default.json
+++ b/public/translations/fr/default.json
@@ -323,5 +323,8 @@
"wallet_number": "portefeuille #{{index}}",
"view_more": "voir plus",
"submit_community": "Soumettez votre communauté",
- "hide_avatars_from_replies": "Cacher les avatars des réponses"
+ "hide_avatars_from_replies": "Cacher les avatars des réponses",
+ "yes": "oui",
+ "no": "non",
+ "are_you_sure": "Êtes-vous sûr?"
}
\ No newline at end of file
diff --git a/public/translations/he/default.json b/public/translations/he/default.json
index 7d2742e5..19d4d625 100644
--- a/public/translations/he/default.json
+++ b/public/translations/he/default.json
@@ -323,5 +323,8 @@
"wallet_number": "ארנק #{{index}}",
"view_more": "ראה עוד",
"submit_community": "שלח את הקהילה שלך",
- "hide_avatars_from_replies": "הסתרת תמונות פרופיל בתשובות"
+ "hide_avatars_from_replies": "הסתרת תמונות פרופיל בתשובות",
+ "yes": "כן",
+ "no": "לא",
+ "are_you_sure": "האם אתה בטוח?"
}
\ No newline at end of file
diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json
index 6cb10ef0..a6a1e67e 100644
--- a/public/translations/hi/default.json
+++ b/public/translations/hi/default.json
@@ -323,5 +323,8 @@
"wallet_number": "वॉलेट #{{index}}",
"view_more": "और देखें",
"submit_community": "अपनी समुदाय सबमिट करें",
- "hide_avatars_from_replies": "उत्तर से अवतार छुपाएं"
+ "hide_avatars_from_replies": "उत्तर से अवतार छुपाएं",
+ "yes": "हां",
+ "no": "नहीं",
+ "are_you_sure": "क्या आप सुनिश्चित हैं?"
}
\ No newline at end of file
diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json
index c57ea378..9a54faf1 100644
--- a/public/translations/hu/default.json
+++ b/public/translations/hu/default.json
@@ -323,5 +323,8 @@
"wallet_number": "tárca #{{index}}",
"view_more": "több megtekintése",
"submit_community": "Küldje el közösségét",
- "hide_avatars_from_replies": "Rejtse el az avatarokat a válaszokból"
+ "hide_avatars_from_replies": "Rejtse el az avatarokat a válaszokból",
+ "yes": "igen",
+ "no": "nem",
+ "are_you_sure": "Biztos vagy benne?"
}
\ No newline at end of file
diff --git a/public/translations/id/default.json b/public/translations/id/default.json
index 28af39c8..97154e5b 100644
--- a/public/translations/id/default.json
+++ b/public/translations/id/default.json
@@ -323,5 +323,8 @@
"wallet_number": "dompet #{{index}}",
"view_more": "lihat lebih banyak",
"submit_community": "Kirim komunitas Anda",
- "hide_avatars_from_replies": "Sembunyikan avatar dari balasan"
+ "hide_avatars_from_replies": "Sembunyikan avatar dari balasan",
+ "yes": "iya",
+ "no": "tidak",
+ "are_you_sure": "Apakah Anda yakin?"
}
\ No newline at end of file
diff --git a/public/translations/it/default.json b/public/translations/it/default.json
index d66ec63f..325b08d6 100644
--- a/public/translations/it/default.json
+++ b/public/translations/it/default.json
@@ -323,5 +323,8 @@
"wallet_number": "wallet #{{index}}",
"view_more": "altri",
"submit_community": "Invia la tua comunità",
- "hide_avatars_from_replies": "Nascondi avatar da commenti"
+ "hide_avatars_from_replies": "Nascondi avatar da commenti",
+ "yes": "sì",
+ "no": "no",
+ "are_you_sure": "Sei sicuro?"
}
\ No newline at end of file
diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json
index 695f64b7..915583b6 100644
--- a/public/translations/ja/default.json
+++ b/public/translations/ja/default.json
@@ -323,5 +323,8 @@
"wallet_number": "ウォレット #{{index}}",
"view_more": "もっと見る",
"submit_community": "コミュニティを提出してください",
- "hide_avatars_from_replies": "返信からアバターを非表示にする"
+ "hide_avatars_from_replies": "返信からアバターを非表示にする",
+ "yes": "はい",
+ "no": "いいえ",
+ "are_you_sure": "本当にそうですか?"
}
\ No newline at end of file
diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json
index 9427cf7f..0cf9c8ff 100644
--- a/public/translations/ko/default.json
+++ b/public/translations/ko/default.json
@@ -323,5 +323,8 @@
"wallet_number": "지갑 #{{index}}",
"view_more": "더보기",
"submit_community": "커뮤니티를 제출하세요",
- "hide_avatars_from_replies": "답글에서 아바타 숨기기"
+ "hide_avatars_from_replies": "답글에서 아바타 숨기기",
+ "yes": "네",
+ "no": "아니요",
+ "are_you_sure": "정말 확실합니까?"
}
\ No newline at end of file
diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json
index 9b080c27..f8a6f246 100644
--- a/public/translations/mr/default.json
+++ b/public/translations/mr/default.json
@@ -323,5 +323,8 @@
"wallet_number": "वॉलेट #{{index}}",
"view_more": "अधिक पाहा",
"submit_community": "तुमच्या समुदायाला सबमिट करा",
- "hide_avatars_from_replies": "उत्तरांमधून अवतार लपवा"
+ "hide_avatars_from_replies": "उत्तरांमधून अवतार लपवा",
+ "yes": "होय",
+ "no": "नाही",
+ "are_you_sure": "तुम्हाला खात्री आहे का?"
}
\ No newline at end of file
diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json
index 67c34480..496f94ba 100644
--- a/public/translations/nl/default.json
+++ b/public/translations/nl/default.json
@@ -323,5 +323,8 @@
"wallet_number": "portemonnee #{{index}}",
"view_more": "meer bekijken",
"submit_community": "Dien uw gemeenschap in",
- "hide_avatars_from_replies": "Verberg avatars van reacties"
+ "hide_avatars_from_replies": "Verberg avatars van reacties",
+ "yes": "ja",
+ "no": "nee",
+ "are_you_sure": "Weet je het zeker?"
}
\ No newline at end of file
diff --git a/public/translations/no/default.json b/public/translations/no/default.json
index 26833f4a..9da7352d 100644
--- a/public/translations/no/default.json
+++ b/public/translations/no/default.json
@@ -323,5 +323,8 @@
"wallet_number": "lommebok #{{index}}",
"view_more": "vis mer",
"submit_community": "Send inn ditt fellesskap",
- "hide_avatars_from_replies": "Skjul avatarer fra svar"
+ "hide_avatars_from_replies": "Skjul avatarer fra svar",
+ "yes": "ja",
+ "no": "nei",
+ "are_you_sure": "Er du sikker?"
}
\ No newline at end of file
diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json
index efcc48e8..08c2a715 100644
--- a/public/translations/pl/default.json
+++ b/public/translations/pl/default.json
@@ -323,5 +323,8 @@
"wallet_number": "portfel #{{index}}",
"view_more": "zobacz więcej",
"submit_community": "Prześlij swoją społeczność",
- "hide_avatars_from_replies": "Ukryj avatary w odpowiedziach"
+ "hide_avatars_from_replies": "Ukryj avatary w odpowiedziach",
+ "yes": "tak",
+ "no": "nie",
+ "are_you_sure": "Jesteś pewny?"
}
\ No newline at end of file
diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json
index e4160916..80fc3be0 100644
--- a/public/translations/pt/default.json
+++ b/public/translations/pt/default.json
@@ -323,5 +323,8 @@
"wallet_number": "carteira #{{index}}",
"view_more": "ver mais",
"submit_community": "Envie sua comunidade",
- "hide_avatars_from_replies": "Esconder avatares das respostas"
+ "hide_avatars_from_replies": "Esconder avatares das respostas",
+ "yes": "sim",
+ "no": "não",
+ "are_you_sure": "Tem certeza?"
}
\ No newline at end of file
diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json
index a117e342..e01be8f8 100644
--- a/public/translations/ro/default.json
+++ b/public/translations/ro/default.json
@@ -323,5 +323,8 @@
"wallet_number": "portofel #{{index}}",
"view_more": "vezi mai mult",
"submit_community": "Trimite comunitatea ta",
- "hide_avatars_from_replies": "Ascunde avatarele din răspunsuri"
+ "hide_avatars_from_replies": "Ascunde avatarele din răspunsuri",
+ "yes": "da",
+ "no": "nu",
+ "are_you_sure": "Ești sigur?"
}
\ No newline at end of file
diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json
index 8bb49c0e..8998e40b 100644
--- a/public/translations/ru/default.json
+++ b/public/translations/ru/default.json
@@ -323,5 +323,8 @@
"wallet_number": "кошелек #{{index}}",
"view_more": "смотреть больше",
"submit_community": "Отправьте ваше сообщество",
- "hide_avatars_from_replies": "Скрыть аватары в ответах"
+ "hide_avatars_from_replies": "Скрыть аватары в ответах",
+ "yes": "да",
+ "no": "нет",
+ "are_you_sure": "Вы уверены?"
}
\ No newline at end of file
diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json
index 66749be4..12afad50 100644
--- a/public/translations/sq/default.json
+++ b/public/translations/sq/default.json
@@ -323,5 +323,8 @@
"wallet_number": "portofol #{{index}}",
"view_more": "shiko më shumë",
"submit_community": "Dorëzo komunitetin tuaj",
- "hide_avatars_from_replies": "Fshih avatarët nga përgjigjet"
+ "hide_avatars_from_replies": "Fshih avatarët nga përgjigjet",
+ "yes": "po",
+ "no": "jo",
+ "are_you_sure": "Jeni të sigurt?"
}
\ No newline at end of file
diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json
index 90062e73..b349530f 100644
--- a/public/translations/sv/default.json
+++ b/public/translations/sv/default.json
@@ -323,5 +323,8 @@
"wallet_number": "plånbok #{{index}}",
"view_more": "visa mer",
"submit_community": "Skicka in ditt samhälle",
- "hide_avatars_from_replies": "Dölj avatarer från svar"
+ "hide_avatars_from_replies": "Dölj avatarer från svar",
+ "yes": "ja",
+ "no": "nej",
+ "are_you_sure": "Är du säker?"
}
\ No newline at end of file
diff --git a/public/translations/te/default.json b/public/translations/te/default.json
index c5110b1a..81c59329 100644
--- a/public/translations/te/default.json
+++ b/public/translations/te/default.json
@@ -323,5 +323,8 @@
"wallet_number": "వాలెట్ #{{index}}",
"view_more": "మరింత చూడండి",
"submit_community": "మీ కమ్యూనిటి పంపించండి",
- "hide_avatars_from_replies": "ప్రతిస్పందనల నుండి అవతార్లను దాచు"
+ "hide_avatars_from_replies": "ప్రతిస్పందనల నుండి అవతార్లను దాచు",
+ "yes": "అవును",
+ "no": "కాదు",
+ "are_you_sure": "మీకు నమ్మకమా?"
}
\ No newline at end of file
diff --git a/public/translations/th/default.json b/public/translations/th/default.json
index 890aeba9..8e391fd3 100644
--- a/public/translations/th/default.json
+++ b/public/translations/th/default.json
@@ -323,5 +323,8 @@
"wallet_number": "กระเป๋าเงิน #{{index}}",
"view_more": "ดูเพิ่มเติม",
"submit_community": "ส่งชุมชนของคุณ",
- "hide_avatars_from_replies": "ซ่อนอวาตาร์จากคำตอบ"
+ "hide_avatars_from_replies": "ซ่อนอวาตาร์จากคำตอบ",
+ "yes": "ใช่",
+ "no": "ไม่ใช่",
+ "are_you_sure": "คุณมั่นใจไหม?"
}
\ No newline at end of file
diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json
index 97e6578c..e3ec66db 100644
--- a/public/translations/tr/default.json
+++ b/public/translations/tr/default.json
@@ -323,5 +323,8 @@
"wallet_number": "cüzdan #{{index}}",
"view_more": "daha fazla görüntüle",
"submit_community": "Topluluğunuzu gönderin",
- "hide_avatars_from_replies": "Yanıtlardan avatarları gizle"
+ "hide_avatars_from_replies": "Yanıtlardan avatarları gizle",
+ "yes": "evet",
+ "no": "hayır",
+ "are_you_sure": "Emin misin?"
}
\ No newline at end of file
diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json
index 05b45b2d..7c6dad93 100644
--- a/public/translations/uk/default.json
+++ b/public/translations/uk/default.json
@@ -323,5 +323,8 @@
"wallet_number": "гаманець #{{index}}",
"view_more": "переглянути більше",
"submit_community": "Надішліть своє співтовариство",
- "hide_avatars_from_replies": "Сховати аватари в відповідях"
+ "hide_avatars_from_replies": "Сховати аватари в відповідях",
+ "yes": "так",
+ "no": "ні",
+ "are_you_sure": "Ви впевнені?"
}
\ No newline at end of file
diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json
index 244f8f6b..ceb599bb 100644
--- a/public/translations/ur/default.json
+++ b/public/translations/ur/default.json
@@ -323,5 +323,8 @@
"wallet_number": "والٹ #{{index}}",
"view_more": "مزید دیکھیں",
"submit_community": "اپنی کمیونٹی جمع کروائیں",
- "hide_avatars_from_replies": "جوابوں سے اوتار چھپائیں"
+ "hide_avatars_from_replies": "جوابوں سے اوتار چھپائیں",
+ "yes": "ہاں",
+ "no": "نہیں",
+ "are_you_sure": "کیا آپ کو یقین ہے؟"
}
\ No newline at end of file
diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json
index 87187821..8db7c75b 100644
--- a/public/translations/vi/default.json
+++ b/public/translations/vi/default.json
@@ -323,5 +323,8 @@
"wallet_number": "ví #{{index}}",
"view_more": "xem thêm",
"submit_community": "Gửi cộng đồng của bạn",
- "hide_avatars_from_replies": "Ẩn avatar trong các câu trả lời"
+ "hide_avatars_from_replies": "Ẩn avatar trong các câu trả lời",
+ "yes": "vâng",
+ "no": "không",
+ "are_you_sure": "Bạn chắc chắn chứ?"
}
\ No newline at end of file
diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json
index acf308fd..f53392d8 100644
--- a/public/translations/zh/default.json
+++ b/public/translations/zh/default.json
@@ -323,5 +323,8 @@
"wallet_number": "钱包 #{{index}}",
"view_more": "查看更多",
"submit_community": "提交您的社区",
- "hide_avatars_from_replies": "隐藏回复中的头像"
+ "hide_avatars_from_replies": "隐藏回复中的头像",
+ "yes": "是的",
+ "no": "不是",
+ "are_you_sure": "你确定吗?"
}
\ No newline at end of file
diff --git a/src/components/header/header.tsx b/src/components/header/header.tsx
index 96bf87ec..e249cd44 100644
--- a/src/components/header/header.tsx
+++ b/src/components/header/header.tsx
@@ -15,8 +15,8 @@ import {
isHomeAboutView,
isHomeView,
isInboxView,
- isPendingView,
- isPostView,
+ isPendingPostView,
+ isPostPageView,
isProfileView,
isProfileCommentsView,
isProfileDownvotedView,
@@ -62,11 +62,11 @@ const CommentsButton = () => {
const { t } = useTranslation();
const params = useParams();
const location = useLocation();
- const isInPostView = isPostView(location.pathname, params);
+ const isInPostPageView = isPostPageView(location.pathname, params);
const isInHomeAboutView = isHomeAboutView(location.pathname);
return (
-
+
{t('comments')}
);
@@ -242,8 +242,8 @@ const HeaderTabs = () => {
const isInHomeAboutView = isHomeAboutView(location.pathname);
const isInHomeView = isHomeView(location.pathname);
const isInInboxView = isInboxView(location.pathname);
- const isInPendingView = isPendingView(location.pathname, params);
- const isInPostView = isPostView(location.pathname, params);
+ const isInPendingPostView = isPendingPostView(location.pathname, params);
+ const isInPostPageView = isPostPageView(location.pathname, params);
const isInProfileView = isProfileView(location.pathname);
const isInSubplebbitView = isSubplebbitView(location.pathname, params);
const isInSubplebbitSettingsView = isSubplebbitSettingsView(location.pathname, params);
@@ -253,13 +253,13 @@ const HeaderTabs = () => {
const isInSettingsView = isSettingsView(location.pathname);
const isInSettingsPlebbitOptionsView = isSettingsPlebbitOptionsView(location.pathname);
- if (isInPostView) {
+ if (isInPostPageView) {
return ;
} else if (isInHomeView || isInHomeAboutView || (isInSubplebbitView && !isInSubplebbitSubmitView && !isInSubplebbitSettingsView) || isInAllView) {
return ;
- } else if ((isInProfileView || isInAuthorView) && !isInPendingView) {
+ } else if ((isInProfileView || isInAuthorView) && !isInPendingPostView) {
return ;
- } else if (isInPendingView) {
+ } else if (isInPendingPostView) {
return {t('pending')};
} else if (isInInboxView) {
return ;
@@ -279,7 +279,7 @@ const HeaderTitle = ({ title, shortAddress }: { title: string; shortAddress: str
const isInAllView = isAllView(location.pathname);
const isInAuthorView = isAuthorView(location.pathname);
const isInInboxView = isInboxView(location.pathname);
- const isInPostView = isPostView(location.pathname, params);
+ const isInPostPageView = isPostPageView(location.pathname, params);
const isInProfileView = isProfileView(location.pathname);
const isInSettingsView = isSettingsView(location.pathname);
const isInSettingsPlebbitOptionsView = isSettingsPlebbitOptionsView(location.pathname);
@@ -302,7 +302,7 @@ const HeaderTitle = ({ title, shortAddress }: { title: string; shortAddress: str
{subplebbitTitle}: {submitTitle}
>
);
- } else if (isInPostView || (isInSubplebbitView && !isInSubplebbitSettingsView)) {
+ } else if (isInPostPageView || (isInSubplebbitView && !isInSubplebbitSettingsView)) {
return subplebbitTitle;
} else if (isInSubplebbitSettingsView) {
return (
@@ -346,7 +346,7 @@ const Header = () => {
const isInHomeView = isHomeView(location.pathname);
const isInHomeAboutView = isHomeAboutView(location.pathname);
const isInInboxView = isInboxView(location.pathname);
- const isInPostView = isPostView(location.pathname, params);
+ const isInPostPageView = isPostPageView(location.pathname, params);
const isInProfileView = isProfileView(location.pathname);
const isInSettingsView = isSettingsView(location.pathname);
const isInSubplebbitView = isSubplebbitView(location.pathname, params);
@@ -356,11 +356,12 @@ const Header = () => {
const isInSubplebbitSettingsView = isSubplebbitSettingsView(location.pathname, params);
const isInNotFoundView = useNotFoundStore((state) => state.isNotFound);
- const hasFewTabs = isInPostView || isInSubmitView || isInSubplebbitSubmitView || isInSubplebbitSettingsView || isInSettingsView || isInInboxView || isInSettingsView;
+ const hasFewTabs =
+ isInPostPageView || isInSubmitView || isInSubplebbitSubmitView || isInSubplebbitSettingsView || isInSettingsView || isInInboxView || isInSettingsView;
const hasStickyHeader =
isInHomeView ||
isInNotFoundView ||
- (isInSubplebbitView && !isInSubplebbitSubmitView && !isInSubplebbitSettingsView && !isInPostView && !isInHomeAboutView && !isInSubplebbitAboutView) ||
+ (isInSubplebbitView && !isInSubplebbitSubmitView && !isInSubplebbitSettingsView && !isInPostPageView && !isInHomeAboutView && !isInSubplebbitAboutView) ||
(isInProfileView && !isInHomeAboutView) ||
(isInAllView && !isInAllAboutView) ||
(isInAuthorView && !isInHomeAboutView);
@@ -405,7 +406,7 @@ const Header = () => {
{isMobile && !isInSubplebbitSubmitView && (
- {(isInHomeView || isInHomeAboutView || isInSubplebbitView || isInHomeAboutView || isInAllView || isInPostView) && }
+ {(isInHomeView || isInHomeAboutView || isInSubplebbitView || isInHomeAboutView || isInAllView || isInPostPageView) && }
)}
diff --git a/src/components/post/comment-tools/comment-tools.tsx b/src/components/post/comment-tools/comment-tools.tsx
index 84e2e35a..a5692ac8 100644
--- a/src/components/post/comment-tools/comment-tools.tsx
+++ b/src/components/post/comment-tools/comment-tools.tsx
@@ -263,7 +263,7 @@ const CommentTools = ({
const isInInboxView = isInboxView(useLocation().pathname);
return (
- (!(deleted || removed) || ((deleted || removed) && (isAuthor || isAccountMod))) && (
+ (!(deleted || removed) || (!deleted && isAccountMod)) && (
{isReply ? (
isSingleReply ? (
diff --git a/src/components/post/comment-tools/edit-menu/edit-menu.module.css b/src/components/post/comment-tools/edit-menu/edit-menu.module.css
index 7f112840..40c9a49f 100644
--- a/src/components/post/comment-tools/edit-menu/edit-menu.module.css
+++ b/src/components/post/comment-tools/edit-menu/edit-menu.module.css
@@ -2,7 +2,7 @@
color: var(--text-info);
font-weight: bold;
text-decoration: none;
- padding: 0 4px 0 4px;
+ padding: 0 4px;
cursor: pointer;
text-transform: lowercase;
}
@@ -42,4 +42,20 @@
.reportButton {
display: block;
}
-}
\ No newline at end of file
+}
+
+.deleteConfirm {
+ color: var(--red);
+ text-transform: lowercase;
+ padding: 0 4px;
+}
+
+.deleteConfirm:hover {
+ text-decoration: none !important;
+}
+
+.deleteConfirm span {
+ color: var(--text-info);
+ font-weight: 700;
+ cursor: pointer;
+}
diff --git a/src/components/post/comment-tools/edit-menu/edit-menu.tsx b/src/components/post/comment-tools/edit-menu/edit-menu.tsx
index ec4e4cff..b516555e 100644
--- a/src/components/post/comment-tools/edit-menu/edit-menu.tsx
+++ b/src/components/post/comment-tools/edit-menu/edit-menu.tsx
@@ -41,17 +41,24 @@ const EditMenu = ({ commentCid, showCommentEditForm }: EditMenuProps) => {
const [publishOptions, setPublishOptions] = useState(defaultPublishOptions);
const { publishCommentEdit } = usePublishCommentEdit(publishOptions);
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
+
const deleteComment = useCallback(() => {
+ setShowDeleteConfirm(true);
+ }, []);
+
+ const confirmDelete = () => {
const newDeletedState = !deleted;
- const confirmMessage = deleted ? t('sure_undelete') : t('sure_delete');
+ setPublishOptions((prevOptions) => ({
+ ...prevOptions,
+ deleted: newDeletedState,
+ }));
+ setShowDeleteConfirm(false);
+ };
- if (window.confirm(confirmMessage)) {
- setPublishOptions((prevOptions) => ({
- ...prevOptions,
- deleted: newDeletedState,
- }));
- }
- }, [deleted, t]);
+ const cancelDelete = () => {
+ setShowDeleteConfirm(false);
+ };
useEffect(() => {
if (publishOptions.deleted !== defaultPublishOptions.deleted) {
@@ -70,9 +77,22 @@ const EditMenu = ({ commentCid, showCommentEditForm }: EditMenuProps) => {
{t('edit')}
- -
- {deleted ? t('undelete') : t('delete')}
-
+ {showDeleteConfirm ? (
+
+ {t('are_you_sure')}{' '}
+
+ {t('yes')}
+
+ {' / '}
+
+ {t('no')}
+
+
+ ) : (
+ -
+ {deleted ? t('undelete') : t('delete')}
+
+ )}
>
);
};
diff --git a/src/components/post/post.tsx b/src/components/post/post.tsx
index f054d590..b07453d4 100644
--- a/src/components/post/post.tsx
+++ b/src/components/post/post.tsx
@@ -3,11 +3,12 @@ import styles from './post.module.css';
import { Link, useLocation, useParams } from 'react-router-dom';
import { Comment, useAuthorAddress, useBlock, useComment, useEditedComment, useSubplebbit, useSubscribe } from '@plebbit/plebbit-react-hooks';
import { useTranslation } from 'react-i18next';
-import { isAllView, isPostView, isProfileHiddenView, isSubplebbitView } from '../../lib/utils/view-utils';
+import { isAllView, isPostPageView, isProfileHiddenView, isSubplebbitView } from '../../lib/utils/view-utils';
import { getHasThumbnail } from '../../lib/utils/media-utils';
import { getPostScore } from '../../lib/utils/post-utils';
import { getHostname } from '../../lib/utils/url-utils';
import { getFormattedTimeAgo, formatLocalizedUTCTimestamp } from '../../lib/utils/time-utils';
+import { useCommentMediaInfo } from '../../hooks/use-comment-media-info';
import CommentEditForm from '../comment-edit-form';
import ExpandButton from './expand-button';
import Expando from './expando';
@@ -17,7 +18,6 @@ import Thumbnail from './thumbnail';
import useDownvote from '../../hooks/use-downvote';
import useUpvote from '../../hooks/use-upvote';
import _ from 'lodash';
-import { useCommentMediaInfo } from '../../hooks/use-comment-media-info';
interface PostAuthorProps {
authorAddress: string;
@@ -117,13 +117,13 @@ const Post = ({ index, post = {} }: PostProps) => {
const authorRole = subplebbit?.roles?.[post.author?.address]?.role;
const isInAllView = isAllView(location.pathname);
- const isInPostView = isPostView(location.pathname, params);
+ const isInPostPageView = isPostPageView(location.pathname, params);
const isInProfileHiddenView = isProfileHiddenView(location.pathname);
const isInSubplebbitView = isSubplebbitView(location.pathname, params);
const commentMediaInfo = useCommentMediaInfo(post);
- const [isExpanded, setIsExpanded] = useState(isInPostView);
+ const [isExpanded, setIsExpanded] = useState(isInPostPageView);
const toggleExpanded = () => setIsExpanded(!isExpanded);
const [isEditing, setIsEditing] = useState(false);
@@ -137,7 +137,7 @@ const Post = ({ index, post = {} }: PostProps) => {
const hasThumbnail = getHasThumbnail(commentMediaInfo, link);
const linkUrl = getHostname(link);
- const linkClass = `${isInPostView ? (link ? styles.externalLink : styles.internalLink) : styles.link} ${pinned ? styles.pinnedLink : ''}`;
+ const linkClass = `${isInPostPageView ? (link ? styles.externalLink : styles.internalLink) : styles.link} ${pinned ? styles.pinnedLink : ''}`;
const { blocked, unblock } = useBlock({ cid });
@@ -145,7 +145,7 @@ const Post = ({ index, post = {} }: PostProps) => {
const { subscribe, subscribed } = useSubscribe({ subplebbitAddress });
// show gray dotted border around last clicked post
- const isLastClicked = sessionStorage.getItem('lastClickedPost') === cid && !isInPostView;
+ const isLastClicked = sessionStorage.getItem('lastClickedPost') === cid && !isInPostPageView;
const handlePostClick = () => {
if (cid) {
if (sessionStorage.getItem('lastClickedPost') === cid) {
@@ -177,7 +177,7 @@ const Post = ({ index, post = {} }: PostProps) => {
cid && downvote()} />
- {hasThumbnail && (!isInPostView || commentMediaInfo?.type === 'webpage') && !spoiler && (
+ {hasThumbnail && (!isInPostPageView || commentMediaInfo?.type === 'webpage') && !spoiler && (
{
-
- {isInPostView && link ? (
+
+ {isInPostPageView && link ? (
{postTitle ?? '-'}
@@ -219,7 +219,7 @@ const Post = ({ index, post = {} }: PostProps) => {
)}
- {!isInPostView && (!(commentMediaInfo?.type === 'webpage') || (commentMediaInfo?.type === 'webpage' && content?.trim().length > 0)) && (
+ {!isInPostPageView && (!(commentMediaInfo?.type === 'webpage') || (commentMediaInfo?.type === 'webpage' && content?.trim().length > 0)) && (
{
)}
{t('submitted')}
{getFormattedTimeAgo(timestamp)}{' '}
- {edit && isInPostView &&
{t('last_edited', { timestamp: getFormattedTimeAgo(edit.timestamp) })}} {t('post_by')}
+ {edit && isInPostPageView &&
{t('last_edited', { timestamp: getFormattedTimeAgo(edit.timestamp) })}}{' '}
+ {t('post_by')}
{
- if (blocked || (isInPostView && (deleted || removed) && childrenCount === 0)) {
+ if (blocked || (isInPostPageView && (deleted || removed) && childrenCount === 0)) {
setCollapsed(true);
}
- }, [blocked, isInPostView, deleted, removed, childrenCount]);
+ }, [blocked, isInPostPageView, deleted, removed, childrenCount]);
const handleCollapseButton = () => {
if (blocked) {
unblock();
diff --git a/src/components/sidebar/sidebar.module.css b/src/components/sidebar/sidebar.module.css
index 2b8f85e1..78d7c86e 100644
--- a/src/components/sidebar/sidebar.module.css
+++ b/src/components/sidebar/sidebar.module.css
@@ -318,3 +318,19 @@ a {
margin-top: 20px;
margin-bottom: 20px;
}
+
+.blockConfirm {
+ color: var(--red);
+}
+
+.blockConfirm span {
+ color: var(--text-info);
+ font-weight: 700;
+ cursor: pointer;
+}
+
+.blockSub {
+ font-weight: 700;
+ color: var(--text-info);
+ cursor: pointer;
+}
diff --git a/src/components/sidebar/sidebar.tsx b/src/components/sidebar/sidebar.tsx
index 51fde8fa..798c265e 100644
--- a/src/components/sidebar/sidebar.tsx
+++ b/src/components/sidebar/sidebar.tsx
@@ -1,3 +1,4 @@
+import { useState } from 'react';
import { Link, useLocation, useNavigate, useParams } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import Plebbit from '@plebbit/plebbit-js/dist/browser/index.js';
@@ -12,8 +13,8 @@ import {
isAllView,
isHomeAboutView,
isHomeView,
- isPendingView,
- isPostView,
+ isPendingPostView,
+ isPostPageView,
isSubplebbitAboutView,
isSubplebbitSettingsView,
isSubplebbitsView,
@@ -219,8 +220,8 @@ const Sidebar = ({ comment, isSubCreatedButNotYetPublished, settings, subplebbit
const isInAllView = isAllView(location.pathname);
const isInHomeAboutView = isHomeAboutView(location.pathname);
const isInHomeView = isHomeView(location.pathname);
- const isInPendingView = isPendingView(location.pathname, params);
- const isInPostView = isPostView(location.pathname, params);
+ const isInPendingPostView = isPendingPostView(location.pathname, params);
+ const isInPostPageView = isPostPageView(location.pathname, params);
const isInSubplebbitsView = isSubplebbitsView(location.pathname);
const isInSubplebbitAboutView = isSubplebbitAboutView(location.pathname, params);
@@ -229,20 +230,27 @@ const Sidebar = ({ comment, isSubCreatedButNotYetPublished, settings, subplebbit
const subplebbitCreator = findSubplebbitCreator(roles);
const creatorAddress = subplebbitCreator === 'anonymous' ? 'anonymous' : `${Plebbit.getShortAddress(subplebbitCreator)}`;
const submitRoute =
- isInHomeView || isInHomeAboutView || isInAllView ? '/submit' : isInPendingView ? `/p/${pendingPost?.subplebbitAddress}/submit` : `/p/${address}/submit`;
+ isInHomeView || isInHomeAboutView || isInAllView ? '/submit' : isInPendingPostView ? `/p/${pendingPost?.subplebbitAddress}/submit` : `/p/${address}/submit`;
const { blocked, unblock, block } = useBlock({ address });
+ const [showBlockConfirm, setShowBlockConfirm] = useState(false);
+
const blockConfirm = () => {
+ setShowBlockConfirm(true);
+ };
+
+ const handleBlock = () => {
if (blocked) {
- if (window.confirm(t('unblock_community_alert'))) {
- unblock();
- }
- } else if (!blocked) {
- if (window.confirm(t('block_community_alert'))) {
- block();
- }
+ unblock();
+ } else {
+ block();
}
+ setShowBlockConfirm(false);
+ };
+
+ const cancelBlock = () => {
+ setShowBlockConfirm(false);
};
const account = useAccount();
@@ -271,7 +279,7 @@ const Sidebar = ({ comment, isSubCreatedButNotYetPublished, settings, subplebbit
return (
- {isInPostView &&
}
+ {isInPostPageView &&
}
{/* TODO: add .largeButtonDisabled and disabledButtonDescription classnames for subs that don't accept posts */}
@@ -279,7 +287,7 @@ const Sidebar = ({ comment, isSubCreatedButNotYetPublished, settings, subplebbit
- {!isInHomeView && !isInHomeAboutView && !isInAllView && !isInPendingView && !isInSubplebbitsView && !isInHomeAboutView && (
+ {!isInHomeView && !isInHomeAboutView && !isInAllView && !isInPendingPostView && !isInSubplebbitsView && !isInHomeAboutView && (
{subplebbit?.address}
@@ -312,9 +320,22 @@ const Sidebar = ({ comment, isSubCreatedButNotYetPublished, settings, subplebbit
{`u/${creatorAddress}`}
{createdAt &&
{t('community_for', { date: getFormattedTimeDuration(createdAt) })}}
-
- {blocked ? t('unblock_community') : t('block_community')}
-
+ {showBlockConfirm ? (
+
+ {t('are_you_sure')}{' '}
+
+ {t('yes')}
+
+ {' / '}
+
+ {t('no')}
+
+
+ ) : (
+
+ {blocked ? t('unblock_community') : t('block_community')}
+
+ )}
diff --git a/src/hooks/use-comment-media-info.ts b/src/hooks/use-comment-media-info.ts
index 711fa75e..1d2600c0 100644
--- a/src/hooks/use-comment-media-info.ts
+++ b/src/hooks/use-comment-media-info.ts
@@ -1,17 +1,26 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
+import { useLocation, useParams } from 'react-router-dom';
import { Comment } from '@plebbit/plebbit-react-hooks';
import { getCommentMediaInfo, fetchWebpageThumbnailIfNeeded } from '../lib/utils/media-utils';
+import { isPendingPostView, isPostPageView } from '../lib/utils/view-utils';
export const useCommentMediaInfo = (comment: Comment) => {
+ const location = useLocation();
+ const params = useParams();
+ const isInPostPageView = isPostPageView(location.pathname, params);
+ const isInPendingPostView = isPendingPostView(location.pathname, params);
// some sites have CORS access, so the thumbnail can be fetched client-side, which is helpful if subplebbit.settings.fetchThumbnailUrls is false
const initialCommentMediaInfo = useMemo(() => getCommentMediaInfo(comment), [comment]);
const [commentMediaInfo, setCommentMediaInfo] = useState(initialCommentMediaInfo);
const fetchThumbnail = useCallback(async () => {
+ if (!isInPostPageView && !isInPendingPostView) {
+ return; // don't fetch in feed view, it displaces the posts
+ }
if (initialCommentMediaInfo?.type === 'webpage' && !initialCommentMediaInfo.thumbnail) {
const newMediaInfo = await fetchWebpageThumbnailIfNeeded(initialCommentMediaInfo);
setCommentMediaInfo(newMediaInfo);
}
- }, [initialCommentMediaInfo]);
+ }, [initialCommentMediaInfo, isInPostPageView, isInPendingPostView]);
useEffect(() => {
fetchThumbnail();
}, [fetchThumbnail]);
diff --git a/src/lib/utils/view-utils.ts b/src/lib/utils/view-utils.ts
index 07073e54..898e0605 100644
--- a/src/lib/utils/view-utils.ts
+++ b/src/lib/utils/view-utils.ts
@@ -85,11 +85,11 @@ export const isInboxUnreadView = (pathname: string): boolean => {
return pathname === `/inbox/unread`;
};
-export const isPendingView = (pathname: string, params: ParamsType): boolean => {
+export const isPendingPostView = (pathname: string, params: ParamsType): boolean => {
return pathname === `/profile/${params.accountCommentIndex}`;
};
-export const isPostView = (pathname: string, params: ParamsType): boolean => {
+export const isPostPageView = (pathname: string, params: ParamsType): boolean => {
// some subs might use emojis in their address, so we need to decode the pathname
const decodedPathname = decodeURIComponent(pathname);
return params.subplebbitAddress && params.commentCid ? decodedPathname.startsWith(`/p/${params.subplebbitAddress}/c/${params.commentCid}`) : false;
diff --git a/src/themes.css b/src/themes.css
index 701c6e72..7acc7de6 100644
--- a/src/themes.css
+++ b/src/themes.css
@@ -53,7 +53,7 @@
--pagination-button-border-hover: 1px solid #5a728a;
--play-button: url("/public/assets/buttons/play-button-dark.png");
--play-button-hover: url("/public/assets/buttons/play-button-hover.png");
- --red: rgb(200, 0, 0);
+ --red: rgb(255, 21, 21);
--removed-reply-backgrouhd-color: rgb(27, 30, 32);
--text: #bfbfbf;
--text-button: url("/public/assets/buttons/text-button-dark.png");
diff --git a/src/views/pending-post/pending-post.module.css b/src/views/pending-post/pending-post.module.css
index 87b36837..9e167eac 100644
--- a/src/views/pending-post/pending-post.module.css
+++ b/src/views/pending-post/pending-post.module.css
@@ -1,5 +1,5 @@
.container {
- padding: 7px 5px 0px 5px;
+ padding: 7px 5px 32px 5px;
}
.stateString {
diff --git a/src/views/post-page/post-page.module.css b/src/views/post-page/post-page.module.css
index 9a9df228..5229e5b8 100644
--- a/src/views/post-page/post-page.module.css
+++ b/src/views/post-page/post-page.module.css
@@ -1,5 +1,5 @@
.content {
- padding: 7px 5px 0px 5px;
+ padding: 7px 5px 32px 5px;
}
.replyArea {
@@ -38,11 +38,6 @@
margin-right: 15px;
}
-.loadingString {
- padding: 5px;
- position: absolute;
-}
-
.dropdown {
display: inline;
position: relative;
@@ -87,12 +82,13 @@
margin-left: 3px;
}
+.loadingString {
+ padding: 5px;
+}
+
.stateString {
- white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
- width: calc(100vw - 28px);
- width: 100vw;
color: var(--text-info);
font-size: x-small;
}
diff --git a/src/views/post-page/post-page.tsx b/src/views/post-page/post-page.tsx
index 98e38245..f8377629 100644
--- a/src/views/post-page/post-page.tsx
+++ b/src/views/post-page/post-page.tsx
@@ -10,7 +10,7 @@ import PostComponent from '../../components/post';
import Sidebar from '../../components/sidebar';
import useReplies from '../../hooks/use-replies';
import useStateString from '../../hooks/use-state-string';
-import { isPendingView, isPostContextView } from '../../lib/utils/view-utils';
+import { isPendingPostView, isPostContextView } from '../../lib/utils/view-utils';
import findTopParentCidOfReply from '../../lib/utils/cid-utils';
import _ from 'lodash';
@@ -148,7 +148,7 @@ const PostWithContext = ({ post }: { post: Comment }) => {
const PostPage = () => {
const params = useParams();
const location = useLocation();
- const isInPendingView = isPendingView(location.pathname, params);
+ const isInPendingPostView = isPendingPostView(location.pathname, params);
const isInPostContextView = isPostContextView(location.pathname, params, location.search);
const post = useComment({ commentCid: params?.commentCid });
@@ -169,7 +169,7 @@ const PostPage = () => {
- {isInPendingView && params?.accountCommentIndex ? (
+ {isInPendingPostView && params?.accountCommentIndex ? (
) : isInPostContextView ? (
diff --git a/src/views/profile/profile.module.css b/src/views/profile/profile.module.css
index c0f95cf1..2dbc528d 100644
--- a/src/views/profile/profile.module.css
+++ b/src/views/profile/profile.module.css
@@ -1,5 +1,5 @@
.content {
- padding: 7px 5px 0px 5px;
+ padding: 7px 5px 32px 5px;
}
.infobar {
diff --git a/src/views/settings/address-settings/address-settings.tsx b/src/views/settings/address-settings/address-settings.tsx
index 904b1d3c..98dd90f7 100644
--- a/src/views/settings/address-settings/address-settings.tsx
+++ b/src/views/settings/address-settings/address-settings.tsx
@@ -8,7 +8,7 @@ const AddressSettings = () => {
const account = useAccount();
const [cryptoState, setCryptoState] = useState({
- cryptoAddress: '',
+ cryptoAddress: account?.author?.shortAddress.includes('.') ? account.author.shortAddress : '',
checkingCryptoAddress: false,
showResolvingMessage: false,
resolveString: t('crypto_address_verification'),
@@ -58,6 +58,12 @@ const AddressSettings = () => {
if (!cryptoState.cryptoAddress || !cryptoState.cryptoAddress.includes('.')) {
alert(t('enter_crypto_address'));
return;
+ } else if (cryptoState.cryptoAddress === account?.author?.address) {
+ setSavedCryptoAddress(true);
+ setTimeout(() => {
+ setSavedCryptoAddress(false);
+ }, 2000);
+ return;
} else if (resolvedAddress && resolvedAddress !== account?.signer?.address) {
alert(t('crypto_address_not_yours'));
return;
@@ -107,7 +113,7 @@ const AddressSettings = () => {
setCryptoState((prevState) => ({ ...prevState, cryptoAddress: e.target.value }))}
/>
+
+ {t('timestamp')}
+ setTimestamp(Number(e.target.value))}
+ />
+
{t('paste_signature')}
;
maticRpcRef?: RefObject
;
avaxRpcRef?: RefObject;
+ httpRoutersRef?: RefObject;
plebbitRpcRef?: RefObject;
plebbitDataPathRef?: RefObject;
}
@@ -68,6 +69,19 @@ const PubsubProvidersSettings = ({ pubsubProvidersRef }: SettingsProps) => {
);
};
+const HttpRoutersSettings = ({ httpRoutersRef }: SettingsProps) => {
+ const account = useAccount();
+ const { plebbitOptions } = account || {};
+ const { httpRoutersOptions } = plebbitOptions || {};
+ const httpRoutersDefaultValue = httpRoutersOptions?.join('\n');
+
+ return (
+
+
+
+ );
+};
+
const BlockchainProvidersSettings = ({ ethRpcRef, solRpcRef, maticRpcRef, avaxRpcRef }: SettingsProps) => {
const account = useAccount();
const { plebbitOptions } = account || {};
@@ -159,19 +173,50 @@ const PlebbitOptions = () => {
const solRpcRef = useRef(null);
const maticRpcRef = useRef(null);
const avaxRpcRef = useRef(null);
+ const httpRoutersRef = useRef(null);
const plebbitRpcRef = useRef(null);
const plebbitDataPathRef = useRef(null);
const handleSave = async () => {
- const ipfsGatewayUrls = ipfsGatewayUrlsRef.current?.value.split('\n').map((url) => url.trim());
+ const ipfsGatewayUrls = ipfsGatewayUrlsRef.current?.value
+ .split('\n')
+ .map((url) => url.trim())
+ .filter((url) => url !== '');
+
const mediaIpfsGatewayUrl = mediaIpfsGatewayUrlRef.current?.value.trim();
- const pubsubHttpClientsOptions = pubsubProvidersRef.current?.value.split('\n').map((url) => url.trim());
- const ethRpcUrls = ethRpcRef.current?.value.split('\n').map((url) => url.trim());
- const solRpcUrls = solRpcRef.current?.value.split('\n').map((url) => url.trim());
- const maticRpcUrls = maticRpcRef.current?.value.split('\n').map((url) => url.trim());
- const avaxRpcUrls = avaxRpcRef.current?.value.split('\n').map((url) => url.trim());
- const plebbitRpcClientsOptions = plebbitRpcRef.current?.value.trim();
- const dataPath = plebbitDataPathRef.current?.value.trim();
+
+ const pubsubHttpClientsOptions = pubsubProvidersRef.current?.value
+ .split('\n')
+ .map((url) => url.trim())
+ .filter((url) => url !== '');
+
+ const ethRpcUrls = ethRpcRef.current?.value
+ .split('\n')
+ .map((url) => url.trim())
+ .filter((url) => url !== '');
+
+ const solRpcUrls = solRpcRef.current?.value
+ .split('\n')
+ .map((url) => url.trim())
+ .filter((url) => url !== '');
+
+ const maticRpcUrls = maticRpcRef.current?.value
+ .split('\n')
+ .map((url) => url.trim())
+ .filter((url) => url !== '');
+
+ const avaxRpcUrls = avaxRpcRef.current?.value
+ .split('\n')
+ .map((url) => url.trim())
+ .filter((url) => url !== '');
+
+ const httpRoutersOptions = httpRoutersRef.current?.value
+ .split('\n')
+ .map((url) => url.trim())
+ .filter((url) => url !== '');
+
+ const plebbitRpcClientsOptions = plebbitRpcRef.current?.value.trim() ? [plebbitRpcRef.current.value.trim()] : undefined;
+ const dataPath = plebbitDataPathRef.current?.value.trim() || undefined;
const chainProviders = {
eth: {
@@ -201,11 +246,13 @@ const PlebbitOptions = () => {
ipfsGatewayUrls,
pubsubHttpClientsOptions,
chainProviders,
+ httpRoutersOptions,
plebbitRpcClientsOptions,
dataPath,
},
});
- alert('Options saved.');
+ alert('Options saved, reloading...');
+ window.location.reload();
} catch (e) {
if (e instanceof Error) {
alert('Error saving options: ' + e.message);
@@ -230,6 +277,12 @@ const PlebbitOptions = () => {
+
+ http routers
+
+
+
+
blockchain providers