mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-22 23:51:21 +00:00
Add new keys
This commit is contained in:
parent
7d45e02457
commit
84f7a31f22
10
src/App.tsx
10
src/App.tsx
@ -3338,13 +3338,20 @@ function App() {
|
||||
}}
|
||||
>
|
||||
<DialogTitle id="alert-dialog-title">
|
||||
{message.paymentFee ? 'Payment' : 'Publish'}
|
||||
{message.paymentFee
|
||||
? t('core:payment', {
|
||||
postProcess: 'capitalizeFirstChar',
|
||||
})
|
||||
: t('core:publish', {
|
||||
postProcess: 'capitalizeFirstChar',
|
||||
})}
|
||||
</DialogTitle>
|
||||
|
||||
<DialogContent>
|
||||
<DialogContentText id="alert-dialog-description">
|
||||
{message.message}
|
||||
</DialogContentText>
|
||||
|
||||
{message?.paymentFee && (
|
||||
<DialogContentText id="alert-dialog-description2">
|
||||
{t('core:fee.payment', {
|
||||
@ -3353,6 +3360,7 @@ function App() {
|
||||
: {message.paymentFee}
|
||||
</DialogContentText>
|
||||
)}
|
||||
|
||||
{message?.publishFee && (
|
||||
<DialogContentText id="alert-dialog-description2">
|
||||
{t('core:fee.publish', {
|
||||
|
@ -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<string | ArrayBuffer | null> =>
|
||||
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<ImageUploaderProps> = ({ 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<void>((resolve) => {
|
||||
@ -48,55 +52,55 @@ const ImageUploader: React.FC<ImageUploaderProps> = ({ 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 (
|
||||
<Box
|
||||
{...getRootProps()}
|
||||
sx={{
|
||||
display: 'flex'
|
||||
display: 'flex',
|
||||
}}
|
||||
>
|
||||
<input {...getInputProps()} />
|
||||
{children}
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
export default ImageUploader
|
||||
export default ImageUploader;
|
||||
|
@ -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 {
|
||||
|
@ -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",
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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": "いらっしゃいませ"
|
||||
}
|
||||
}
|
||||
|
@ -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": "добро пожаловать"
|
||||
}
|
||||
}
|
||||
|
@ -328,6 +328,8 @@
|
||||
"previous": "以前的"
|
||||
},
|
||||
"payment_notification": "付款通知",
|
||||
"payment": "付款",
|
||||
"publish": "出版刊物",
|
||||
"poll_embed": "嵌入民意测验",
|
||||
"port": "港口",
|
||||
"price": "价格",
|
||||
@ -384,4 +386,4 @@
|
||||
},
|
||||
"website": "网站",
|
||||
"welcome": "欢迎"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user