From 4286551b128f88d660b7c0bb44d50df25b7fd97c Mon Sep 17 00:00:00 2001 From: codytseng Date: Sun, 27 Jul 2025 22:12:37 +0800 Subject: [PATCH] feat: poll content preview --- src/components/ContentPreview/index.tsx | 8 ++++++++ src/i18n/locales/ar.ts | 3 ++- src/i18n/locales/de.ts | 3 ++- src/i18n/locales/en.ts | 3 ++- src/i18n/locales/es.ts | 3 ++- src/i18n/locales/fa.ts | 3 ++- src/i18n/locales/fr.ts | 3 ++- src/i18n/locales/it.ts | 3 ++- src/i18n/locales/ja.ts | 3 ++- src/i18n/locales/ko.ts | 3 ++- src/i18n/locales/pl.ts | 3 ++- src/i18n/locales/pt-BR.ts | 3 ++- src/i18n/locales/pt-PT.ts | 3 ++- src/i18n/locales/ru.ts | 3 ++- src/i18n/locales/th.ts | 3 ++- src/i18n/locales/zh.ts | 3 ++- 16 files changed, 38 insertions(+), 15 deletions(-) diff --git a/src/components/ContentPreview/index.tsx b/src/components/ContentPreview/index.tsx index e76cff0f..a02ec279 100644 --- a/src/components/ContentPreview/index.tsx +++ b/src/components/ContentPreview/index.tsx @@ -48,6 +48,14 @@ export default function ContentPreview({ ) } + if (event.kind === ExtendedKind.POLL) { + return ( +
+ [{t('Poll')}] {event.content} +
+ ) + } + if (event.kind === kinds.LongFormArticle) { return } diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts index dff5f388..e327bf5b 100644 --- a/src/i18n/locales/ar.ts +++ b/src/i18n/locales/ar.ts @@ -312,6 +312,7 @@ export default { 'Clear end date': 'مسح تاريخ الانتهاء', 'Relay URLs (optional, comma-separated)': 'عناوين المرحلات (اختياري، مفصولة بفواصل)', 'Remove poll': 'إزالة الاستطلاع', - 'Refresh results': 'تحديث النتائج' + 'Refresh results': 'تحديث النتائج', + Poll: 'استطلاع' } } diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index 09b56afd..d962e996 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -319,6 +319,7 @@ export default { 'Clear end date': 'Enddatum löschen', 'Relay URLs (optional, comma-separated)': 'Relay-URLs (optional, durch Kommas getrennt)', 'Remove poll': 'Umfrage entfernen', - 'Refresh results': 'Ergebnisse aktualisieren' + 'Refresh results': 'Ergebnisse aktualisieren', + Poll: 'Umfrage' } } diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 18d35e33..98f99a25 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -312,6 +312,7 @@ export default { 'Clear end date': 'Clear end date', 'Relay URLs (optional, comma-separated)': 'Relay URLs (optional, comma-separated)', 'Remove poll': 'Remove poll', - 'Refresh results': 'Refresh results' + 'Refresh results': 'Refresh results', + Poll: 'Poll' } } diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index a59a8d4b..497e94a6 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -317,6 +317,7 @@ export default { 'Clear end date': 'Borrar fecha de finalización', 'Relay URLs (optional, comma-separated)': 'URLs de relé (opcional, separadas por comas)', 'Remove poll': 'Eliminar encuesta', - 'Refresh results': 'Actualizar resultados' + 'Refresh results': 'Actualizar resultados', + Poll: 'Encuesta' } } diff --git a/src/i18n/locales/fa.ts b/src/i18n/locales/fa.ts index 2b31c6d3..42844f89 100644 --- a/src/i18n/locales/fa.ts +++ b/src/i18n/locales/fa.ts @@ -314,6 +314,7 @@ export default { 'Clear end date': 'پاک کردن تاریخ پایان', 'Relay URLs (optional, comma-separated)': 'آدرس‌های رله (اختیاری، جدا شده با کاما)', 'Remove poll': 'حذف نظرسنجی', - 'Refresh results': 'بارگیری مجدد نتایج' + 'Refresh results': 'بارگیری مجدد نتایج', + Poll: 'نظرسنجی' } } diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index f2a70b57..c3b8c34f 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -318,6 +318,7 @@ export default { 'Relay URLs (optional, comma-separated)': 'URLs de relais (optionnel, séparées par des virgules)', 'Remove poll': 'Supprimer le sondage', - 'Refresh results': 'Rafraîchir les résultats' + 'Refresh results': 'Rafraîchir les résultats', + Poll: 'Sondage' } } diff --git a/src/i18n/locales/it.ts b/src/i18n/locales/it.ts index e2b7a19d..8ca0255b 100644 --- a/src/i18n/locales/it.ts +++ b/src/i18n/locales/it.ts @@ -316,6 +316,7 @@ export default { 'Clear end date': 'Cancella data di fine', 'Relay URLs (optional, comma-separated)': 'URL relay (opzionale, separati da virgole)', 'Remove poll': 'Rimuovi sondaggio', - 'Refresh results': 'Aggiorna risultati' + 'Refresh results': 'Aggiorna risultati', + Poll: 'Sondaggio' } } diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index c58f7f86..bb3c642c 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -314,6 +314,7 @@ export default { 'Clear end date': '終了日をクリア', 'Relay URLs (optional, comma-separated)': 'リレーURL(任意、カンマ区切り)', 'Remove poll': '投票を削除', - 'Refresh results': '結果を更新' + 'Refresh results': '結果を更新', + Poll: '投票' } } diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts index fe2b3de0..54b60704 100644 --- a/src/i18n/locales/ko.ts +++ b/src/i18n/locales/ko.ts @@ -314,6 +314,7 @@ export default { 'Clear end date': '종료 날짜 지우기', 'Relay URLs (optional, comma-separated)': '릴레이 URL (선택사항, 쉼표로 구분)', 'Remove poll': '투표 제거', - 'Refresh results': '결과 새로 고침' + 'Refresh results': '결과 새로 고침', + Poll: '투표' } } diff --git a/src/i18n/locales/pl.ts b/src/i18n/locales/pl.ts index ea58fc3c..91d0ac3c 100644 --- a/src/i18n/locales/pl.ts +++ b/src/i18n/locales/pl.ts @@ -316,6 +316,7 @@ export default { 'Relay URLs (optional, comma-separated)': 'Adresy URL przekaźników (opcjonalne, oddzielone przecinkami)', 'Remove poll': 'Usuń ankietę', - 'Refresh results': 'Odśwież wyniki' + 'Refresh results': 'Odśwież wyniki', + Poll: 'Ankieta' } } diff --git a/src/i18n/locales/pt-BR.ts b/src/i18n/locales/pt-BR.ts index 760ba78e..42e0e88a 100644 --- a/src/i18n/locales/pt-BR.ts +++ b/src/i18n/locales/pt-BR.ts @@ -315,6 +315,7 @@ export default { 'Clear end date': 'Limpar data de término', 'Relay URLs (optional, comma-separated)': 'URLs de relay (opcional, separadas por vírgulas)', 'Remove poll': 'Remover enquete', - 'Refresh results': 'Atualizar resultados' + 'Refresh results': 'Atualizar resultados', + Poll: 'Enquete' } } diff --git a/src/i18n/locales/pt-PT.ts b/src/i18n/locales/pt-PT.ts index 49e1632a..ee78a469 100644 --- a/src/i18n/locales/pt-PT.ts +++ b/src/i18n/locales/pt-PT.ts @@ -316,6 +316,7 @@ export default { 'Clear end date': 'Limpar data de fim', 'Relay URLs (optional, comma-separated)': 'URLs de relay (opcional, separadas por vírgulas)', 'Remove poll': 'Remover sondagem', - 'Refresh results': 'Atualizar resultados' + 'Refresh results': 'Atualizar resultados', + Poll: 'Sondagem' } } diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index eaf2cb85..19725db5 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -317,6 +317,7 @@ export default { 'Clear end date': 'Очистить дату окончания', 'Relay URLs (optional, comma-separated)': 'URL релеев (необязательно, через запятую)', 'Remove poll': 'Удалить опрос', - 'Refresh results': 'Обновить результаты' + 'Refresh results': 'Обновить результаты', + Poll: 'Опрос' } } diff --git a/src/i18n/locales/th.ts b/src/i18n/locales/th.ts index 20304b4c..52e35814 100644 --- a/src/i18n/locales/th.ts +++ b/src/i18n/locales/th.ts @@ -311,6 +311,7 @@ export default { 'Clear end date': 'ล้างวันที่สิ้นสุด', 'Relay URLs (optional, comma-separated)': 'URL รีเลย์ (ไม่บังคับ, คั่นด้วยจุลภาค)', 'Remove poll': 'ลบโพลล์', - 'Refresh results': 'รีเฟรชผลลัพธ์' + 'Refresh results': 'รีเฟรชผลลัพธ์', + Poll: 'โพลล์' } } diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index b7786616..e345c6df 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -312,6 +312,7 @@ export default { 'Clear end date': '清除结束日期', 'Relay URLs (optional, comma-separated)': '中继服务器 URL(可选,逗号分隔)', 'Remove poll': '移除投票', - 'Refresh results': '刷新结果' + 'Refresh results': '刷新结果', + Poll: '投票' } }