diff --git a/src/puter-js/src/modules/EmailConfirmationDialog.js b/src/puter-js/src/modules/EmailConfirmationDialog.js index 8be9eaa78..e7347cfd4 100644 --- a/src/puter-js/src/modules/EmailConfirmationDialog.js +++ b/src/puter-js/src/modules/EmailConfirmationDialog.js @@ -5,128 +5,194 @@ class EmailConfirmationDialog extends (globalThis.HTMLElement || Object) { this.attachShadow({ mode: 'open' }); + // NOTE: This dialog deliberately mirrors the design of PuterDialog + // (the consent dialog) so all puter.js system dialogs stay visually + // consistent. If you restyle one of them, restyle all three. this.shadowRoot.innerHTML = ` -
+
-
+
@@ -134,8 +200,8 @@ class EmailConfirmationDialog extends (globalThis.HTMLElement || Object) {

Confirm Your Email

${this.message}

- +
diff --git a/src/puter-js/src/modules/PuterDialog.js b/src/puter-js/src/modules/PuterDialog.js index bedf2e029..9482719c6 100644 --- a/src/puter-js/src/modules/PuterDialog.js +++ b/src/puter-js/src/modules/PuterDialog.js @@ -35,11 +35,14 @@ class PuterDialog extends (globalThis.HTMLElement || Object) { // It will fall b h = ` -
+
-
+
@@ -134,30 +200,30 @@ class UsageLimitDialog extends (globalThis.HTMLElement || Object) {

Low Balance

${this.message}

- +
`; } - + connectedCallback () { const dialog = this.shadowRoot.querySelector('dialog'); - + this.shadowRoot.querySelector('.close-btn').addEventListener('click', () => { this.close(); }); - + this.shadowRoot.querySelector('#close-btn').addEventListener('click', () => { this.close(); }); - + this.shadowRoot.querySelector('#upgrade-btn').addEventListener('click', () => { window.open('https://puter.com/dashboard', '_blank'); this.close(); }); - + // Close on backdrop click dialog.addEventListener('click', (e) => { if ( e.target === dialog ) { @@ -165,11 +231,11 @@ class UsageLimitDialog extends (globalThis.HTMLElement || Object) { } }); } - + open () { this.shadowRoot.querySelector('dialog').showModal(); } - + close () { this.shadowRoot.querySelector('dialog').close(); this.remove(); @@ -193,16 +259,15 @@ export function showUsageLimitDialog (message) { console.warn('[Puter]', message); return; } - + // Check if dialog is already shown to prevent duplicates if ( document.querySelector('usage-limit-dialog') ) { return; } - + const dialog = new UsageLimitDialog(message); document.body.appendChild(dialog); dialog.open(); } export default UsageLimitDialog; -