Skip to content

Commit e826579

Browse files
Feat: Adding next-prev component (#807)
* feat: next-prev-comp inital * activating buttons
1 parent c384bf7 commit e826579

7 files changed

+60
-0
lines changed

components/NextPrevButton.tsx

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import Image from 'next/image';
2+
import React from 'react';
3+
4+
export default function NextPrevButton({ prev, next }: any) {
5+
return (
6+
<div className='mb-4 flex flex-row gap-4'>
7+
<div className='h-auto w-1/2'>
8+
<div
9+
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
10+
lg:text-left'
11+
>
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>
25+
</div>
26+
</div>
27+
<div className='h-auto w-1/2'>
28+
<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>
42+
</div>
43+
</div>
44+
</div>
45+
);
46+
}

pages/learn/[slug].page.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ 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';
1011

1112
export async function getStaticPaths() {
1213
return getStaticMarkdownPaths('pages/learn');
@@ -31,6 +32,7 @@ export default function StaticMarkdownPage({
3132
</Head>
3233
<Headline1>{frontmatter.title}</Headline1>
3334
<StyledMarkdown markdown={content} />
35+
<NextPrevButton prev={frontmatter.prev} next={frontmatter.next} />
3436
<DocsHelp markdownFile={markdownFile} />
3537
</SectionContext.Provider>
3638
);

pages/learn/file-system.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
section: docs
33
title: Modeling a file system with JSON Schema
4+
prev: Modelling a file system
5+
next: Other examples
46
---
57

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

pages/learn/getting-started-step-by-step.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
title: Creating your first schema
33
section: docs
4+
prev: prev
5+
next: Miscellaneous examples
46
---
57

68
JSON Schema is a vocabulary that you can use to annotate and validate JSON documents. This tutorial guides you through the process of creating a JSON Schema document.

pages/learn/json-schema-examples.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
section: docs
33
title: JSON Schema examples
4+
prev: Modelling a file system
5+
next: JSON Schema Glossary
46
---
57

68
In this page, you will find examples illustrating different use cases to help you get the most out of your JSON Schemas. These examples cover a wide range of scenarios, and each example comes with accompanying JSON data and explanation, showcasing how JSON Schemas can be applied to various domains. You can modify these examples to suit your specific needs, as this is just one of the many ways you can utilize JSON Schemas.

pages/learn/miscellaneous-examples.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
section: docs
33
title: Miscellaneous Examples
4+
prev: Creating your first schema
5+
next: Modelling a file system
46
---
57

68
In this page, you will find miscellaneous examples illustrating different uses cases to help you get the most out of your JSON Schemas. Each example comes with accompanying JSON data and explanation.

public/icons/arrow.svg

+4
Loading

0 commit comments

Comments
 (0)