-
Notifications
You must be signed in to change notification settings - Fork 23
Navbar submenu items grid #1474
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
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
4c1c68f
[MOL-22399][FN] feat: add submenu rows and columns prop types
fauzannaufan-gws 299a2a4
[MOL-22399][FN] feat: build submenugrid internal component
fauzannaufan-gws d5d6f03
[MOL-22399][FN] feat: wire submenugrid into navbar items
fauzannaufan-gws f80009f
[MOL-22399][FN] test: unit test for navbar submenu grid
fauzannaufan-gws 6a570ec
[MOL-22399][FN] feat: add story for sub menu grid
fauzannaufan-gws 0ef1afb
[MOL-22399][FN] test: add e2e for navbar sumenu grid
fauzannaufan-gws 4dee769
[MOL-22399][FN] fix: address code review findings
fauzannaufan-gws 9309d18
[MOL-22399][FN] test: address testing gaps findings
fauzannaufan-gws aeb1293
[MOL-22399][FN] feat: move multi column grid behavior into Menu.Section
fauzannaufan-gws a783cd8
[MOL-22399][FN] fix: address code review findings
fauzannaufan-gws e13a6ea
[MOL-22399][FN] test: address testing gaps
fauzannaufan-gws d166d9f
[MOL-22399][FN] fix: merge columns and rows into 1 props, utilize use…
fauzannaufan-gws e00a844
[MOL-22399][FN] fix: change orientation for the menu section grid
fauzannaufan-gws 320db90
[MOL-22399][FN] chore: move max width calculation to menu-content
fauzannaufan-gws fd235fb
[MOL-22399][FN] fix: address PR comments
fauzannaufan-gws a6304ea
[MOL-22399][FN] chore: update storybook
fauzannaufan-gws df8e19d
[MOL-22399][FN] test: adjust unit test and e2e
fauzannaufan-gws 8a5b71a
[MOL-22399][FN] fix: address code review findings
fauzannaufan-gws 5bcbbd6
[MOL-22399][FN] chore: update e2e screenshot for failed items
fauzannaufan-gws 9aa925d
[MOL-22399][FN] feat: change approach to support number of columns only
fauzannaufan-gws 508f3a3
[MOL-22399][FN] chore: update tests and stories
fauzannaufan-gws 071e883
[MOL-22399][FN] fix: address code review, update e2e screenshots
fauzannaufan-gws afc5346
[MOL-22399][FN] fix: resolve PR comments
fauzannaufan-gws e6ac288
[MOL-22399][FN] test: fix failed e2e
fauzannaufan-gws 180ed04
[MISC][RL] Simplify menu docs
qroll 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
24 changes: 24 additions & 0 deletions
24
e2e/nextjs-app/src/app/components/menu/grid-layout-with-label.e2e.tsx
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,24 @@ | ||
| "use client"; | ||
|
|
||
| import { Menu } from "@lifesg/react-design-system/menu"; | ||
|
|
||
| export default function Story() { | ||
| return ( | ||
| <div className="story-column-container"> | ||
| <Menu.Content data-testid="menu-content"> | ||
| <Menu.Section | ||
| showDivider={false} | ||
| columns={2} | ||
| label="A very long section label that should wrap across multiple lines when the container is not wide enough to display it all on a single line without wrapping" | ||
| data-testid="menu-section" | ||
| > | ||
| {Array.from({ length: 6 }, (_, i) => ( | ||
| <Menu.Link key={i} href={`#link-${i + 1}`}> | ||
| Link {i + 1} | ||
| </Menu.Link> | ||
| ))} | ||
| </Menu.Section> | ||
| </Menu.Content> | ||
| </div> | ||
| ); | ||
| } |
23 changes: 23 additions & 0 deletions
23
e2e/nextjs-app/src/app/components/menu/grid-layout.e2e.tsx
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,23 @@ | ||
| "use client"; | ||
|
|
||
| import { Menu } from "@lifesg/react-design-system/menu"; | ||
|
|
||
| export default function Story() { | ||
| return ( | ||
| <div className="story-column-container"> | ||
| <Menu.Content data-testid="menu-content"> | ||
| <Menu.Section | ||
| showDivider={false} | ||
| columns={2} | ||
| data-testid="menu-section" | ||
| > | ||
| {Array.from({ length: 8 }, (_, i) => ( | ||
| <Menu.Link key={i} href={`#link-${i + 1}`}> | ||
| Link {i + 1} | ||
| </Menu.Link> | ||
| ))} | ||
| </Menu.Section> | ||
| </Menu.Content> | ||
| </div> | ||
| ); | ||
| } |
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
16 changes: 16 additions & 0 deletions
16
e2e/nextjs-app/src/app/components/navbar/submenu-grid.e2e.tsx
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,16 @@ | ||
| "use client"; | ||
|
|
||
| import { Navbar } from "@lifesg/react-design-system/navbar"; | ||
|
|
||
| import { downloadActionButtons, navItemsWithSubmenuGrid } from "./common"; | ||
|
|
||
| export default function Story() { | ||
| return ( | ||
| <Navbar | ||
| data-testid="navbar-submenu-grid" | ||
| items={{ desktop: navItemsWithSubmenuGrid }} | ||
| actionButtons={{ desktop: downloadActionButtons }} | ||
| onItemClick={() => {}} | ||
| /> | ||
| ); | ||
| } |
Binary file modified
BIN
-9 Bytes
(100%)
e2e/tests/components/menu/__screenshots__/chromium/Menu-Default-Mobile--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5 Bytes
(100%)
e2e/tests/components/menu/__screenshots__/chromium/Menu-Default-Mount--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.89 KB
...ts__/chromium/Menu-Grid-layout-Collapses-to-single-column-on-mobile--mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.56 KB
...onents/menu/__screenshots__/chromium/Menu-Grid-layout-Desktop-visual--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.7 KB
...ts/menu/__screenshots__/chromium/Menu-Grid-layout-With-section-label--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+174 Bytes
(100%)
e2e/tests/components/menu/__screenshots__/chromium/Menu-Overflow--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-98 Bytes
(99%)
...onents/menu/__screenshots__/chromium/Menu-Placements-position-bottom--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
...ts/menu/__screenshots__/chromium/Menu-Placements-position-bottom-end--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-117 Bytes
(99%)
.../menu/__screenshots__/chromium/Menu-Placements-position-bottom-start--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-25 Bytes
(100%)
...mponents/menu/__screenshots__/chromium/Menu-Placements-position-left--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-29 Bytes
(100%)
...ponents/menu/__screenshots__/chromium/Menu-Placements-position-right--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-109 Bytes
(99%)
...omponents/menu/__screenshots__/chromium/Menu-Placements-position-top--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+207 Bytes
(100%)
...ponents/menu/__screenshots__/chromium/Menu-Variants-Section-and-Item--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+207 Bytes
(100%)
...nu/__screenshots__/chromium/Menu-Variants-Section-and-Item-Dark-Mode--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file modified
BIN
+8 Bytes
(100%)
.../navbar/__screenshots__/chromium/Navbar-Default-dark-mode-imda-theme--mount.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...screenshots__/chromium/Navbar-Default-dark-mode-sportsg-orange-theme--mount.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.3 KB
...ar/__screenshots__/chromium/Navbar-Submenu-Grid-Mobile--mobile-submenu-open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28 KB
.../components/navbar/__screenshots__/chromium/Navbar-Submenu-Grid-Open--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1 Byte
(100%)
...tests/components/navbar/__screenshots__/chromium/Navbar-Submenu-Open--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...onents/navbar/__screenshots__/chromium/Navbar-Submenu-Open-last-item--state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
Uh oh!
There was an error while loading. Please reload this page.