Уточнить финальный экран devnet topup

This commit is contained in:
AidarKC 2026-06-07 11:26:09 +04:00
parent 689f35fea2
commit 885cf463a7
2 changed files with 51 additions and 26 deletions

View File

@ -1,2 +1,2 @@
client.version=1.2.134 client.version=1.2.135
server.version=1.2.126 server.version=1.2.127

View File

@ -16,7 +16,7 @@ function readWalletFromUrl() {
} }
} }
export function render({ navigate }) { export function render() {
const screen = document.createElement('section'); const screen = document.createElement('section');
screen.className = 'stack'; screen.className = 'stack';
screen.style.width = '100%'; screen.style.width = '100%';
@ -51,21 +51,37 @@ export function render({ navigate }) {
status.style.whiteSpace = 'pre-wrap'; status.style.whiteSpace = 'pre-wrap';
status.textContent = 'Готово к пополнению.'; status.textContent = 'Готово к пополнению.';
const successHint = document.createElement('p'); const amountHint = document.createElement('p');
successHint.style.width = 'min(100%, 320px)'; amountHint.style.width = 'min(100%, 320px)';
successHint.style.display = 'none'; amountHint.style.display = 'none';
successHint.style.margin = '0'; amountHint.style.margin = '0';
successHint.style.padding = '14px 16px'; amountHint.style.fontSize = '22px';
successHint.style.borderRadius = '16px'; amountHint.style.fontWeight = '800';
successHint.style.background = 'rgba(15, 159, 99, 0.14)'; amountHint.style.lineHeight = '1.25';
successHint.style.border = '2px solid rgba(15, 159, 99, 0.32)'; amountHint.style.color = '#1fc97a';
successHint.style.fontSize = '24px'; amountHint.style.textAlign = 'center';
successHint.style.fontWeight = '800'; amountHint.textContent = '';
successHint.style.lineHeight = '1.25';
successHint.style.color = '#0f9f63'; const balanceHint = document.createElement('p');
successHint.style.textAlign = 'center'; balanceHint.className = 'meta-muted';
successHint.style.whiteSpace = 'pre-wrap'; balanceHint.style.width = 'min(100%, 320px)';
successHint.textContent = ''; balanceHint.style.display = 'none';
balanceHint.style.margin = '0';
balanceHint.style.textAlign = 'center';
balanceHint.style.fontSize = '14px';
balanceHint.style.color = 'rgba(255,255,255,0.9)';
balanceHint.textContent = '';
const closeHint = document.createElement('p');
closeHint.style.width = 'min(100%, 320px)';
closeHint.style.display = 'none';
closeHint.style.margin = '0';
closeHint.style.fontSize = '26px';
closeHint.style.fontWeight = '800';
closeHint.style.lineHeight = '1.25';
closeHint.style.color = '#1fc97a';
closeHint.style.textAlign = 'center';
closeHint.textContent = 'Можете закрыть эту страницу и продолжить регистрацию.';
const fillBtn = document.createElement('button'); const fillBtn = document.createElement('button');
fillBtn.className = 'primary-btn'; fillBtn.className = 'primary-btn';
@ -110,7 +126,9 @@ export function render({ navigate }) {
fillBtn.disabled = true; fillBtn.disabled = true;
status.textContent = 'Отправляем перевод...'; status.textContent = 'Отправляем перевод...';
successHint.style.display = 'none'; amountHint.style.display = 'none';
balanceHint.style.display = 'none';
closeHint.style.display = 'none';
try { try {
const endpoint = state.entrySettings.solanaServer; const endpoint = state.entrySettings.solanaServer;
@ -123,19 +141,24 @@ export function render({ navigate }) {
await updateSenderBalance(); await updateSenderBalance();
const targetBalanceSol = await updateTargetBalance(); const targetBalanceSol = await updateTargetBalance();
status.textContent = `Транзакция прошла.\nSignature: ${tx.signature}`; status.textContent = `Транзакция прошла.\nSignature: ${tx.signature}`;
status.style.fontSize = '18px'; status.style.fontSize = '13px';
status.style.fontWeight = '700'; status.style.fontWeight = '500';
status.style.color = '#0f9f63'; status.style.color = 'rgba(255,255,255,0.88)';
fillBtn.style.display = 'none'; fillBtn.style.display = 'none';
actions.style.display = 'none'; actions.style.display = 'none';
successHint.style.display = ''; amountHint.style.display = '';
successHint.textContent = `Кошелёк пополнен на ${TRANSFER_AMOUNT_SOL} SOL.\nНовый баланс: ${formatSol(targetBalanceSol || 0, 6)} SOL.\nМожете закрыть эту страницу и продолжить регистрацию.`; amountHint.textContent = `Кошелёк пополнен на ${TRANSFER_AMOUNT_SOL} SOL`;
balanceHint.style.display = '';
balanceHint.textContent = `Новый баланс: ${formatSol(targetBalanceSol || 0, 6)} SOL`;
closeHint.style.display = '';
} catch (error) { } catch (error) {
status.textContent = `Ошибка перевода: ${error?.message || 'unknown'}`; status.textContent = `Ошибка перевода: ${error?.message || 'unknown'}`;
status.style.fontSize = ''; status.style.fontSize = '';
status.style.fontWeight = ''; status.style.fontWeight = '';
status.style.color = ''; status.style.color = '';
successHint.style.display = 'none'; amountHint.style.display = 'none';
balanceHint.style.display = 'none';
closeHint.style.display = 'none';
} finally { } finally {
fillBtn.disabled = false; fillBtn.disabled = false;
} }
@ -167,7 +190,9 @@ export function render({ navigate }) {
senderBox, senderBox,
targetBox, targetBox,
status, status,
successHint, amountHint,
balanceHint,
closeHint,
actions, actions,
); );