Skip to content

Commit 6a0efbe

Browse files
feat: add donate footer to updater dialog
1 parent 48d6d37 commit 6a0efbe

File tree

4 files changed

+67
-1
lines changed

4 files changed

+67
-1
lines changed

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

+32
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,37 @@ 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+
const footerLink = document.createElement('a');
178+
footerLink.innerText = nls.localize(
179+
'arduino/ide-updater/donateLinkText',
180+
'donate to support us'
181+
);
182+
footerLink.classList.add('ide-updater-dialog--footer-link');
183+
footerLink.onclick = () =>
184+
this.openExternal('https://www.arduino.cc/en/donate');
185+
186+
const footerLinkIcon = document.createElement('div');
187+
footerLinkIcon.title = nls.localize(
188+
'arduino/ide-updater/donateLinkIconTitle',
189+
'donate to support us'
190+
);
191+
footerLinkIcon.classList.add('ide-updater-dialog--footer-link-icon');
192+
193+
footer.appendChild(footerLink);
194+
footerLink.appendChild(footerLinkIcon);
195+
196+
this.controlPanel.insertAdjacentElement('afterend', footer);
197+
}
198+
168199
private openDownloadPage(): void {
169200
this.openExternal('https://www.arduino.cc/en/software');
170201
this.close();
@@ -187,6 +218,7 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
187218
downloadStarted: true,
188219
});
189220
this.clearButtons();
221+
this.appendDonateFooter();
190222
this.updater.downloadUpdate();
191223
}
192224

Loading

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);

i18n/en.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,18 @@
275275
"checkForUpdates": "Check for Arduino IDE Updates",
276276
"closeAndInstallButton": "Close and Install",
277277
"closeToInstallNotice": "Close the software and install the update on your machine.",
278+
"donateLink": "donate to support us",
279+
"donateLinkIconTitle": "open download page",
280+
"donateText": "Open source is love, ",
278281
"downloadButton": "Download",
279282
"downloadingNotice": "Downloading the latest version of the Arduino IDE.",
280283
"errorCheckingForUpdates": "Error while checking for Arduino IDE updates.\n{0}",
281284
"goToDownloadButton": "Go To Download",
282285
"goToDownloadPage": "An update for the Arduino IDE is available, but we're not able to download and install it automatically. Please go to the download page and download the latest version from there.",
283286
"ideUpdaterDialog": "Software Update",
284287
"newVersionAvailable": "A new version of Arduino IDE ({0}) is available for download.",
285-
"noUpdatesAvailable": "There are no recent updates available for the Arduino IDE",
286288
"notNowButton": "Not now",
289+
"noUpdatesAvailable": "There are no recent updates available for the Arduino IDE",
287290
"skipVersionButton": "Skip Version",
288291
"updateAvailable": "Update Available",
289292
"versionDownloaded": "Arduino IDE {0} has been downloaded."

0 commit comments

Comments
 (0)