diff --git a/frontend/src/components/Dialogs/Profile.tsx b/frontend/src/components/Dialogs/Profile.tsx index 21aaf051..2992f11e 100644 --- a/frontend/src/components/Dialogs/Profile.tsx +++ b/frontend/src/components/Dialogs/Profile.tsx @@ -94,18 +94,24 @@ const ProfileDialog = ({ open = false, onClose }: Props): React.JSX.Element => { {t('Coordinators that know your robot:')} - {federation.getCoordinators().map((coordinator: Coordinator): React.JSX.Element => { - const coordinatorRobot = garage.getSlot()?.getRobot(coordinator.shortAlias); - return ( -
- -
- ); - })} + + {federation.getCoordinators().map((coordinator: Coordinator): React.JSX.Element => { + const coordinatorRobot = garage.getSlot()?.getRobot(coordinator.shortAlias); + return ( +
+ +
+ ); + })} +
); diff --git a/frontend/src/components/RobotInfo/index.tsx b/frontend/src/components/RobotInfo/index.tsx index 44440015..8bc2f9db 100644 --- a/frontend/src/components/RobotInfo/index.tsx +++ b/frontend/src/components/RobotInfo/index.tsx @@ -17,11 +17,11 @@ import { FormControlLabel, TextField, CircularProgress, - Accordion, - AccordionDetails, - AccordionSummary, + Dialog, + DialogContent, + DialogActions, } from '@mui/material'; -import { Numbers, Send, EmojiEvents, ExpandMore } from '@mui/icons-material'; +import { Numbers, Send, EmojiEvents } from '@mui/icons-material'; import { useNavigate } from 'react-router-dom'; import { type Coordinator } from '../../models'; import { useTranslation } from 'react-i18next'; @@ -33,6 +33,7 @@ import { signCleartextMessage } from '../../pgp'; import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageContext'; import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext'; import { UseAppStoreType, AppContext } from '../../contexts/AppContext'; +import RobotAvatar from '../RobotAvatar'; interface Props { coordinator: Coordinator; @@ -42,7 +43,7 @@ interface Props { const RobotInfo: React.FC = ({ coordinator, onClose, disabled }: Props) => { const { garage } = useContext(GarageContext); - const { navigateToPage } = useContext(AppContext); + const { setOpen, navigateToPage } = useContext(AppContext); const { federation } = useContext(FederationContext); const navigate = useNavigate(); const { t } = useTranslation(); @@ -56,6 +57,7 @@ const RobotInfo: React.FC = ({ coordinator, onClose, disabled }: Props) = const [openClaimRewards, setOpenClaimRewards] = useState(false); const [weblnEnabled, setWeblnEnabled] = useState(false); const [openEnableTelegram, setOpenEnableTelegram] = useState(false); + const [openOptions, setOpenOptions] = useState(false); const robot = garage.getSlot()?.getRobot(coordinator.shortAlias); @@ -111,240 +113,278 @@ const RobotInfo: React.FC = ({ coordinator, onClose, disabled }: Props) = }; return ( - - }> - {`${coordinator.longAlias}:`} - {(robot?.earnedRewards ?? 0) > 0 && ( -  {t('Claim Sats!')} - )} - {robot?.activeOrderId ? ( - -  {t('Active order!')} - - ) : ( - robot?.lastOrderId &&  {t('finished order')} - )} - - - - {robot?.activeOrderId ? ( + <> + setOpenOptions(true)}> + + + + +  {t('Active order!')} + + ) : robot?.lastOrderId ? ( +  {t('Finished order')} + ) : ( + {t('No existing orders found')} + ) + } + /> + + setOpenOptions(false)}> + + { - navigateToPage( - `order/${String(coordinator.shortAlias)}/${String(robot?.activeOrderId)}`, - navigate, - ); - onClose(); + setOpen((open) => { + return { ...open, coordinator: coordinator.shortAlias }; + }); }} > - + + + + {coordinator.longAlias} + + {robot?.activeOrderId ? ( + { + navigateToPage( + `order/${String(coordinator.shortAlias)}/${String(robot?.activeOrderId)}`, + navigate, + ); + onClose(); + }} + > + + + + + + + + ) : robot?.lastOrderId ? ( + { + navigateToPage( + `order/${String(coordinator.shortAlias)}/${String(robot?.lastOrderId)}`, + navigate, + ); + onClose(); + }} + > + - - - - - ) : robot?.lastOrderId ? ( - { - navigateToPage( - `order/${String(coordinator.shortAlias)}/${String(robot?.lastOrderId)}`, - navigate, - ); - onClose(); + + + + ) : ( + + + + + + + )} + + + + { + setOpenEnableTelegram(false); }} - > - - - - - - ) : ( + tgBotName={robot?.tgBotName ?? ''} + tgToken={robot?.tgToken ?? ''} + /> + - + - - - )} - - - { - setOpenEnableTelegram(false); - }} - tgBotName={robot?.tgBotName ?? ''} - tgToken={robot?.tgToken ?? ''} - /> - - - - - - - - {robot?.tgEnabled ? ( - - {t('Telegram enabled')} - - ) : ( - - )} - - - - - - - - - - + {robot?.tgEnabled ? ( + + {t('Telegram enabled')} + + ) : ( + )} - > - - { - setStealthInvoice(); - }} - /> - } - /> - - - - - - - - - - - {!openClaimRewards ? ( - - - - {`${String(robot?.earnedRewards)} Sats`} - - - - - - - ) : ( -
- - - { - setRewardInvoice(e.target.value); - }} + + + + + + + + + + + { + setStealthInvoice(); + }} + /> + } /> - - - - - {weblnEnabled ? ( - - + + + + + + + + + + {!openClaimRewards ? ( + + + + {`${String(robot?.earnedRewards)} Sats`} + + + + + + + ) : ( + + + + { + setRewardInvoice(e.target.value); + }} + /> + + + - ) : ( - <> - )} - + {weblnEnabled ? ( + + + + + + ) : ( + <> + )} + + )} + + + {showRewardsSpinner && ( +
+ +
)} -
- {showRewardsSpinner && ( -
- -
- )} - - {withdrawn && ( -
- - {t('There it goes!')} - -
- )} -
-
-
+ {withdrawn && ( +
+ + {t('There it goes!')} + +
+ )} + + + + + + + ); }; diff --git a/frontend/static/locales/ca.json b/frontend/static/locales/ca.json index 49c8a5be..b43ae84b 100644 --- a/frontend/static/locales/ca.json +++ b/frontend/static/locales/ca.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Active order!", "Claim": "Retirar", - "Claim Sats!": "Reclamar Sats!", "Enable Telegram Notifications": "Habilita notificacions a Telegram", + "Finished order": "Finished order", "Generate with Webln": "Generar amb Webln", "Inactive order": "Ordre inactiva", "Invoice for {{amountSats}} Sats": "Factura per {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "Les teves compensacions", "Your current order": "La teva ordre actual", "Your last order #{{orderID}}": "La teva última ordre #{{orderID}}", - "finished order": "Ordre finalitzada", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Fosc", diff --git a/frontend/static/locales/cs.json b/frontend/static/locales/cs.json index 0fb5239e..c43acbe6 100644 --- a/frontend/static/locales/cs.json +++ b/frontend/static/locales/cs.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Aktivní objednávka!", "Claim": "Vybrat", - "Claim Sats!": "Vybrat Sats!", "Enable Telegram Notifications": "Povolit Telegram notifikace", + "Finished order": "Finished order", "Generate with Webln": "Generovat s Webln", "Inactive order": "Neaktivní objednávka", "Invoice for {{amountSats}} Sats": "Faktura pro {{amountSats}} Satů", @@ -527,7 +527,6 @@ "Your compensations": "Vaše kompenzace", "Your current order": "Vaše aktuální objednávka", "Your last order #{{orderID}}": "Vaše poslední objednávka #{{orderID}}", - "finished order": "dokončená objednávka", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Tmavé", diff --git a/frontend/static/locales/de.json b/frontend/static/locales/de.json index 11e20fb8..832ef7c5 100644 --- a/frontend/static/locales/de.json +++ b/frontend/static/locales/de.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Aktive Bestellung!", "Claim": "Erhalten", - "Claim Sats!": "Sats beanspruchen!", "Enable Telegram Notifications": "Telegram-Benachrichtigungen aktivieren", + "Finished order": "Finished order", "Generate with Webln": "Mit Webln generieren", "Inactive order": "Inaktive Bestellung", "Invoice for {{amountSats}} Sats": "Rechnung für {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "Deine Entschädigungen", "Your current order": "Deine aktuelle Bestellung", "Your last order #{{orderID}}": "Deine letzte Bestellung #{{orderID}}", - "finished order": "abgeschlossene Bestellung", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Dunkel", diff --git a/frontend/static/locales/en.json b/frontend/static/locales/en.json index 5552ea81..17af6bb9 100644 --- a/frontend/static/locales/en.json +++ b/frontend/static/locales/en.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Active order!", "Claim": "Claim", - "Claim Sats!": "Claim Sats!", "Enable Telegram Notifications": "Enable Telegram Notifications", + "Finished order": "Finished order", "Generate with Webln": "Generate with Webln", "Inactive order": "Inactive order", "Invoice for {{amountSats}} Sats": "Invoice for {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "Your compensations", "Your current order": "Your current order", "Your last order #{{orderID}}": "Your last order #{{orderID}}", - "finished order": "finished order", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Dark", diff --git a/frontend/static/locales/es.json b/frontend/static/locales/es.json index bf16fea3..a8f28591 100644 --- a/frontend/static/locales/es.json +++ b/frontend/static/locales/es.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "¡Orden activa!", "Claim": "Reclamar", - "Claim Sats!": "¡Reclamar Sats!", "Enable Telegram Notifications": "Activar Notificaciones de Telegram", + "Finished order": "Finished order", "Generate with Webln": "Generar con Webln", "Inactive order": "Orden inactiva", "Invoice for {{amountSats}} Sats": "Factura de {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "Tus compensaciones", "Your current order": "Tu orden actual", "Your last order #{{orderID}}": "Tu última orden #{{orderID}}", - "finished order": "orden finalizada", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Oscuro", diff --git a/frontend/static/locales/eu.json b/frontend/static/locales/eu.json index 2a3ffbf4..dc6aae76 100644 --- a/frontend/static/locales/eu.json +++ b/frontend/static/locales/eu.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Eskaera aktiboa!", "Claim": "Eskatu", - "Claim Sats!": "Eskatu Sats-ak!", "Enable Telegram Notifications": "Baimendu Telegram Jakinarazpenak", + "Finished order": "Finished order", "Generate with Webln": "Sortu Webln Laketa", "Inactive order": "Eskaera ez aktiboa", "Invoice for {{amountSats}} Sats": "{{amountSats}} Sateko faktura", @@ -527,7 +527,6 @@ "Your compensations": "Zure konpentsazioak", "Your current order": "Zure oraingo eskaera", "Your last order #{{orderID}}": "Zure azken eskaera #{{orderID}}", - "finished order": "eskaera amaituta", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Iluna", diff --git a/frontend/static/locales/fr.json b/frontend/static/locales/fr.json index 66e65c27..d1ce068d 100644 --- a/frontend/static/locales/fr.json +++ b/frontend/static/locales/fr.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Ordre actif!", "Claim": "Réclamer", - "Claim Sats!": "Réclamer les Sats!", "Enable Telegram Notifications": "Activer les notifications Telegram", + "Finished order": "Finished order", "Generate with Webln": "Générer avec Webln", "Inactive order": "Ordre inactif", "Invoice for {{amountSats}} Sats": "Facture pour {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "Vos compensations", "Your current order": "Votre commande en cours", "Your last order #{{orderID}}": "Votre dernière commande #{{orderID}}", - "finished order": "commande terminée", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Sombre", diff --git a/frontend/static/locales/it.json b/frontend/static/locales/it.json index 64b279e2..9bff2281 100644 --- a/frontend/static/locales/it.json +++ b/frontend/static/locales/it.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Ordine attivo!", "Claim": "Richiedi", - "Claim Sats!": "Richiedi Sats!", "Enable Telegram Notifications": "Abilita Notifiche Telegram", + "Finished order": "Finished order", "Generate with Webln": "Genera con Webln", "Inactive order": "Ordine inattivo", "Invoice for {{amountSats}} Sats": "Fattura per {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "Le tue compensazioni", "Your current order": "Il tuo ordine attuale", "Your last order #{{orderID}}": "Il tuo ultimo ordine #{{orderID}}", - "finished order": "ordine completato", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Scuro", diff --git a/frontend/static/locales/ja.json b/frontend/static/locales/ja.json index 7a5d87bd..d89b0bc5 100644 --- a/frontend/static/locales/ja.json +++ b/frontend/static/locales/ja.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "アクティブな注文!", "Claim": "請求する", - "Claim Sats!": "Satsを請求する!", "Enable Telegram Notifications": "Telegram通知を有効にする", + "Finished order": "Finished order", "Generate with Webln": "Weblnで生成", "Inactive order": "非アクティブなオーダー", "Invoice for {{amountSats}} Sats": " {{amountSats}} Satsのインボイス", @@ -527,7 +527,6 @@ "Your compensations": "あなたの補償", "Your current order": "現在のオーダー", "Your last order #{{orderID}}": "前回のオーダー #{{orderID}}", - "finished order": "終了したオーダー", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "ダーク", diff --git a/frontend/static/locales/pl.json b/frontend/static/locales/pl.json index bb36e644..a7795271 100644 --- a/frontend/static/locales/pl.json +++ b/frontend/static/locales/pl.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Aktywne zamówienie!", "Claim": "Odebrać", - "Claim Sats!": "Odebrać Sats!", "Enable Telegram Notifications": "Włącz powiadomienia Telegram", + "Finished order": "Finished order", "Generate with Webln": "Generuj z Webln", "Inactive order": "Nieaktywne zamówienie", "Invoice for {{amountSats}} Sats": "Faktura za {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "Twoje rekompensaty", "Your current order": "Twoje obecne zamówienie", "Your last order #{{orderID}}": "Twoje ostatnie zamówienie #{{orderID}}", - "finished order": "zakończone zamówienie", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Ciemny", diff --git a/frontend/static/locales/pt.json b/frontend/static/locales/pt.json index 40eff2a1..4149f1ac 100644 --- a/frontend/static/locales/pt.json +++ b/frontend/static/locales/pt.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Ordem ativa!", "Claim": "Reivindicar", - "Claim Sats!": "Reivindicar Sats!", "Enable Telegram Notifications": "Habilitar notificações do Telegram", + "Finished order": "Finished order", "Generate with Webln": "Gerar com Webln", "Inactive order": "Ordem inativa", "Invoice for {{amountSats}} Sats": "Fatura para {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "Suas compensações", "Your current order": "Sua ordem atual", "Your last order #{{orderID}}": "Sua última ordem #{{orderID}}", - "finished order": "ordem finalizada", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Escuro", diff --git a/frontend/static/locales/ru.json b/frontend/static/locales/ru.json index 5067102a..8f1bd378 100644 --- a/frontend/static/locales/ru.json +++ b/frontend/static/locales/ru.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Активный ордер!", "Claim": "Запросить", - "Claim Sats!": "Запросить Сатоши!", "Enable Telegram Notifications": "Включить уведомления Telegram", + "Finished order": "Finished order", "Generate with Webln": "Генерировать с помощью Webln", "Inactive order": "Неактивный ордер", "Invoice for {{amountSats}} Sats": "Инвойс на {{amountSats}} Сатоши", @@ -527,7 +527,6 @@ "Your compensations": "Ваши компенсации", "Your current order": "Ваш текущий ордер", "Your last order #{{orderID}}": "Ваш последний ордер #{{orderID}}", - "finished order": "завершенный ордер", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Темный", diff --git a/frontend/static/locales/sv.json b/frontend/static/locales/sv.json index 56e083ec..cf057396 100644 --- a/frontend/static/locales/sv.json +++ b/frontend/static/locales/sv.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Aktiv order!", "Claim": "Anspråk", - "Claim Sats!": "Anspråk på Sats!", "Enable Telegram Notifications": "Aktivera Telegram-aviseringar", + "Finished order": "Finished order", "Generate with Webln": "Generera med Webln", "Inactive order": "Inaktiv order", "Invoice for {{amountSats}} Sats": "Faktura för {{amountSats}} sats", @@ -527,7 +527,6 @@ "Your compensations": "Dina kompensationer", "Your current order": "Din nuvarande order", "Your last order #{{orderID}}": "Din senaste order #{{orderID}}", - "finished order": "avslutad order", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Mörk", diff --git a/frontend/static/locales/sw.json b/frontend/static/locales/sw.json index a28859d0..51825518 100644 --- a/frontend/static/locales/sw.json +++ b/frontend/static/locales/sw.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "Agizo la Kazi!", "Claim": "Dai", - "Claim Sats!": "Dai Sats!", "Enable Telegram Notifications": "Washa Arifa za Telegram", + "Finished order": "Finished order", "Generate with Webln": "Zalisha kwa Webln", "Inactive order": "Agizo lisilo hai", "Invoice for {{amountSats}} Sats": "Ankara kwa {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "Malipo yako", "Your current order": "Agizo lako la sasa", "Your last order #{{orderID}}": "Agizo lako la mwisho #{{orderID}}", - "finished order": "agizo lililokamilika", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "Giza", diff --git a/frontend/static/locales/th.json b/frontend/static/locales/th.json index 470e8158..73df6c67 100644 --- a/frontend/static/locales/th.json +++ b/frontend/static/locales/th.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "คำสั่งซื้อที่ใช้งานอยู่!", "Claim": "รับรางวัล", - "Claim Sats!": "รับ Sats!", "Enable Telegram Notifications": "เปิดใช้การแจ้งเตือน Telegram", + "Finished order": "Finished order", "Generate with Webln": "สร้างด้วย Webln", "Inactive order": "คำสั่งซื้อที่ไม่ใช้งาน", "Invoice for {{amountSats}} Sats": "ใบแจ้งหนี้สำหรับ {{amountSats}} Sats", @@ -527,7 +527,6 @@ "Your compensations": "ค่าชดเชยของคุณ", "Your current order": "คำสั่งซื้อปัจจุบันของคุณ", "Your last order #{{orderID}}": "คำสั่งซื้อสุดท้ายของคุณ #{{orderID}}", - "finished order": "คำสั่งซื้อเสร็จสิ้น", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "มืด", diff --git a/frontend/static/locales/zh-SI.json b/frontend/static/locales/zh-SI.json index 15506a8c..be989087 100644 --- a/frontend/static/locales/zh-SI.json +++ b/frontend/static/locales/zh-SI.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "活跃订单!", "Claim": "领取", - "Claim Sats!": "领取聪!", "Enable Telegram Notifications": "开启电报通知", + "Finished order": "Finished order", "Generate with Webln": "使用 Webln 生成", "Inactive order": "不活跃订单", "Invoice for {{amountSats}} Sats": "{{amountSats}}聪的发票", @@ -527,7 +527,6 @@ "Your compensations": "你的补偿", "Your current order": "你当前的订单", "Your last order #{{orderID}}": "你的上一笔订单#{{orderID}}", - "finished order": "已完成的订单", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "黑色", diff --git a/frontend/static/locales/zh-TR.json b/frontend/static/locales/zh-TR.json index 68b7c3c9..6ae4093e 100644 --- a/frontend/static/locales/zh-TR.json +++ b/frontend/static/locales/zh-TR.json @@ -512,8 +512,8 @@ "#50": "Phrases in components/RobotInfo/index.tsx", "Active order!": "活躍訂單!", "Claim": "索取", - "Claim Sats!": "索取聰!", "Enable Telegram Notifications": "啟用 Telegram 通知", + "Finished order": "Finished order", "Generate with Webln": "使用 Webln 生成", "Inactive order": "不活躍的訂單", "Invoice for {{amountSats}} Sats": "{{amountSats}} 聰的發票", @@ -527,7 +527,6 @@ "Your compensations": "您的補償", "Your current order": "您當前的訂單", "Your last order #{{orderID}}": "您的上一筆交易 #{{orderID}}", - "finished order": "完成的訂單", "#51": "Phrases in components/SettingsForm/index.tsx", "API": "API", "Dark": "深色",