Skip to content

Commit b3a7152

Browse files
authored
Track page responsive fixes (#14130)
Made a few more adjustments to the compact track page view to make it more compact + similar to mobile.
1 parent 82833cb commit b3a7152

9 files changed

Lines changed: 331 additions & 127 deletions

File tree

packages/web/src/components/page/FlushPageContainer.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@ import {
66
PAGE_GUTTER_PX
77
} from 'common/utils/layout'
88

9-
export const FlushPageContainer = (props: FlexProps) => {
10-
const { children, ...flexProps } = props
9+
type FlushPageContainerProps = FlexProps & {
10+
contentMinWidthPx?: number
11+
}
12+
13+
export const FlushPageContainer = (props: FlushPageContainerProps) => {
14+
const {
15+
children,
16+
contentMinWidthPx = MIN_PAGE_WIDTH_PX,
17+
...flexProps
18+
} = props
1119
return (
1220
<Flex w='100%' flex='1 1 0' ph={PAGE_GUTTER_PX} {...flexProps}>
1321
<Flex
1422
flex='1'
1523
w='100%'
1624
css={{
1725
maxWidth: MAX_PAGE_WIDTH_PX,
18-
minWidth: MIN_PAGE_WIDTH_PX,
26+
minWidth: contentMinWidthPx,
1927
// Center content when viewport is wider than max content width
2028
// Left-align when viewport is narrower than max content width
2129
margin: '0 auto'

packages/web/src/components/track/GiantArtwork.module.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.giantArtwork {
22
height: 338px;
33
width: 338px;
4-
min-height: 338px;
5-
min-width: 338px;
4+
min-height: 0;
5+
min-width: 0;
6+
max-height: 100%;
7+
max-width: 100%;
68
user-select: none;
79
}
810

@@ -11,8 +13,10 @@
1113
border: 1px solid var(--harmony-n-100);
1214
overflow: hidden;
1315
position: relative;
14-
width: 338px;
15-
height: 338px;
16+
width: 100%;
17+
height: 100%;
18+
min-width: 0;
19+
min-height: 0;
1620
}
1721

1822
/* Empty artwork: subdued image icon on gray background (no skeleton) */

packages/web/src/components/track/GiantTrackTile.module.css

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
justify-content: flex-end;
5151
}
5252

53+
.badgesSectionCompact {
54+
display: none;
55+
}
56+
5357
.typeLabelCompact {
5458
display: none;
5559
}
@@ -58,6 +62,26 @@
5862
display: block;
5963
}
6064

65+
.statsDesktop {
66+
display: block;
67+
}
68+
69+
.headerTrackStats :global([data-track-stat-label='social']) {
70+
display: inline;
71+
}
72+
73+
.statsInDescription {
74+
display: none;
75+
}
76+
77+
.listenCountDesktop {
78+
display: block;
79+
}
80+
81+
.playbackButton {
82+
min-width: 0 !important;
83+
}
84+
6185
.gatedContent .typeLabel {
6286
letter-spacing: 2px;
6387
}
@@ -203,11 +227,6 @@
203227
top: 2px;
204228
}
205229

206-
.makePublicButton {
207-
width: 166px;
208-
flex-shrink: 0;
209-
}
210-
211230
.downloadableIconContainer {
212231
margin-left: 10px;
213232
position: relative;
@@ -284,6 +303,12 @@
284303
}
285304
}
286305

306+
@container (max-width: 856px) {
307+
.headerTrackStats :global([data-track-stat-label='social']) {
308+
display: none;
309+
}
310+
}
311+
287312
@container (max-width: 740px) {
288313
.topSection {
289314
grid-template-columns: 1fr;
@@ -298,13 +323,22 @@
298323
justify-content: center;
299324
}
300325

326+
.badgesSectionCompact {
327+
display: flex;
328+
grid-column: 1;
329+
grid-row: 2;
330+
justify-content: center;
331+
gap: var(--harmony-unit-2);
332+
flex-wrap: wrap;
333+
}
334+
301335
.typeLabelRow {
302336
display: none;
303337
}
304338

305339
.artworkSection {
306340
grid-column: 1;
307-
grid-row: 2;
341+
grid-row: 3;
308342
justify-self: center;
309343
width: min(338px, 70cqi);
310344
aspect-ratio: 1;
@@ -317,14 +351,14 @@
317351
min-height: 0 !important;
318352
}
319353

320-
.artworkSection > div > div {
354+
.artworkSection > div > :first-child {
321355
width: 100% !important;
322356
height: 100% !important;
323357
}
324358

325359
.infoSection {
326360
grid-column: 1;
327-
grid-row: 3;
361+
grid-row: 4;
328362
align-items: center;
329363
width: 100%;
330364
}
@@ -350,6 +384,18 @@
350384
width: 100%;
351385
}
352386

387+
.statsDesktop {
388+
display: none;
389+
}
390+
391+
.statsInDescription {
392+
display: block;
393+
}
394+
395+
.listenCountDesktop {
396+
display: none;
397+
}
398+
353399
.playSection {
354400
flex-wrap: wrap;
355401
justify-content: center;
@@ -364,9 +410,21 @@
364410
min-width: 0 !important;
365411
}
366412

413+
.playbackButton {
414+
height: var(--harmony-unit-12) !important;
415+
font-size: var(--harmony-font-l) !important;
416+
line-height: var(--harmony-line-height-l) !important;
417+
padding-inline: var(--harmony-unit-4) !important;
418+
}
419+
420+
.playbackButton svg {
421+
width: var(--harmony-unit-5) !important;
422+
height: var(--harmony-unit-5) !important;
423+
}
424+
367425
.actionsSection {
368426
grid-column: 1;
369-
grid-row: 4;
427+
grid-row: 5;
370428
justify-self: stretch;
371429
width: 100%;
372430
flex-wrap: wrap;

0 commit comments

Comments
 (0)