-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add next prev button in Docs-->Overview (#1084)
* Added Next Prev Button in docs/Overview * Changed local host to public hosted URL * Made Changes for Build * Made Changes to the Overview * Added Navigation in Docs/ Getting Started * Added NavButton in learn * Correct NavButtons Build Error
- Loading branch information
1 parent
7e80c14
commit 5114356
Showing
16 changed files
with
188 additions
and
89 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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.