-
-
Notifications
You must be signed in to change notification settings - Fork 669
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new information architecture for documentation (#601)
- Loading branch information
1 parent
a3f96ac
commit 2d323d5
Showing
54 changed files
with
637 additions
and
9,811 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import Link from 'next/link'; | ||
import Heading from '../typography/Heading'; | ||
import Paragraph from '../typography/Paragraph'; | ||
|
||
import IconGettingStarted from '../icons/GettingStarted' | ||
import IconTutorials from '../icons/Tutorials' | ||
import IconUseCases from '../icons/UseCases' | ||
import IconSpec from '../icons/Spec' | ||
|
||
const cards = [ | ||
{ | ||
title: 'Concepts', | ||
description: 'Our Concepts section defines the concepts of AsyncAPI features and capabilities.', | ||
link: '/docs/concepts', | ||
className: 'bg-secondary-200', | ||
Icon: IconGettingStarted, | ||
}, | ||
{ | ||
title: 'Tutorials', | ||
description: 'Our Tutorials section teaches beginner processes with AsyncAPI by doing.', | ||
link: '/docs/tutorials', | ||
className: 'bg-pink-100', | ||
Icon: IconTutorials, | ||
}, | ||
{ | ||
title: 'Tools', | ||
description: 'Our Tools section documents the AsyncAPI tools ecosystem.', | ||
link: '/docs/tools', | ||
className: 'bg-green-200', | ||
Icon: IconUseCases, | ||
}, | ||
{ | ||
title: 'Reference', | ||
description: 'Our Reference section documents the AsyncAPI specification.', | ||
link: '/docs/reference', | ||
className: 'bg-yellow-200', | ||
Icon: IconSpec, | ||
} | ||
]; | ||
|
||
export function DocsCards() { | ||
return ( | ||
<div className='grid gap-4 grid-cols-1 sm:grid-cols-2'> | ||
{cards.map(card => ( | ||
<Card key={card.title} {...card} /> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
function Card({ title, description, link, className, Icon }) { | ||
return ( | ||
<Link href={link}> | ||
<a href={link} className='cursor-pointer'> | ||
<div className="h-full border border-gray-200 shadow-md hover:shadow-lg transition-all duration-300 ease-in-out rounded-lg p-6"> | ||
<div> | ||
<Heading | ||
level="h3" | ||
typeStyle="heading-sm-semibold" | ||
className='pb-4 border-b border-gray-300' | ||
> | ||
<div className='flex flex-row items-center'> | ||
<div className={`flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-lg ${className} text-gray-900 sm:h-12 sm:w-12`}> | ||
<Icon className="h-6 w-6" /> | ||
</div> | ||
<span className='ml-4'>{title}</span> | ||
</div> | ||
</Heading> | ||
<Paragraph typeStyle="body-sm" className="mt-5"> | ||
{description} | ||
</Paragraph> | ||
</div> | ||
</div> | ||
</a> | ||
</Link> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
let isMobile = undefined; | ||
export function isMobileDevice() { | ||
if (typeof navigator === 'undefined') return false; | ||
if (typeof isMobile === 'boolean') return isMobile; | ||
|
||
let regexp = /android|iphone|kindle|ipad/i; | ||
return isMobile = regexp.test(navigator.userAgent); | ||
} |
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,21 @@ | ||
import { useRef, useEffect } from "react"; | ||
|
||
export function useOutsideClick(callback) { | ||
const callbackRef = useRef(); | ||
const innerRef = useRef(); | ||
|
||
useEffect(() => { callbackRef.current = callback; }); | ||
|
||
useEffect(() => { | ||
function handleClick(e) { | ||
if (innerRef.current && callbackRef.current && | ||
!innerRef.current.contains(e.target) | ||
) callbackRef.current(e); | ||
} | ||
|
||
document.addEventListener("click", handleClick); | ||
return () => document.removeEventListener("click", handleClick); | ||
}, []); | ||
|
||
return innerRef; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function IconHome (props) { | ||
return ( | ||
<svg fill="currentColor" viewBox="0 0 18 18" {...props}> | ||
<path fillRule="evenodd" clipRule="evenodd" d="M9.40498 1.54126L16.56 8.06626L15.7612 8.86501L14.625 7.83451V15.1763L14.0625 15.7388H10.6875L10.125 15.1763V11.2388H7.87498V15.1763L7.31248 15.7388H3.93748L3.37498 15.1763V7.84351L2.24998 8.86501L1.45123 8.06626L8.59498 1.54126H9.40498ZM4.49998 6.82089V14.6138H6.74998V10.6763L7.31248 10.1138H10.6875L11.25 10.6763V14.6138H13.5V6.81414L8.99998 2.73376L4.49998 6.82089Z" fill="black"/> | ||
</svg> | ||
) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.