Skip to content

Commit 9ebc9a8

Browse files
committed
Merge branch 'master' of github.com:profullstack/generate-pdf-api
2 parents 7cb683c + f38273d commit 9ebc9a8

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

public/js/components/pf-dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class PfDialog extends HTMLElement {
9797
border-radius: 8px;
9898
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
9999
width: 90%;
100-
max-width: 400px;
100+
max-width: 450px;
101101
max-height: 90vh;
102102
overflow-y: auto;
103103
padding: 0;

public/js/main.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,36 @@ function initRegisterPage() {
329329
// Show success message with payment information
330330
const paymentAddress = subscriptionData.subscription.payment_address;
331331
const amount = subscriptionData.subscription.amount;
332+
const cryptoAmount = subscriptionData.subscription.crypto_amount ? subscriptionData.subscription.crypto_amount.toFixed(8) : 'calculating...';
332333
const coin = subscriptionData.subscription.payment_method.toUpperCase();
333334

334-
alert(`Registration successful! Please send ${amount} USD worth of ${coin} to: ${paymentAddress}`);
335-
336-
// Redirect to the API keys page
337-
window.router.navigate('/api-keys');
335+
// Enhanced dialog with the payment information and copyable fields
336+
PfDialog.alert(`
337+
<div class="payment-success">
338+
<h3 style="color: #2563eb; margin-bottom: 15px;">Registration Successful!</h3>
339+
<p style="margin-bottom: 20px;">Please send <strong>${amount} USD</strong> (<strong>${cryptoAmount} ${coin}</strong>) to the address below:</p>
340+
341+
<div style="margin-bottom: 15px;">
342+
<label style="display: block; font-weight: 600; margin-bottom: 5px;">Amount:</label>
343+
<div style="display: flex; align-items: center;">
344+
<input type="text" value="${cryptoAmount} ${coin}" readonly
345+
style="flex: 1; padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; background-color: #f9fafb;">
346+
<button onclick="navigator.clipboard.writeText('${cryptoAmount} ${coin}').then(() => this.textContent = 'Copied!'); setTimeout(() => this.textContent = 'Copy', 2000)"
347+
style="margin-left: 8px; padding: 8px 12px; background-color: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer;">Copy</button>
348+
</div>
349+
</div>
350+
351+
<div style="margin-bottom: 15px;">
352+
<label style="display: block; font-weight: 600; margin-bottom: 5px;">Address:</label>
353+
<div style="display: flex; align-items: center;">
354+
<input type="text" value="${paymentAddress}" readonly
355+
style="flex: 1; padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; background-color: #f9fafb;">
356+
<button onclick="navigator.clipboard.writeText('${paymentAddress}').then(() => this.textContent = 'Copied!'); setTimeout(() => this.textContent = 'Copy', 2000)"
357+
style="margin-left: 8px; padding: 8px 12px; background-color: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer;">Copy</button>
358+
</div>
359+
</div>
360+
</div>
361+
`, 'Payment Details', () => window.router.navigate('/api-keys'), 'Continue');
338362
} catch (error) {
339363
console.error('Registration error:', error);
340364
submitButton.textContent = originalButtonText;

0 commit comments

Comments
 (0)