Skip to content
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

feat: revamped top-nav component #2392

Merged
merged 15 commits into from
Oct 29, 2024
Merged

feat: revamped top-nav component #2392

merged 15 commits into from
Oct 29, 2024

Conversation

anuraghazra
Copy link
Member

Description

Changes

Additional Information

Component Checklist

  • Update Component Status Page
  • Perform Manual Testing in Other Browsers
  • Add KitchenSink Story
  • Add Interaction Tests (if applicable)
  • Add changeset

Copy link

changeset-bot bot commented Oct 25, 2024

🦋 Changeset detected

Latest commit: 7f9fb91

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@razorpay/blade Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Oct 25, 2024

✅ PR title follows Conventional Commits specification.

@@ -114,7 +114,7 @@ type MenuOverlayProps = {
/**
* JSX Slot for MenuItem or anything else
*/
children: React.ReactElement[] | React.ReactElement;
children: React.ReactElement[] | React.ReactElement | React.ReactNode;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript was yelling with this code:

<MenuOverlay>
  {items.map(() => <MenuItem />)}
</MenuOverlay>

@anuraghazra anuraghazra added the Review - L1 First level of review label Oct 28, 2024
Comment on lines 18 to 19
const SIDE_NAV_EXPANDED_L1_WIDTH_XL = size['208'];
const SIDE_NAV_EXPANDED_L1_WIDTH_BASE = size['208'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocker but todo: check this with design once as it will leave too little space for L3 items

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I've raised a thread.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you fix it already? Rk had designed sidenav probably ask him and fix?

// add padding to the offsetX to account the "More" menu's width changing due to the selection state (eg: More:ProdctName)
// Currently, hardcoding this to 150, we can make this dynamic too but that's causing layout thrashing
// because first we need to calculate the width of the "More" menu and then update the items
const padding = 150;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure 150 is enough? because in Full Example on storybook, the magic checkout text will also take more than 150px no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah checked based "magic checkout" only - we can increase if needed though anyways as the screen size reduces if there are let's say only space for 2 items (max 200px) to show and magic checkout itself may take 150px there's physically not enough space for us to fit any items either way.

packages/blade/src/components/TopNav/TabNav/utils.ts Outdated Show resolved Hide resolved
Comment on lines 18 to 19
const SIDE_NAV_EXPANDED_L1_WIDTH_XL = size['208'];
const SIDE_NAV_EXPANDED_L1_WIDTH_BASE = size['208'];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you fix it already? Rk had designed sidenav probably ask him and fix?

* feat: added tabnav and topnav docs

* chore: fix build

* chore: kamlesh feedback

* chore: update menu header/footer margin

* chore: remove chevron change

* chore: update icon

* chore: update menu padding

* test: add new topnav tests (#2394)

* chore: add new topnav tests

* chore: update more to button

* chore: update snaps

* chore: snaps

* chore: revert sidenab width

* chore: update snaps

* chore: test for null

* chore: update
Copy link

codesandbox-ci bot commented Oct 29, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7f9fb91:

Sandbox Source
razorpay/blade: basic Configuration

@rzpcibot
Copy link
Collaborator

rzpcibot commented Oct 29, 2024

Bundle Size Report

Updated Components
Status Component Base Size (kb) Current Size (kb) Diff
BladeProvider 1.704 1.706 +0.002 KB
Menu, MenuItem, MenuOverlay, MenuDivider, MenuFooter, MenuHeader 28.826 28.830 +0.004 KB
Table, TableHeader, TableHeaderCell, TableHeaderRow, TableBody, TableCell, TableRow, TableFooter, TableFooterCell, TableFooterRow, TablePagination, TableToolbar, TableToolbarActions, TableEditableCell, TableEditableDropdownCell 64.903 64.908 +0.005 KB
TopNav, TopNavActions, TopNavBrand, TopNavContent 4.092 1.177 -2.915 KB
TabNav, TabNavItems, TabNavItem 0.000 3.005 +3.005 KB

Generated by 🚫 dangerJS against 7f9fb91

saurabhdaware
saurabhdaware previously approved these changes Oct 29, 2024
@anuraghazra anuraghazra merged commit a4a6168 into master Oct 29, 2024
13 of 15 checks passed
@anuraghazra anuraghazra deleted the anu/new-topnav branch October 29, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review - L1 First level of review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants