-
-
Notifications
You must be signed in to change notification settings - Fork 298
Add next prev button in Docs-->Overview #1084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
benjagm
merged 7 commits into
json-schema-org:main
from
RonakSurana-2001:add-next-prev-button
Dec 27, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
be4da51
Added Next Prev Button in docs/Overview
RonakSurana-2001 d4f9262
Changed local host to public hosted URL
RonakSurana-2001 d56b737
Made Changes for Build
RonakSurana-2001 f28cf14
Made Changes to the Overview
RonakSurana-2001 cf2be5b
Added Navigation in Docs/ Getting Started
RonakSurana-2001 1c6a7e8
Added NavButton in learn
RonakSurana-2001 575365a
Correct NavButtons Build Error
RonakSurana-2001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import Image from 'next/image'; | ||
import React from 'react'; | ||
import Link from 'next/link'; | ||
|
||
/* | ||
To use this component: | ||
1) Add prev and next metadata to the markdown page following this format: | ||
|
||
--- | ||
title: Creating your first schema | ||
section: docs | ||
prev: | ||
label: prev | ||
url: '#1' | ||
next: | ||
label: Miscellaneous examples | ||
url: '#2' | ||
--- | ||
|
||
2) Add the component to the typescript page: | ||
|
||
import NextPrevButton from '~/components/NextPrevButton'; | ||
|
||
3) Add the component to the body of the page: | ||
|
||
<NextPrevButton prevLabel={frontmatter.prev.label} prevURL={frontmatter.prev.url} nextLabel={frontmatter.next.label} nextURL={frontmatter.next.url} /> | ||
*/ | ||
|
||
export default function NextPrevButton({ | ||
prevLabel, | ||
prevURL, | ||
nextLabel, | ||
nextURL, | ||
}: any) { | ||
return ( | ||
<div className='mb-4 flex flex-row gap-4'> | ||
{prevURL && prevLabel ? ( | ||
<div className='h-auto w-1/2'> | ||
<div | ||
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 | ||
lg:text-left' | ||
> | ||
<Link href={prevURL}> | ||
<div className='text-primary dark:text-slate-300 flex flex-row gap-5 text-[18px]'> | ||
<Image | ||
src={'/icons/arrow.svg'} | ||
height={10} | ||
width={10} | ||
alt='prev icon' | ||
className='rotate-180 w-5 ' | ||
/> | ||
<div className='my-auto inline font-bold uppercase'> | ||
Go Back | ||
</div> | ||
</div> | ||
<div className='my-2 text-base font-medium text-slate-600 dark:text-slate-300'> | ||
{prevLabel} | ||
</div> | ||
</Link> | ||
</div> | ||
</div> | ||
) : ( | ||
<div className='h-auto w-1/2'></div> | ||
)} | ||
|
||
{nextURL && nextLabel ? ( | ||
<div className='h-auto w-1/2'> | ||
<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'> | ||
<Link href={nextURL}> | ||
<div className='text-primary dark:text-slate-300 flex flex-row-reverse gap-5 text-[18px]'> | ||
<Image | ||
src={'/icons/arrow.svg'} | ||
height={10} | ||
width={10} | ||
alt='next icon ' | ||
className='w-5' | ||
/> | ||
<div className='my-auto inline font-bold uppercase '> | ||
Up Next | ||
</div> | ||
</div> | ||
<div className='my-2 text-base font-medium text-slate-600 dark:text-slate-300'> | ||
{nextLabel} | ||
</div> | ||
</Link> | ||
</div> | ||
</div> | ||
) : ( | ||
<div className='h-auto w-1/2'></div> | ||
)} | ||
</div> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not change this if not required.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's causing error/issue that why I changed please see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pls. attach a Screenshot of errors