Skip to content

Commit fa81bc9

Browse files
Pagination updates (#776)
* Move pagination above helpful component * Update logic to override prev/next arrows * Make text larger * Improve color for border in dark mode
1 parent 7ec811e commit fa81bc9

File tree

4 files changed

+56
-30
lines changed

4 files changed

+56
-30
lines changed

components/navigation/arrowLink.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.Container {
2-
@apply flex flex-wrap flex-col md:flex-row md:flex-nowrap items-center justify-between mt-20 gap-4;
2+
@apply flex flex-wrap flex-col md:flex-row md:flex-nowrap items-center justify-between mt-16 mb-8 gap-4;
33
}
44

55
.Link {
6-
@apply overflow-hidden border-none text-base tracking-tight font-sans font-normal text-gray-90 leading-7 hover:opacity-70 flex items-center transition-all;
6+
@apply overflow-hidden border-none text-base md:text-lg tracking-tight font-sans font-normal text-gray-90 leading-7 hover:opacity-70 flex items-center transition-all;
77
}
88

99
.Truncate {
@@ -15,7 +15,7 @@
1515
}
1616

1717
.NextLink {
18-
@apply mt-8 sm:mt-0;
18+
@apply mt-0 sm:mt-0;
1919
}
2020

2121
.Icon {

components/utilities/helpful.module.css

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,10 @@
33
}
44

55
.Title {
6-
@apply font-bold text-lg mb-0 tracking-tight;
6+
@apply font-bold text-base mb-0 tracking-tight;
77
@apply text-gray-90 !important;
88
}
99

10-
:global(.dark) .Title,
11-
:global(.dark) .ImproveTitle,
12-
:global(.dark) .ImproveText,
13-
:global(.dark) .Label {
14-
@apply text-white !important;
15-
}
16-
1710
.CtaContainer {
1811
@apply flex flex-row items-center pt-4 md:pt-0;
1912
}
@@ -27,20 +20,11 @@
2720
@apply ml-6;
2821
}
2922

30-
:global(.dark) .Button {
31-
@apply bg-gray-80;
32-
@apply text-white !important;
33-
}
34-
3523
.Icon {
3624
@apply text-base mr-2;
3725
@apply text-gray-50 !important;
3826
}
3927

40-
:global(.dark) .Icon {
41-
@apply text-gray-90;
42-
}
43-
4428
/* How can we improve this page form step */
4529
.ImproveTitle {
4630
@apply font-bold text-lg tracking-tight my-0;
@@ -60,10 +44,6 @@
6044
@apply w-4 h-4 mr-2 checked:bg-gray-90 appearance-none border border-gray-90 rounded-sm outline-0 cursor-pointer;
6145
}
6246

63-
:global(.dark) .Input {
64-
@apply checked:bg-white border-white;
65-
}
66-
6747
.Label {
6848
@apply font-sans;
6949
@apply text-gray-90 !important;
@@ -79,9 +59,33 @@
7959
}
8060

8161
.FormContainer {
82-
@apply flex flex-col md:flex-row items-start md:items-center mt-16;
62+
@apply flex flex-col md:flex-row items-start md:items-center pt-8 mt-8 md:pt-12 md:mt-12 border-t border-t-gray-30;
8363
}
8464

8565
.Form {
8666
@apply flex-1;
8767
}
68+
69+
:global(.dark) .Title,
70+
:global(.dark) .ImproveTitle,
71+
:global(.dark) .ImproveText,
72+
:global(.dark) .Label {
73+
@apply text-white !important;
74+
}
75+
76+
:global(.dark) .Button {
77+
@apply bg-gray-80;
78+
@apply text-white !important;
79+
}
80+
81+
:global(.dark) .Icon {
82+
@apply text-gray-90;
83+
}
84+
85+
:global(.dark) .Input {
86+
@apply checked:bg-white border-white;
87+
}
88+
89+
:global(.dark) .FormContainer {
90+
@apply border-gray-90;
91+
}

components/utilities/psa.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.Container {
2-
@apply flex items-center flex-wrap py-8 mt-16 border-t border-b border-t-gray-30 border-b-gray-30;
2+
@apply flex items-center flex-wrap;
33
}
44

55
:global(.dark) .Container {

pages/[...slug].js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,11 @@ export default function Article({
255255
<FloatingNav slug={slug} menu={menu} version={version} />
256256
<div className={classNames("content", styles.ContentContainer)}>
257257
<MDXRemote {...source} components={components} />
258+
{arrowContainer}
259+
<Psa />
258260
<Helpful slug={slug} sourcefile={suggestEditURL} />
259261
</div>
260262
</article>
261-
<Psa />
262-
{arrowContainer}
263263
</section>
264264
<Footer />
265265
</section>
@@ -334,6 +334,28 @@ export async function getStaticProps(context) {
334334

335335
const { current, prev, next } = getPreviousNextFromMenu(menu, location);
336336

337+
// Determine which previous/next links we should be using, the override option coming from the markdown file (if it exists),
338+
// or the one that gets generated automatically above by calling getPreviousNextFromMenu
339+
let prevMenuItem;
340+
if (data.previousLink && data.previousTitle) {
341+
prevMenuItem = {
342+
name: data.previousTitle,
343+
url: data.previousLink,
344+
};
345+
} else {
346+
prevMenuItem = prev;
347+
}
348+
349+
let nextMenuItem;
350+
if (data.nextLink && data.nextTitle) {
351+
nextMenuItem = {
352+
name: data.nextTitle,
353+
url: data.nextLink,
354+
};
355+
} else {
356+
nextMenuItem = next;
357+
}
358+
337359
props["menu"] = menu;
338360
props["gdpr_data"] = gdpr_data;
339361
props["data"] = data;
@@ -347,8 +369,8 @@ export async function getStaticProps(context) {
347369
isVersioned: !!current.isVersioned,
348370
}
349371
: null;
350-
props["nextMenuItem"] = next ? { name: next.name, url: next.url } : null;
351-
props["prevMenuItem"] = prev ? { name: prev.name, url: prev.url } : null;
372+
props["prevMenuItem"] = prevMenuItem ? prevMenuItem : null;
373+
props["nextMenuItem"] = nextMenuItem ? nextMenuItem : null;
352374
}
353375

354376
return {

0 commit comments

Comments
 (0)