Skip to content

Commit 51c40fa

Browse files
feat: add donate footer to updater dialog
1 parent d106588 commit 51c40fa

File tree

4 files changed

+69
-1
lines changed

4 files changed

+69
-1
lines changed

Diff for: arduino-ide-extension/src/browser/dialogs/ide-updater/ide-updater-dialog.tsx

+34
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,39 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
165165
goToDownloadPageButton.focus();
166166
}
167167

168+
private appendDonateFooter() {
169+
const footer = document.createElement('div');
170+
footer.classList.add('ide-updater-dialog--footer');
171+
172+
footer.innerText = nls.localize(
173+
'arduino/ide-updater/donateText',
174+
'Open source is love, '
175+
);
176+
177+
footer.appendChild(document.createTextNode('\u00A0'));
178+
179+
const footerLink = document.createElement('a');
180+
footerLink.innerText = nls.localize(
181+
'arduino/ide-updater/donateLinkText',
182+
'donate to support us'
183+
);
184+
footerLink.classList.add('ide-updater-dialog--footer-link');
185+
footerLink.onclick = () =>
186+
this.openExternal('https://www.arduino.cc/en/donate');
187+
188+
const footerLinkIcon = document.createElement('div');
189+
footerLinkIcon.title = nls.localize(
190+
'arduino/ide-updater/donateLinkIconTitle',
191+
'donate to support us'
192+
);
193+
footerLinkIcon.classList.add('ide-updater-dialog--footer-link-icon');
194+
195+
footer.appendChild(footerLink);
196+
footerLink.appendChild(footerLinkIcon);
197+
198+
this.controlPanel.parentNode?.appendChild(footer);
199+
}
200+
168201
private openDownloadPage(): void {
169202
this.openExternal('https://www.arduino.cc/en/software');
170203
this.close();
@@ -187,6 +220,7 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
187220
downloadStarted: true,
188221
});
189222
this.clearButtons();
223+
this.appendDonateFooter();
190224
this.updater.downloadUpdate();
191225
}
192226

Loading

Diff for: arduino-ide-extension/src/browser/style/ide-updater-dialog.css

+28
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,34 @@
3434
min-width: 0;
3535
}
3636

37+
.ide-updater-dialog--footer {
38+
display: flex;
39+
justify-content: right;
40+
align-items: center;
41+
margin-top: -16px;
42+
padding: 12px 0 24px 0;
43+
border-top: 1px solid var(--theia-editorWidget-border);
44+
}
45+
46+
.ide-updater-dialog--footer-link {
47+
display: flex;
48+
align-items: center;
49+
color: var(--theia-textLink-foreground);
50+
font-weight: 500;
51+
line-height: 13px;
52+
}
53+
.ide-updater-dialog--footer-link:hover {
54+
color: var(--theia-textLink-foreground);
55+
cursor: pointer;
56+
}
57+
.ide-updater-dialog--footer-link-icon {
58+
-webkit-mask: url(../icons/link-open-icon.svg) center no-repeat;
59+
background-color: var(--theia-textLink-foreground);
60+
height: 24px;
61+
width: 24px;
62+
cursor: pointer;
63+
}
64+
3765
.ide-updater-dialog .changelog {
3866
color: var(--theia-editor-foreground);
3967
background-color: var(--theia-editor-background);

Diff for: i18n/en.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@
286286
"notNowButton": "Not now",
287287
"skipVersionButton": "Skip Version",
288288
"updateAvailable": "Update Available",
289-
"versionDownloaded": "Arduino IDE {0} has been downloaded."
289+
"versionDownloaded": "Arduino IDE {0} has been downloaded.",
290+
"donateText": "Open source is love,",
291+
"donateLink": "donate to support us",
292+
"donateLinkIconTitle": "open download page"
290293
},
291294
"installable": {
292295
"libraryInstallFailed": "Failed to install library: '{0}{1}'.",

0 commit comments

Comments
 (0)