feat: add shared cross-platform catbox media upload flow

Added `useFileUpload()` and `uploadToCatbox()` to centralize upload behavior and remove duplicated upload code from `post-form.tsx` and `reply-modal.tsx`. The flow now routes Android to `FileUploader`, Electron to hidden-input + catbox upload, and web to a translated fallback alert with consistent upload UI state.
This commit is contained in:
plebeius
2026-02-17 16:44:16 +08:00
parent 9c558d21c1
commit dbbc83d369
42 changed files with 545 additions and 118 deletions
+4 -1
View File
@@ -281,5 +281,8 @@
"posts_auto_update_info": "پوسٹس ہر ~2 منٹ میں خود بخود اپ ڈیٹ ہوتے ہیں۔ فی الوقت اس کو غیر فعال کرنا ممکن نہیں ہے۔",
"board_address_tooltip": "اس بورڈ کے پیر ٹو پیر نوڈ کا پتہ",
"vote_button_unavailable_intro": "ابھی دستیاب نہیں۔ صارفین اپنے خود کے بورڈز جمع کر سکیں گے اور ان کے لیے ووٹ دے سکیں گے، جیسے /{{boardIdentifier}}/ کے لیے ڈائریکٹری سلاٹس کے لیے مقابلہ کرنے کے لیے۔",
"vote_button_unavailable_outro": "سب سے زیادہ ووٹ والا /{{boardIdentifier}}/ سرکاری /{{boardIdentifier}}/ بن جاتا ہے۔"
"vote_button_unavailable_outro": "سب سے زیادہ ووٹ والا /{{boardIdentifier}}/ سرکاری /{{boardIdentifier}}/ بن جاتا ہے۔",
"upload_failed": "Upload failed",
"upload_not_supported_web": "Uploading media isn't supported by your browser due to technical limitations (CORS). It is supported in the 5chan Android app and Mac/Linux/Windows desktop app. Download from the official release page: https://github.com/bitsocialhq/5chan/releases/latest",
"file": "File"
}