Contact methods

This commit is contained in:
koalasat
2025-03-23 18:23:05 +01:00
parent 6655f47470
commit 0c56566780
19 changed files with 86 additions and 14 deletions

View File

@ -18,7 +18,8 @@ import type { Contact } from '../../../models';
export interface DisputeForm {
statement: string;
contactMethod?: string;
contactMethod: string;
badContact: string;
contact: string;
attachLogs: boolean;
badStatement: string;
@ -27,7 +28,9 @@ export interface DisputeForm {
export const defaultDispute: DisputeForm = {
statement: '',
attachLogs: false,
contactMethod: '',
contact: '',
badContact: '',
badStatement: '',
};
@ -55,18 +58,18 @@ export const DisputeStatementForm = ({
<Grid
container
sx={{ width: '18em' }}
direction='column'
justifyContent='flex-start'
alignItems='center'
spacing={0.5}
padding={1}
>
<Grid item>
<Grid item xs={12}>
<TextField
error={dispute.badStatement !== ''}
helperText={dispute.badStatement}
label={t('Submit dispute statement')}
required
fullWidth
inputProps={{
style: { textAlign: 'center' },
}}
@ -77,22 +80,35 @@ export const DisputeStatementForm = ({
}}
/>
</Grid>
<Grid item>
<Grid item xs={12}>
<Select
variant='standard'
required
fullWidth
displayEmpty
placeholder={t('Contact method')}
value={dispute.contactMethod}
onChange={(e) => {
setDispute({ ...dispute, contactMethod: e.target.value });
}}
renderValue={(value?: string) => {
if (!value) {
return <span style={{ color: 'gray' }}>{t('Select a contact method')}</span>;
}
return value.charAt(0).toUpperCase() + value.slice(1);
}}
>
<MenuItem value='' disabled>
{t('Select a contact method')}
</MenuItem>
{Object.keys(contactMethods).map((contact) => {
if (!contactMethods[contact] || contactMethods[contact] === '') return <></>;
if (['pgp', 'fingerprint', 'website'].includes(contact)) return <></>;
return (
<MenuItem value={contact} key={contact}>
<div style={{ display: 'flex', alignItems: 'center', flexWrap: 'wrap' }}>
{t(contact)}
{contact.charAt(0).toUpperCase() + contact.slice(1)}
</div>
</MenuItem>
);
@ -104,14 +120,13 @@ export const DisputeStatementForm = ({
</MenuItem>
</Select>
</Grid>
<Grid item>
<Grid item xs={12}>
<TextField
error={dispute.badContact !== ''}
helperText={dispute.badContact}
fullWidth
required
inputProps={{
style: { textAlign: 'center' },
}}
multiline
rows={4}
size='small'
onChange={(e) => {
setDispute({ ...dispute, contact: e.target.value });
}}

View File

@ -289,8 +289,13 @@ const TradeBox = ({ currentOrder, onStartAgain }: TradeBoxProps): JSX.Element =>
const submitStatement = function (): void {
let statement = dispute.statement;
if (!dispute.contact || dispute.contact.trim() === '') {
setDispute({ ...dispute, badStatement: t('A contact method is required') });
if (!statement || statement.trim() === '' || statement.length < 100) {
setDispute({
...dispute,
badStatement: t('The statement is too short. Make sure to be thorough.'),
});
} else if (!dispute.contact || dispute.contact.trim() === '') {
setDispute({ ...dispute, badContact: t('A contact method is required') });
} else {
const { contactMethod, contact } = dispute;
statement = `${contactMethod ?? ''}: ${contact ?? ''} \n\n ${statement}`;
@ -298,6 +303,7 @@ const TradeBox = ({ currentOrder, onStartAgain }: TradeBoxProps): JSX.Element =>
const payload = { statement, messages };
statement = JSON.stringify(payload, null, 2);
}
setLoadingButtons({ ...noLoadingButtons, submitStatement: true });
submitAction({ action: 'submit_statement', statement });
}

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Veure bitlleteres compatibles",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Cancel·lar l'ordre?",
"Confirm Cancel": "Confirmar cancel·lació",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Adjuntar registres de xat",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Adjuntar registres de xat ajuda el procés de resolució de disputes i afegeix transparència. Tanmateix, pot comprometre la vostra privacitat.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Presentar declaració",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Opcions avançades",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Robrazit kompatibilní peněženky",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Zrušit objendávku?",
"Confirm Cancel": "Potvrdit zrušení",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Attach chat logs",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Odeslat vyjádření",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Advanced options",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Kompatible Wallets ansehen",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Order abbrechen?",
"Confirm Cancel": "Abbruch bestätigen",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Attach chat logs",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Übermittle Fall-Aussage",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Advanced options",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "See Compatible Wallets",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Cancel the order?",
"Confirm Cancel": "Confirm Cancel",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Attach chat logs",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Submit dispute statement",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Advanced options",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Ver carteras compatibles",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "¿Cancelar la orden?",
"Confirm Cancel": "Confirmar cancelación",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Adjuntar el registro del chat",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Adjuntar transcripciones del chat ayuda a resolver la disputa y añade transparencia. Sin embargo, puede comprometer tu privacidad.",
"Other": "Other",
"Contact method": "Contact method",
"Other": "Otro",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Presentar declaración",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Opciones avanzadas",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Begiratu Kartera Bateragarriak",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Eskaera ezeztatu?",
"Confirm Cancel": "Onartu ezeztapena",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Attach chat logs",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Aurkeztu eztabaidaren adierazpena",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Advanced options",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Voir Portefeuilles compatibles",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Annuler l'ordre?",
"Confirm Cancel": "Confirmer l'annulation",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Joindre les journaux de discussion",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Le fait de joindre les journaux de discussion facilite le processus de résolution du litige et ajoute de la transparence. Cependant, cela peut compromettre votre vie privée.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Soumettre une déclaration de litige",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Options avancées",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Vedi wallet compatibili",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Annullare l'ordine?",
"Confirm Cancel": "Conferma l'annullamento",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Allega i logs della chat",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Allegare i logs della chat semplifica il processo di risoluzione della contestazione e aggiunge trasparenza. Tuttavia, potrebbe compromettere la tua privacy.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Dichiarazione inviata",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Opzioni avanzate",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "互換性のあるウォレットを見る",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "注文をキャンセルしますか?",
"Confirm Cancel": "キャンセルを確認",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "チャットログを添付する",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "チャットログを添付することで紛争解決プロセスが促進され、透明性が高まります。ただし、プライバシーが危険にさらされる可能性があります。",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "紛争申し立てを送信する",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "高度な設定",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "See Compatible Wallets",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Anulować zamówienie?",
"Confirm Cancel": "Potwierdź Anuluj",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Attach chat logs",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Prześlij oświadczenie o sporze",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Advanced options",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Ver Carteiras Compatíveis",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Cancelar a ordem?",
"Confirm Cancel": "Confirmar cancelamento",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Attach chat logs",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Enviar declaração de disputa",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Opções avançadas",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Смотреть Совместимые Кошельки",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Отменить ордер?",
"Confirm Cancel": "Подтвердить отмену",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Прикрепите журналы чата",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Прикрепление журналов чата помогает процессу разрешения споров и повышает прозрачность. Однако это может поставить под угрозу вашу конфиденциальность.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Отправить заявление о диспуте",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Расширенные настройки",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Se kompatibla wallets",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Makulera ordern?",
"Confirm Cancel": "Bekräfta makulering",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Attach chat logs",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Skicka dispytredogörelse",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Advanced options",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "Tazama Wallets Zinazoendana",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "Ghairi agizo?",
"Confirm Cancel": "Thibitisha Kughairi",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Tia kumbukumbu za gumzo",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Kuambatanisha kumbukumbu za gumzo husaidia mchakato wa kusuluhisha mzozo na kuongeza uwazi. Walakini, inaweza kudhoofisha faragha yako.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "Wasilisha taarifa ya mzozo",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Chaguzi za hali ya juu",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "ดูกระเป๋าบิทคอยน์ (Wallets) ที่สามารถใช้งานได้",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "จะยกเลิกรายการหรือไม่?",
"Confirm Cancel": "ยืนยันยกเลิก",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "Attach chat logs",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "ส่งคำแถลงสำหรับข้อร้องเรียน",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "Advanced options",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "查看兼容钱包列表",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "取消订单?",
"Confirm Cancel": "确认取消",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "附加聊天记录",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "附加聊天记录有助于争议解决过程并增加透明度。但可能会损害你的隐私。",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "提交争议声明",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "高级选项",

View File

@ -544,6 +544,7 @@
"See Compatible Wallets": "查看兼容錢包列表",
"#51": "Phrases in components/TradeBox/index.tsx",
"A contact method is required": "A contact method is required",
"The statement is too short. Make sure to be thorough.": "The statement is too short. Make sure to be thorough.",
"#52": "Phrases in components/TradeBox/Dialogs/ConfirmCancel.tsx",
"Cancel the order?": "取消訂單?",
"Confirm Cancel": "確認取消",
@ -598,7 +599,9 @@
"#64": "Phrases in components/TradeBox/Forms/Dispute.tsx",
"Attach chat logs": "附加聊天記錄",
"Attaching chat logs helps the dispute resolution process and adds transparency. However, it might compromise your privacy.": "附加聊天記錄有助於爭議解決過程並增加透明度。但可能會損害你的隱私。",
"Contact method": "Contact method",
"Other": "Other",
"Select a contact method": "Select a contact method",
"Submit dispute statement": "提交爭議聲明",
"#65": "Phrases in components/TradeBox/Forms/LightningPayout.tsx",
"Advanced options": "高級選項",