Skip to content

Commit c55712e

Browse files
committed
final tweaks for mobile layouts
1 parent 41d7669 commit c55712e

File tree

3 files changed

+55
-23
lines changed

3 files changed

+55
-23
lines changed

src/images/info-icon.svg

Lines changed: 1 addition & 1 deletion
Loading

src/styles/templates/download.module.css

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ a.mainDownloadButton {
5656
.mainDownloadButtonContainer > div {
5757
display: flex;
5858
align-items: center;
59-
margin-bottom: 1em;
59+
margin-bottom: 2em;
6060

6161
& > p {
6262
font-size: var(--text-large);
@@ -65,6 +65,11 @@ a.mainDownloadButton {
6565
color: var(--download-inactive);
6666
margin-bottom: 0;
6767
}
68+
69+
& > p > a {
70+
text-decoration: underline;
71+
color: var(--download-inactive);
72+
}
6873
}
6974

7075
.osBit {
@@ -73,7 +78,7 @@ a.mainDownloadButton {
7378

7479
.osSectionContainer {
7580
background-color: var(--download-background);
76-
padding: 0 calc(2 * var(--margin-double));
81+
padding: 0 calc(2.5 * var(--margin-double));
7782
padding-bottom: calc(2 * var(--vertical-margin-large));
7883

7984
& > p {
@@ -226,7 +231,9 @@ a.mainDownloadButton {
226231
}
227232

228233
& svg {
229-
height: 1em;
234+
flex: none;
235+
height: var(--text-medium);
236+
width: var(--text-medium);
230237
}
231238

232239
&.open button, &:hover button {
@@ -352,32 +359,40 @@ a.mainDownloadButton {
352359
}
353360
}
354361

362+
@media (--medium) {
363+
.osSectionContainer {
364+
padding: 0 calc(var(--margin-double));
365+
padding-bottom: calc(2 * var(--vertical-margin-large));
366+
}
367+
}
368+
355369
@media (--reduced) {
356370
a.mainDownloadButton {
357371
width: 80%;
358372
}
359373

360-
.downloadSection {
361-
margin-top: calc(3 * var(--vertical-margin-large));
374+
.osSectionContainer > p {
375+
padding-top: calc(2 * var(--vertical-margin-large));
362376
}
363377

364378
.osSectionList {
365379
flex-direction: column;
366380
gap: var(--margin-double);
367-
368-
padding: calc(4 * var(--vertical-margin-large)) calc(var(--margin) + var(--gutter));
381+
padding: calc(2 * var(--vertical-margin-large)) calc(var(--margin) + var(--gutter));
369382
}
370383

371384
.osSection {
372385
display: flex;
373386
justify-content: center;
374387
}
375388

389+
.assetList {
390+
margin-top: calc(2.5 * var(--gutter));
391+
}
392+
376393
.osButton {
377394
justify-content: center;
378-
379395
width: 300px;
380-
margin-right: var(--gutter-double);
381396
margin-bottom: 0;
382397

383398
& svg {
@@ -390,7 +405,8 @@ a.mainDownloadButton {
390405

391406
display: flex;
392407
flex-direction: column;
393-
justify-content: center;
408+
align-items: stretch;
409+
max-width: 300px;
394410

395411
& li + li {
396412
margin-top: calc(1.5 * var(--gutter));
@@ -400,6 +416,7 @@ a.mainDownloadButton {
400416
padding: var(--gutter-half) var(--gutter);
401417
}
402418
}
419+
403420

404421
.bottomLinks {
405422
flex-direction: column;
@@ -426,6 +443,10 @@ a.mainDownloadButton {
426443
}
427444
}
428445

446+
.mainDownloadButtonContainer > div > p {
447+
font-size: var(--text-medium);
448+
}
449+
429450
.osSectionList {
430451
gap: calc(2 * var(--margin-double));
431452

@@ -440,14 +461,23 @@ a.mainDownloadButton {
440461
}
441462

442463
.osButton {
443-
width: 120px;
464+
width: 200px;
444465
margin-bottom: var(--gutter-double);
466+
padding: var(--vertical-margin-large) 0;
445467

446468
& svg {
447-
height: 40px;
469+
height: 60px;
448470
}
449471
}
450472

473+
.infoTooltipContainer, .preTooltipDot {
474+
display: none;
475+
}
476+
477+
.assetList {
478+
max-width: 200px;
479+
}
480+
451481
.assetList a.asset {
452482
font-size: var(--text-small);
453483
}

src/templates/download.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const MainDownloadSection = memo(({ release, onAfterDownload }) => {
163163
{' •'} {detectedAsset.asset.size}
164164
</>
165165
)}
166-
{' •'}
166+
<span className={css.preTooltipDot}>{' •'}</span>
167167
</p>
168168
<InfoTooltip
169169
asset={detectedAsset.asset}
@@ -190,14 +190,14 @@ const MainDownloadSection = memo(({ release, onAfterDownload }) => {
190190
);
191191
});
192192

193-
const InfoTooltip = ({ asset, date, className, zIndex }) => {
193+
const InfoTooltip = ({ asset, date, className, zIndex, translateX }) => {
194194
const intl = useIntl();
195195
const [open, setOpen] = useState(false);
196196
const tooltipRef = useRef();
197197

198198
useEffect(() => {
199199
if (open) {
200-
const clickCallback = (e) => {
200+
const outsideInteraction = (e) => {
201201
if (tooltipRef.current == null) return;
202202
if (tooltipRef.current.contains(e.target)) return;
203203
if (
@@ -207,8 +207,10 @@ const InfoTooltip = ({ asset, date, className, zIndex }) => {
207207
)
208208
setOpen(false);
209209
};
210-
document.addEventListener('click', clickCallback);
211-
return () => document.removeEventListener('click', clickCallback);
210+
document.addEventListener('click', outsideInteraction);
211+
return () => {
212+
document.removeEventListener('click', outsideInteraction);
213+
};
212214
}
213215
}, [open]);
214216

@@ -292,9 +294,10 @@ const OSSection = memo(
292294
{logoComponent}
293295
<h2>{osName}</h2>
294296
</button>
295-
{isSelected && (
296-
<ul className={css.assetList}>
297-
{assets.map((asset, index) => (
297+
298+
<ul className={css.assetList}>
299+
{isSelected &&
300+
assets.map((asset, index) => (
298301
<li key={index} className={css.assetContainer}>
299302
<a
300303
className={css.asset}
@@ -310,8 +313,7 @@ const OSSection = memo(
310313
/>
311314
</li>
312315
))}
313-
</ul>
314-
)}
316+
</ul>
315317
</div>
316318
);
317319
}

0 commit comments

Comments
 (0)