Skip to content

Commit 9640ee9

Browse files
committed
fix merge issues
1 parent a621c25 commit 9640ee9

File tree

6 files changed

+64
-622
lines changed

6 files changed

+64
-622
lines changed

components/NextPrevButton.tsx

Lines changed: 62 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,79 @@
11
import Image from 'next/image';
22
import React from 'react';
3+
import Link from 'next/link';
34

4-
export default function NextPrevButton({ prev, next }: any) {
5+
/*
6+
To use this component:
7+
1) Add prev and next metadata to the markdown page following this format:
8+
9+
---
10+
title: Creating your first schema
11+
section: docs
12+
prev:
13+
label: prev
14+
url: '#1'
15+
next:
16+
label: Miscellaneous examples
17+
url: '#2'
18+
---
19+
20+
2) Add the component to the typescript page:
21+
22+
import NextPrevButton from '~/components/NextPrevButton';
23+
24+
3) Add the component to the body of the page:
25+
26+
<NextPrevButton prevLabel={frontmatter.prev.label} prevURL={frontmatter.prev.url} nextLabel={frontmatter.next.label} nextURL={frontmatter.next.url} />
27+
*/
28+
29+
export default function NextPrevButton({
30+
prevLabel,
31+
prevURL,
32+
nextLabel,
33+
nextURL,
34+
}: any) {
535
return (
636
<div className='mb-4 flex flex-row gap-4'>
737
<div className='h-auto w-1/2'>
838
<div
939
className='cursor-pointer rounded border border-gray-200 p-4 text-center shadow-md transition-all duration-300 ease-in-out hover:border-gray-300 hover:shadow-lg dark:shadow-xl dark:hover:shadow-2xl dark:drop-shadow-lg
1040
lg:text-left'
1141
>
12-
<div className='text-primary dark:text-slate-300 flex flex-row gap-5 text-[18px]'>
13-
<Image
14-
src={'/icons/arrow.svg'}
15-
height={10}
16-
width={10}
17-
alt='prev icon'
18-
className='rotate-180 w-5 '
19-
/>
20-
<div className='my-auto inline font-bold uppercase '>Go Back</div>
21-
</div>
22-
<div className='my-2 text-base font-medium text-slate-600 dark:text-slate-300'>
23-
{prev}
24-
</div>
42+
<Link href={prevURL}>
43+
<div className='text-primary dark:text-slate-300 flex flex-row gap-5 text-[18px]'>
44+
<Image
45+
src={'/icons/arrow.svg'}
46+
height={10}
47+
width={10}
48+
alt='prev icon'
49+
className='rotate-180 w-5 '
50+
/>
51+
<div className='my-auto inline font-bold uppercase '>Go Back</div>
52+
</div>
53+
<div className='my-2 text-base font-medium text-slate-600 dark:text-slate-300'>
54+
{prevLabel}
55+
</div>
56+
</Link>
2557
</div>
2658
</div>
59+
2760
<div className='h-auto w-1/2'>
2861
<div className='h-full cursor-pointer rounded border border-gray-200 p-4 text-center shadow-md transition-all duration-300 ease-in-out hover:border-gray-300 hover:shadow-lg dark:shadow-xl dark:drop-shadow-lg dark:hover:shadow-2xl lg:text-right'>
29-
<div className='text-primary dark:text-slate-300 flex flex-row-reverse gap-5 text-[18px]'>
30-
<Image
31-
src={'/icons/arrow.svg'}
32-
height={10}
33-
width={10}
34-
alt='next icon '
35-
className='w-5'
36-
/>
37-
<div className='my-auto inline font-bold uppercase '>Up Next</div>
38-
</div>
39-
<div className='my-2 text-base font-medium text-slate-600 dark:text-slate-300'>
40-
{next}
41-
</div>
62+
<Link href={nextURL}>
63+
<div className='text-primary dark:text-slate-300 flex flex-row-reverse gap-5 text-[18px]'>
64+
<Image
65+
src={'/icons/arrow.svg'}
66+
height={10}
67+
width={10}
68+
alt='next icon '
69+
className='w-5'
70+
/>
71+
<div className='my-auto inline font-bold uppercase '>Up Next</div>
72+
</div>
73+
<div className='my-2 text-base font-medium text-slate-600 dark:text-slate-300'>
74+
{nextLabel}
75+
</div>
76+
</Link>
4277
</div>
4378
</div>
4479
</div>

pages/learn/[slug].page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps';
77
import { Headline1 } from '~/components/Headlines';
88
import { SectionContext } from '~/context';
99
import { DocsHelp } from '~/components/DocsHelp';
10-
import NextPrevButton from '~/components/NextPrevButton';
1110

1211
export async function getStaticPaths() {
1312
return getStaticMarkdownPaths('pages/learn');
@@ -32,7 +31,6 @@ export default function StaticMarkdownPage({
3231
</Head>
3332
<Headline1>{frontmatter.title}</Headline1>
3433
<StyledMarkdown markdown={content} />
35-
<NextPrevButton prev={frontmatter.prev} next={frontmatter.next} />
3634
<DocsHelp markdownFile={markdownFile} />
3735
</SectionContext.Provider>
3836
);

pages/learn/file-system.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
section: docs
33
title: Modeling a file system with JSON Schema
4-
prev: Modelling a file system
5-
next: Other examples
64
---
75

86
In this step-by-step guide you will learn how to design a JSON Schema that mirrors the structure of an `/etc/fstab` file.

0 commit comments

Comments
 (0)