Skip to content

Commit 82ae569

Browse files
fixup! feat: add donate footer to updater dialog
1 parent 45a8a1d commit 82ae569

File tree

3 files changed

+34
-19
lines changed

3 files changed

+34
-19
lines changed

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

+22-10
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,9 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
168168
private appendDonateFooter() {
169169
const footer = document.createElement('div');
170170
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-
footer.appendChild(document.createTextNode(',\u00A0'));
171+
const footerContent = document.createElement('div');
172+
footerContent.classList.add('ide-updater-dialog--footer-content');
173+
footer.appendChild(footerContent);
177174

178175
const footerLink = document.createElement('a');
179176
footerLink.innerText = nls.localize(
@@ -184,16 +181,31 @@ export class IDEUpdaterDialog extends ReactDialog<UpdateInfo | undefined> {
184181
footerLink.onclick = () =>
185182
this.openExternal('https://www.arduino.cc/en/donate');
186183

187-
const footerLinkIcon = document.createElement('div');
184+
const footerLinkIcon = document.createElement('span');
188185
footerLinkIcon.title = nls.localize(
189186
'arduino/ide-updater/donateLinkIconTitle',
190-
'donate to support us'
187+
'open donation page'
191188
);
192189
footerLinkIcon.classList.add('ide-updater-dialog--footer-link-icon');
193-
194-
footer.appendChild(footerLink);
195190
footerLink.appendChild(footerLinkIcon);
196191

192+
const placeholderKey = '%%link%%';
193+
const footerText = nls.localize(
194+
'arduino/ide-updater/donateText',
195+
'Open source is love, {0}',
196+
placeholderKey
197+
);
198+
const placeholder = footerText.indexOf(placeholderKey);
199+
if (placeholder !== -1) {
200+
const parts = footerText.split(placeholderKey);
201+
footerContent.appendChild(document.createTextNode(parts[0]));
202+
footerContent.appendChild(footerLink);
203+
footerContent.appendChild(document.createTextNode(parts[1]));
204+
} else {
205+
footerContent.appendChild(document.createTextNode(footerText));
206+
footerContent.appendChild(footerLink);
207+
}
208+
197209
this.controlPanel.insertAdjacentElement('afterend', footer);
198210
}
199211

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

+10-7
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@
3535
}
3636

3737
.ide-updater-dialog--footer {
38-
display: flex;
39-
justify-content: right;
40-
align-items: center;
38+
display: inline-block;
4139
margin-top: -16px;
4240
padding: 12px 0 24px 0;
4341
border-top: 1px solid var(--theia-editorWidget-border);
4442
}
43+
.ide-updater-dialog--footer-content {
44+
float: right;
45+
}
4546

4647
.ide-updater-dialog--footer-link {
47-
display: flex;
48-
align-items: center;
48+
display: inline-block;
4949
color: var(--theia-textLink-foreground);
5050
font-weight: 500;
5151
line-height: 13px;
@@ -55,11 +55,14 @@
5555
cursor: pointer;
5656
}
5757
.ide-updater-dialog--footer-link-icon {
58+
display: inline-block;
5859
-webkit-mask: url(../icons/link-open-icon.svg) center no-repeat;
5960
background-color: var(--theia-textLink-foreground);
60-
height: 24px;
61-
width: 24px;
61+
height: 12px;
62+
width: 12px;
6263
cursor: pointer;
64+
transform: translateY(2px);
65+
margin-left: 4px;
6366
}
6467

6568
.ide-updater-dialog .changelog {

i18n/en.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@
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-
"donateLinkIconTitle": "donate to support us",
278+
"donateLinkIconTitle": "open donation page",
279279
"donateLinkText": "donate to support us",
280-
"donateText": "Open source is love",
280+
"donateText": "Open source is love, {0}",
281281
"downloadButton": "Download",
282282
"downloadingNotice": "Downloading the latest version of the Arduino IDE.",
283283
"errorCheckingForUpdates": "Error while checking for Arduino IDE updates.\n{0}",

0 commit comments

Comments
 (0)