diff --git a/public/translations/ar/default.json b/public/translations/ar/default.json index e8d1e9ba..1852fca0 100644 --- a/public/translations/ar/default.json +++ b/public/translations/ar/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "لا تعرض الصور الرمزية بجانب أسماء المستخدمين", "choose_file": "اختر ملف", "uploading": "جاري التحميل...", - "no_file_chosen": "لم يتم اختيار أي ملف" + "no_file_chosen": "لم يتم اختيار أي ملف", + "error": "خطأ" } \ No newline at end of file diff --git a/public/translations/bn/default.json b/public/translations/bn/default.json index 8c0014eb..560da3e5 100644 --- a/public/translations/bn/default.json +++ b/public/translations/bn/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "ব্যবহারকারীর প্রদর্শন নামের পাশে অ্যাভাটারগুলি দেখান না", "choose_file": "ফাইল নির্বাচন করুন", "uploading": "আপলোড হচ্ছে...", - "no_file_chosen": "কোন ফাইল নির্বাচিত নয়" + "no_file_chosen": "কোন ফাইল নির্বাচিত নয়", + "error": "ত্রুটি" } \ No newline at end of file diff --git a/public/translations/cs/default.json b/public/translations/cs/default.json index 5e2c8129..cf02e731 100644 --- a/public/translations/cs/default.json +++ b/public/translations/cs/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Nezobrazovat avatary vedle jmen uživatelů", "choose_file": "Vyberte soubor", "uploading": "nahrávání...", - "no_file_chosen": "Žádný soubor není vybrán" + "no_file_chosen": "Žádný soubor není vybrán", + "error": "Chyba" } \ No newline at end of file diff --git a/public/translations/da/default.json b/public/translations/da/default.json index be95dcee..a549137f 100644 --- a/public/translations/da/default.json +++ b/public/translations/da/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Vis ikke avatarer ved siden af brugernes visningsnavne", "choose_file": "Vælg fil", "uploading": "uploading...", - "no_file_chosen": "Ingen fil valgt" + "no_file_chosen": "Ingen fil valgt", + "error": "Fejl" } \ No newline at end of file diff --git a/public/translations/de/default.json b/public/translations/de/default.json index e3c10ae8..aea1cf63 100644 --- a/public/translations/de/default.json +++ b/public/translations/de/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Keine Avatare neben den Benutzernamen anzeigen", "choose_file": "Datei auswählen", "uploading": "Hochladen...", - "no_file_chosen": "Keine Datei ausgewählt" + "no_file_chosen": "Keine Datei ausgewählt", + "error": "Fehler" } \ No newline at end of file diff --git a/public/translations/el/default.json b/public/translations/el/default.json index 8b39cd4e..a9c4c312 100644 --- a/public/translations/el/default.json +++ b/public/translations/el/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Μην εμφανίζετε τα avatar δίπλα στα ονόματα εμφάνισης χρηστών", "choose_file": "Επιλέξτε αρχείο", "uploading": "ανέβασμα...", - "no_file_chosen": "Δεν έχει επιλεγεί αρχείο" + "no_file_chosen": "Δεν έχει επιλεγεί αρχείο", + "error": "Σφάλμα" } \ No newline at end of file diff --git a/public/translations/en/default.json b/public/translations/en/default.json index 575c5e95..fe047f4b 100644 --- a/public/translations/en/default.json +++ b/public/translations/en/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Don't display avatars next to user display names", "choose_file": "Choose File", "uploading": "uploading...", - "no_file_chosen": "No file chosen" + "no_file_chosen": "No file chosen", + "error": "Error" } \ No newline at end of file diff --git a/public/translations/es/default.json b/public/translations/es/default.json index cd0be076..6555d601 100644 --- a/public/translations/es/default.json +++ b/public/translations/es/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "No mostrar avatares junto a los nombres de usuario", "choose_file": "Elige archivo", "uploading": "subiendo...", - "no_file_chosen": "Ningún archivo elegido" + "no_file_chosen": "Ningún archivo elegido", + "error": "Error" } \ No newline at end of file diff --git a/public/translations/fa/default.json b/public/translations/fa/default.json index 37759d6f..ceeea01b 100644 --- a/public/translations/fa/default.json +++ b/public/translations/fa/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "تصاویر پروفایل را در کنار نام‌های نمایش کاربر نمایش ندهید", "choose_file": "فایل را انتخاب کنید", "uploading": "در حال بارگذاری...", - "no_file_chosen": "فایلی انتخاب نشده است" + "no_file_chosen": "فایلی انتخاب نشده است", + "error": "خطا" } \ No newline at end of file diff --git a/public/translations/fi/default.json b/public/translations/fi/default.json index 398adbcf..eb0c7c8c 100644 --- a/public/translations/fi/default.json +++ b/public/translations/fi/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Älä näytä avatareita käyttäjänäyttönimien vieressä", "choose_file": "Valitse tiedosto", "uploading": "lataaminen...", - "no_file_chosen": "Ei tiedostoa valittu" + "no_file_chosen": "Ei tiedostoa valittu", + "error": "Virhe" } \ No newline at end of file diff --git a/public/translations/fil/default.json b/public/translations/fil/default.json index 145c10fb..d19d4479 100644 --- a/public/translations/fil/default.json +++ b/public/translations/fil/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Huwag ipakita ang mga avatar sa tabi ng mga display name ng gumagamit", "choose_file": "Pumili ng File", "uploading": "ina-upload...", - "no_file_chosen": "Walang napiling file" + "no_file_chosen": "Walang napiling file", + "error": "Error" } \ No newline at end of file diff --git a/public/translations/fr/default.json b/public/translations/fr/default.json index 032f6d34..16387478 100644 --- a/public/translations/fr/default.json +++ b/public/translations/fr/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Ne pas afficher les avatars à côté des noms d'affichage des utilisateurs", "choose_file": "Choisissez un fichier", "uploading": "téléchargement...", - "no_file_chosen": "Aucun fichier choisi" + "no_file_chosen": "Aucun fichier choisi", + "error": "Erreur" } \ No newline at end of file diff --git a/public/translations/he/default.json b/public/translations/he/default.json index eccb51de..f5d50278 100644 --- a/public/translations/he/default.json +++ b/public/translations/he/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "אל תציג תמונות פרופיל לצד שמות המשתמשים", "choose_file": "בחר קובץ", "uploading": "מעלה...", - "no_file_chosen": "לא נבחר קובץ" + "no_file_chosen": "לא נבחר קובץ", + "error": "שגיאה" } \ No newline at end of file diff --git a/public/translations/hi/default.json b/public/translations/hi/default.json index 2d7c9368..a669b273 100644 --- a/public/translations/hi/default.json +++ b/public/translations/hi/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "उपयोगकर्ता प्रदर्शित नामों के बगल में अवतार न दिखाएं", "choose_file": "फाइल चुनें", "uploading": "अपलोड हो रहा है...", - "no_file_chosen": "कोई फ़ाइल नहीं चुनी गई" + "no_file_chosen": "कोई फ़ाइल नहीं चुनी गई", + "error": "त्रुटि" } \ No newline at end of file diff --git a/public/translations/hu/default.json b/public/translations/hu/default.json index a483d066..d69db622 100644 --- a/public/translations/hu/default.json +++ b/public/translations/hu/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Ne jelenjen meg az avatárok a felhasználói megjelenítési nevek mellett", "choose_file": "Válassza ki a fájlt", "uploading": "feltöltés...", - "no_file_chosen": "Nincs fájl kiválasztva" + "no_file_chosen": "Nincs fájl kiválasztva", + "error": "Hiba" } \ No newline at end of file diff --git a/public/translations/id/default.json b/public/translations/id/default.json index 0c70a52f..b487927d 100644 --- a/public/translations/id/default.json +++ b/public/translations/id/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Jangan tampilkan avatar di sebelah nama pengguna", "choose_file": "Pilih Berkas", "uploading": "mengupload...", - "no_file_chosen": "Tidak ada file yang dipilih" + "no_file_chosen": "Tidak ada file yang dipilih", + "error": "Kesalahan" } \ No newline at end of file diff --git a/public/translations/it/default.json b/public/translations/it/default.json index 302b2f0e..0e21f544 100644 --- a/public/translations/it/default.json +++ b/public/translations/it/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Non mostrare gli avatar accanto ai nomi visualizzati degli utenti", "choose_file": "Scegli File", "uploading": "caricamento...", - "no_file_chosen": "Nessun file scelto" + "no_file_chosen": "Nessun file scelto", + "error": "Errore" } \ No newline at end of file diff --git a/public/translations/ja/default.json b/public/translations/ja/default.json index feedec48..2f5950f0 100644 --- a/public/translations/ja/default.json +++ b/public/translations/ja/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "ユーザーの表示名の横にアバターを表示しない", "choose_file": "ファイルを選択", "uploading": "アップロード中...", - "no_file_chosen": "ファイルが選択されていません" + "no_file_chosen": "ファイルが選択されていません", + "error": "エラー" } \ No newline at end of file diff --git a/public/translations/ko/default.json b/public/translations/ko/default.json index 0ee96d4f..9b785613 100644 --- a/public/translations/ko/default.json +++ b/public/translations/ko/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "사용자 표시 이름 옆에 아바타를 표시하지 않음", "choose_file": "파일 선택", "uploading": "업로드 중...", - "no_file_chosen": "선택된 파일이 없습니다" + "no_file_chosen": "선택된 파일이 없습니다", + "error": "오류" } \ No newline at end of file diff --git a/public/translations/mr/default.json b/public/translations/mr/default.json index 1875acdf..ee6d5783 100644 --- a/public/translations/mr/default.json +++ b/public/translations/mr/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "युजर डिस्प्ले नावेच्या बरोबर अवतार दर्शवू नका", "choose_file": "फाइल निवडा", "uploading": "अपलोड करत आहे...", - "no_file_chosen": "कोणताही फाइल निवडलेली नाही" + "no_file_chosen": "कोणताही फाइल निवडलेली नाही", + "error": "त्रुटी" } \ No newline at end of file diff --git a/public/translations/nl/default.json b/public/translations/nl/default.json index c64d013a..329eae56 100644 --- a/public/translations/nl/default.json +++ b/public/translations/nl/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Toon geen avatar naast de weergavenamen van gebruikers", "choose_file": "Kies een bestand", "uploading": "uploaden...", - "no_file_chosen": "Geen bestand gekozen" + "no_file_chosen": "Geen bestand gekozen", + "error": "Fout" } \ No newline at end of file diff --git a/public/translations/no/default.json b/public/translations/no/default.json index 4e4aca08..7d86383a 100644 --- a/public/translations/no/default.json +++ b/public/translations/no/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Vis ikke avatarer ved siden av brukernes visningsnavn", "choose_file": "Velg fil", "uploading": "laster opp...", - "no_file_chosen": "Ingen fil valgt" + "no_file_chosen": "Ingen fil valgt", + "error": "Feil" } \ No newline at end of file diff --git a/public/translations/pl/default.json b/public/translations/pl/default.json index aff60eab..fa97196c 100644 --- a/public/translations/pl/default.json +++ b/public/translations/pl/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Nie wyświetlaj avatarów obok nazw wyświetlających użytkowników", "choose_file": "Wybierz plik", "uploading": "ładowanie...", - "no_file_chosen": "Nie wybrano żadnego pliku" + "no_file_chosen": "Nie wybrano żadnego pliku", + "error": "Błąd" } \ No newline at end of file diff --git a/public/translations/pt/default.json b/public/translations/pt/default.json index 839d79a2..93cda8ba 100644 --- a/public/translations/pt/default.json +++ b/public/translations/pt/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Não exiba avatares ao lado dos nomes de exibição dos usuários", "choose_file": "Escolher arquivo", "uploading": "carregando...", - "no_file_chosen": "Nenhum arquivo escolhido" + "no_file_chosen": "Nenhum arquivo escolhido", + "error": "Erro" } \ No newline at end of file diff --git a/public/translations/ro/default.json b/public/translations/ro/default.json index 9c21b0ed..1dd27a25 100644 --- a/public/translations/ro/default.json +++ b/public/translations/ro/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Nu afișa avatare lângă numele de afișare ale utilizatorilor", "choose_file": "Alegeți fișierul", "uploading": "încărcare...", - "no_file_chosen": "Niciun fișier ales" + "no_file_chosen": "Niciun fișier ales", + "error": "Eroare" } \ No newline at end of file diff --git a/public/translations/ru/default.json b/public/translations/ru/default.json index c4820886..b8fe4d00 100644 --- a/public/translations/ru/default.json +++ b/public/translations/ru/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Не показывать аватары рядом с именами пользователей", "choose_file": "Выбрать файл", "uploading": "загрузка...", - "no_file_chosen": "Файл не выбран" + "no_file_chosen": "Файл не выбран", + "error": "Ошибка" } \ No newline at end of file diff --git a/public/translations/sq/default.json b/public/translations/sq/default.json index e288efab..fb5a0a11 100644 --- a/public/translations/sq/default.json +++ b/public/translations/sq/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Mos e tregoni avatarët pranë emrave të shfaqjes së përdoruesve", "choose_file": "Zgjidhni skedarin", "uploading": "duke ngarkuar...", - "no_file_chosen": "Nuk është zgjedhur asnjë skedar" + "no_file_chosen": "Nuk është zgjedhur asnjë skedar", + "error": "Gabim" } \ No newline at end of file diff --git a/public/translations/sv/default.json b/public/translations/sv/default.json index e07b2369..3bc9a23d 100644 --- a/public/translations/sv/default.json +++ b/public/translations/sv/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Visa inte avatarer bredvid användarnas visningsnamn", "choose_file": "Välj fil", "uploading": "laddar upp...", - "no_file_chosen": "Ingen fil vald" + "no_file_chosen": "Ingen fil vald", + "error": "Fel" } \ No newline at end of file diff --git a/public/translations/te/default.json b/public/translations/te/default.json index 5832d2b8..961bbd04 100644 --- a/public/translations/te/default.json +++ b/public/translations/te/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "వాడుకరి ప్రదర్శన పేర్ల పక్కన అవతార్లు ప్రదర్శించవద్దు", "choose_file": "ఫైల్ ఎంపిక చేసుకోండి", "uploading": "అప్‌లోడ్ అవుతోంది...", - "no_file_chosen": "ఎటువంటి ఫైల్ ఎంపిక చేయబడలేదు" + "no_file_chosen": "ఎటువంటి ఫైల్ ఎంపిక చేయబడలేదు", + "error": "దోషం" } \ No newline at end of file diff --git a/public/translations/th/default.json b/public/translations/th/default.json index 065c6ed2..ec9c0111 100644 --- a/public/translations/th/default.json +++ b/public/translations/th/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "ไม่แสดงอวาตาร์ข้างชื่อผู้ใช้", "choose_file": "เลือกไฟล์", "uploading": "กำลังอัปโหลด...", - "no_file_chosen": "ไม่มีไฟล์ที่เลือก" + "no_file_chosen": "ไม่มีไฟล์ที่เลือก", + "error": "ข้อผิดพลาด" } \ No newline at end of file diff --git a/public/translations/tr/default.json b/public/translations/tr/default.json index 3dc58c06..d5e2e5c8 100644 --- a/public/translations/tr/default.json +++ b/public/translations/tr/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Kullanıcı görünüm adlarının yanında avatarları gösterme", "choose_file": "Dosya Seç", "uploading": "yükleniyor...", - "no_file_chosen": "Hiçbir dosya seçilmedi" + "no_file_chosen": "Hiçbir dosya seçilmedi", + "error": "Hata" } \ No newline at end of file diff --git a/public/translations/uk/default.json b/public/translations/uk/default.json index 6674a684..0f76dedc 100644 --- a/public/translations/uk/default.json +++ b/public/translations/uk/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Не показувати аватари поряд із іменами користувачів", "choose_file": "Виберіть файл", "uploading": "завантаження...", - "no_file_chosen": "Не вибрано жодного файлу" + "no_file_chosen": "Не вибрано жодного файлу", + "error": "Помилка" } \ No newline at end of file diff --git a/public/translations/ur/default.json b/public/translations/ur/default.json index df952355..31eab82a 100644 --- a/public/translations/ur/default.json +++ b/public/translations/ur/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "صارف کے ڈسپلے ناموں کے ساتھ اوتار نہ دکھائیں", "choose_file": "فائل منتخب کریں", "uploading": "اپ لوڈ ہو رہا ہے...", - "no_file_chosen": "کوئی فائل منتخب نہیں کی گئی" + "no_file_chosen": "کوئی فائل منتخب نہیں کی گئی", + "error": "غلطی" } \ No newline at end of file diff --git a/public/translations/vi/default.json b/public/translations/vi/default.json index 2049bc37..ea35b911 100644 --- a/public/translations/vi/default.json +++ b/public/translations/vi/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "Không hiển thị hình đại diện bên cạnh tên hiển thị của người dùng", "choose_file": "Chọn tệp", "uploading": "đang tải lên...", - "no_file_chosen": "Không có tệp nào được chọn" + "no_file_chosen": "Không có tệp nào được chọn", + "error": "Lỗi" } \ No newline at end of file diff --git a/public/translations/zh/default.json b/public/translations/zh/default.json index 0d767e12..487b0c78 100644 --- a/public/translations/zh/default.json +++ b/public/translations/zh/default.json @@ -259,5 +259,6 @@ "hide_avatars_tip": "不显示用户显示名称旁边的头像", "choose_file": "选择文件", "uploading": "正在上传...", - "no_file_chosen": "未选择任何文件" + "no_file_chosen": "未选择任何文件", + "error": "错误" } \ No newline at end of file diff --git a/src/components/reply-modal/reply-modal.module.css b/src/components/reply-modal/reply-modal.module.css index b35251ce..62c63430 100644 --- a/src/components/reply-modal/reply-modal.module.css +++ b/src/components/reply-modal/reply-modal.module.css @@ -138,4 +138,15 @@ .title { cursor: default; } +} + +.error { + width: 294px; + font-family: monospace; + background-color: #E62020; + font-size: 12px; + color: white; + padding: 3px 5px; + margin-top: 1px; + text-shadow: 0 1px rgba(0, 0, 0, 0.20); } \ 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 00de03b0..9073ab70 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -72,20 +72,23 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s } }, [address, getExistingSigner, getNewSigner, setPublishReplyOptions, anonMode, displayName]); + const [error, setError] = useState(null); + const onPublishReply = () => { const currentContent = textRef.current?.value.slice(contentPrefix.length).trim() || ''; const currentUrl = urlRef.current?.value.trim() || ''; if (!currentContent && !currentUrl) { - alert(t('empty_comment_alert')); + setError(t('empty_comment_alert')); return; } if (currentUrl && !isValidURL(currentUrl)) { - alert(t('invalid_url_alert')); + setError(t('invalid_url_alert')); return; } + setError(null); publishReply(); }; @@ -190,11 +193,11 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s } } } catch (error) { - console.error('Upload failed:', error); + console.error('Upload failed, ', error); if (error instanceof Error && error.message !== 'File selection cancelled') { - alert(`${t('upload_failed')}: ${error.message}`); + setError(`${t('upload_failed')}, ${error.message}`); } else if (typeof error === 'string' && error !== 'File selection cancelled') { - alert(`${t('upload_failed')}: ${error}`); + setError(`${t('upload_failed')}, ${error}`); } } finally { setIsUploading(false); @@ -279,6 +282,11 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s {t('post')} + {error && ( +
+ {t('error')}: {error} +
+ )} );