Skip to content

Commit

Permalink
chore: updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraghazra committed Oct 24, 2024
1 parent de27e7c commit 23f0271
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 15 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 39 additions & 15 deletions packages/blade/src/components/TopNav/_decisions/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The navigation bar is positioned at the top of the screen that provides quick ac
- Avatar
- MenuOverlay

<img src="./anatomy.png" alt="Anatomy of TopNav" />

## Basic Usage

```jsx
Expand All @@ -33,16 +35,38 @@ The navigation bar is positioned at the top of the screen that provides quick ac
<img src="razorpay-logo" />
</TopNavBrand>
<TopNavContent>
<TabNav>
<TabNavItem as={RouterLink} isActive href="/home" icon={HomeIcon} />
<TabNavItem as={RouterLink} href="/money">Money</TabNavItem>
<TabNavItem as={RouterLink} href="/payroll">Payroll</TabNavItem>
<Menu>
<TabNavItem trailingIcon={ChevronDown}>Others</TabNavItem>
<MenuOverlay>
{ /* Other Menu Items */ }
</MenuOverlay>
</Menu>
<TabNav
items={[
{ href: '/home', title: 'Home' },
{ href: '/payroll', title: 'Payroll' },
{ href: '/payments', title: 'Payments', isAlwaysInMore: true, },
]}
>
{({ items, overflowingItems }) => {
return (
<>
<TabNavItems>
{items.map((item) => (
<TabNavItem href={item.href}>{item.title}</TabNavItem>
))}
</TabNavItems>
<Menu>
<TabNavItem>More</TabNavItem>
{overflowingItems.map((item) => {
return (
<MenuItem key={item.title}>
<CustomExploreItem
icon={item.icon}
title={item.title}
description={item.description}
/>
</MenuItem>
);
})}
</Menu>
</>
);
}}
</TabNav>
</TopNavContent>
<TopNavActions>
Expand Down Expand Up @@ -92,7 +116,7 @@ Desktop Navigation Bar:

Mobile Navigation Bar:

<img width="50%" src="./top-nav-mobile-example.png" alt="TopNav Mobile Example" />
<img width="50%" src="./top-nav-mobile-example-new.png" alt="TopNav Mobile Example" />

## API

Expand Down Expand Up @@ -148,7 +172,7 @@ TabNav automatically handles all these edge cases & responsiveness.
},
]}
>
{({ items, moreItems }) => {
{({ items, overflowingItems }) => {
return (
<>
<TabNavItems>
Expand All @@ -158,7 +182,7 @@ TabNav automatically handles all these edge cases & responsiveness.
</TabNavItems>
<Menu>
<TabNavItem>More</TabNavItem>
{moreItems.map((item) => {
{overflowingItems.map((item) => {
return (
<MenuItem key={item.title}>
<CustomExploreItem
Expand Down Expand Up @@ -500,7 +524,7 @@ A data driven API where we pass the data for the items and use render props to r
},
]}
>
{({ items, moreItems }) => {
{({ items, overflowingItems }) => {
return (
<>
<TabNavItems>
Expand All @@ -510,7 +534,7 @@ A data driven API where we pass the data for the items and use render props to r
</TabNavItems>
<Menu>
<TabNavItem>More</TabNavItem>
{moreItems.map((item) => {
{overflowingItems.map((item) => {
return (
<MenuItem key={item.title}>
<CustomExploreItem
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 23f0271

Please sign in to comment.