diff --git a/src/App.tsx b/src/App.tsx index 0e82a0e..5c9e8a5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3338,13 +3338,20 @@ function App() { }} > - {message.paymentFee ? 'Payment' : 'Publish'} + {message.paymentFee + ? t('core:payment', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:publish', { + postProcess: 'capitalizeFirstChar', + })} {message.message} + {message?.paymentFee && ( {t('core:fee.payment', { @@ -3353,6 +3360,7 @@ function App() { : {message.paymentFee} )} + {message?.publishFee && ( {t('core:fee.publish', { diff --git a/src/common/ImageUploader.tsx b/src/common/ImageUploader.tsx index f21c17f..e820a53 100644 --- a/src/common/ImageUploader.tsx +++ b/src/common/ImageUploader.tsx @@ -1,44 +1,48 @@ -import React, { useCallback } from 'react' -import { Box } from '@mui/material' -import { useDropzone, DropzoneRootProps, DropzoneInputProps } from 'react-dropzone' -import Compressor from 'compressorjs' +import React, { useCallback } from 'react'; +import { Box } from '@mui/material'; +import { + useDropzone, + DropzoneRootProps, + DropzoneInputProps, +} from 'react-dropzone'; +import Compressor from 'compressorjs'; const toBase64 = (file: File): Promise => new Promise((resolve, reject) => { - const reader = new FileReader() - reader.readAsDataURL(file) - reader.onload = () => resolve(reader.result) + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); reader.onerror = (error) => { - reject(error) - } - }) + reject(error); + }; + }); // TODO toBase64 seems unused. Remove? interface ImageUploaderProps { - children: React.ReactNode - onPick: (file: File) => void + children: React.ReactNode; + onPick: (file: File) => void; } const ImageUploader: React.FC = ({ children, onPick }) => { const onDrop = useCallback( async (acceptedFiles: File[]) => { if (acceptedFiles.length > 1) { - return + return; } - const image = acceptedFiles[0] - let compressedFile: File | undefined + const image = acceptedFiles[0]; + let compressedFile: File | undefined; try { // Check if the file is a GIF if (image.type === 'image/gif') { // Check if the GIF is larger than 500 KB if (image.size > 500 * 1024) { - console.error('GIF file size exceeds 500KB limit.') - return + console.error('GIF file size exceeds 500KB limit.'); + return; } // No compression for GIF, pass the original file - compressedFile = image + compressedFile = image; } else { // For non-GIF files, compress them await new Promise((resolve) => { @@ -48,55 +52,55 @@ const ImageUploader: React.FC = ({ children, onPick }) => { mimeType: 'image/webp', success(result) { const file = new File([result], image.name, { - type: 'image/webp' - }) - compressedFile = file - resolve() + type: 'image/webp', + }); + compressedFile = file; + resolve(); }, error(err) { - console.error('Compression error:', err) - resolve() // Proceed even if there's an error - } - }) - }) + console.error('Compression error:', err); + resolve(); // Proceed even if there's an error + }, + }); + }); } - if (!compressedFile) return + if (!compressedFile) return; - onPick(compressedFile) + onPick(compressedFile); } catch (error) { - console.error('File processing error:', error) + console.error('File processing error:', error); } }, [onPick] - ) + ); const { getRootProps, getInputProps, - isDragActive + isDragActive, }: { - getRootProps: () => DropzoneRootProps - getInputProps: () => DropzoneInputProps - isDragActive: boolean + getRootProps: () => DropzoneRootProps; + getInputProps: () => DropzoneInputProps; + isDragActive: boolean; } = useDropzone({ onDrop, accept: { - 'image/*': [] - } - }) + 'image/*': [], + }, + }); return ( {children} - ) -} + ); +}; -export default ImageUploader +export default ImageUploader; diff --git a/src/common/customloader.css b/src/common/customloader.css index c16d21d..d35f2b4 100644 --- a/src/common/customloader.css +++ b/src/common/customloader.css @@ -7,34 +7,34 @@ } .lds-ellipsis { display: inline-block; + height: 80px; position: relative; width: 80px; - height: 80px; } .lds-ellipsis div { + animation-timing-function: cubic-bezier(0, 1, 1, 0); + background: currentColor; + border-radius: 50%; + height: 13.33333px; position: absolute; top: 33.33333px; width: 13.33333px; - height: 13.33333px; - border-radius: 50%; - background: currentColor; - animation-timing-function: cubic-bezier(0, 1, 1, 0); } .lds-ellipsis div:nth-child(1) { - left: 8px; animation: lds-ellipsis1 0.6s infinite; + left: 8px; } .lds-ellipsis div:nth-child(2) { - left: 8px; animation: lds-ellipsis2 0.6s infinite; + left: 8px; } .lds-ellipsis div:nth-child(3) { - left: 32px; animation: lds-ellipsis2 0.6s infinite; + left: 32px; } .lds-ellipsis div:nth-child(4) { - left: 56px; animation: lds-ellipsis3 0.6s infinite; + left: 56px; } @keyframes lds-ellipsis1 { diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json index c742aca..ffcee9a 100644 --- a/src/i18n/locales/en/core.json +++ b/src/i18n/locales/en/core.json @@ -331,9 +331,11 @@ "previous": "previous" }, "payment_notification": "payment notification", + "payment": "payment", "poll_embed": "poll embed", "port": "port", "price": "price", + "publish": "publish", "q_apps": { "about": "about this Q-App", "q_mail": "q-mail", diff --git a/src/i18n/locales/es/core.json b/src/i18n/locales/es/core.json index 375a172..d6310f0 100644 --- a/src/i18n/locales/es/core.json +++ b/src/i18n/locales/es/core.json @@ -243,13 +243,13 @@ "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", "name_unavailable": "{{ name }} is unavailable", "no_data_image": "No hay datos para la imagen", - "no_description": "Sin descripción", - "no_messages": "Sin mensajes", + "no_description": "sin descripción", + "no_messages": "sin mensajes", "no_minting_details": "No se puede ver los detalles de acuñado en la puerta de enlace", "no_notifications": "No hay nuevas notificaciones", - "no_payments": "Sin pagos", + "no_payments": "sin pagos", "no_pinned_changes": "Actualmente no tiene ningún cambio en sus aplicaciones fijadas", - "no_results": "Sin resultados", + "no_results": "sin resultados", "one_app_per_name": "Nota: Actualmente, solo se permite una aplicación y un sitio web por nombre.", "opened": "abierto", "overwrite_qdn": "sobrescribir a QDN", @@ -328,9 +328,11 @@ "previous": "anterior" }, "payment_notification": "notificación de pago", + "payment": "pago", "poll_embed": "encuesta", "port": "puerto", "price": "precio", + "publish": "publicación", "q_apps": { "about": "Sobre este Q-App", "q_mail": "QAIL", @@ -384,4 +386,4 @@ }, "website": "sitio web", "welcome": "bienvenido" -} \ No newline at end of file +} diff --git a/src/i18n/locales/fr/core.json b/src/i18n/locales/fr/core.json index 670184c..cd74696 100644 --- a/src/i18n/locales/fr/core.json +++ b/src/i18n/locales/fr/core.json @@ -329,9 +329,11 @@ "previous": "précédent" }, "payment_notification": "Notification de paiement", + "payment": "paiement", "poll_embed": "sondage", "port": "port", "price": "prix", + "publish": "publication", "q_apps": { "about": "À propos de ce Q-App", "q_mail": "Q-mail", diff --git a/src/i18n/locales/it/core.json b/src/i18n/locales/it/core.json index 7cc0c1b..79d1e0e 100644 --- a/src/i18n/locales/it/core.json +++ b/src/i18n/locales/it/core.json @@ -143,7 +143,7 @@ "downloading_qdn": "download da QDN", "fee": { "payment": "commissione di pagamento", - "publish": "commissione per pubblicare" + "publish": "commissione di pubblicazione" }, "for": "per", "general": "generale", @@ -330,10 +330,12 @@ "next": "prossimo", "previous": "precedente" }, + "payment": "pagamento", "payment_notification": "notifica di pagamento", "poll_embed": "sondaggio incorporato", "port": "porta", "price": "prezzo", + "publish": "pubblicazione", "q_apps": { "about": "su questo Q-app", "q_mail": "Q-mail", diff --git a/src/i18n/locales/ja/core.json b/src/i18n/locales/ja/core.json index 95f7f8d..e9ea702 100644 --- a/src/i18n/locales/ja/core.json +++ b/src/i18n/locales/ja/core.json @@ -328,9 +328,11 @@ "previous": "前の" }, "payment_notification": "支払い通知", + "payment": "お支払い", "poll_embed": "投票埋め込み", "port": "ポート", "price": "価格", + "publish": "出版物", "q_apps": { "about": "このq-appについて", "q_mail": "Qメール", @@ -384,4 +386,4 @@ }, "website": "Webサイト", "welcome": "いらっしゃいませ" -} \ No newline at end of file +} diff --git a/src/i18n/locales/ru/core.json b/src/i18n/locales/ru/core.json index 86e3c96..6024759 100644 --- a/src/i18n/locales/ru/core.json +++ b/src/i18n/locales/ru/core.json @@ -328,9 +328,11 @@ "previous": "предыдущий" }, "payment_notification": "уведомление о платеже", + "payment": "плата", "poll_embed": "Опрос встроен", "port": "порт", "price": "цена", + "publish": "публикация", "q_apps": { "about": "об этом Q-App", "q_mail": "Q-Mail", @@ -384,4 +386,4 @@ }, "website": "веб -сайт", "welcome": "добро пожаловать" -} \ No newline at end of file +} diff --git a/src/i18n/locales/zh/core.json b/src/i18n/locales/zh/core.json index a306263..0d6f46e 100644 --- a/src/i18n/locales/zh/core.json +++ b/src/i18n/locales/zh/core.json @@ -328,6 +328,8 @@ "previous": "以前的" }, "payment_notification": "付款通知", + "payment": "付款", + "publish": "出版刊物", "poll_embed": "嵌入民意测验", "port": "港口", "price": "价格", @@ -384,4 +386,4 @@ }, "website": "网站", "welcome": "欢迎" -} \ No newline at end of file +}