-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/reactui sidenav #402
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
43f2bd6
feat: Added SideNav component (basic implementation, needs finishing …
AleksandarDev 556e969
Merge pull request #401 from Enterwell/stage
AleksandarDev 291f132
[skip ci] [version-bump] Automated commit for version 0.7.0
AleksandarDev 679431b
[skip ci] [version-bump] Automated commit for version 0.10.0
AleksandarDev cea6f6c
[skip ci] [version-bump] Automated commit for version 0.16.0
AleksandarDev 8910685
Merge branch 'stage' into feature/reactui-sidenav
AleksandarDev 0b73713
Updated sidenav component
AleksandarDev 8aed754
Merge branch 'main' into feature/reactui-sidenav
AleksandarDev a07000a
Changelog
AleksandarDev c7edc02
Update README.md
AleksandarDev 4f759e9
Update react-ui.api.md
AleksandarDev 6914add
Merge branch 'stage' into feature/reactui-sidenav
AleksandarDev 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'use client'; | ||
|
||
import { SideNav, SideNavItem, SideNavItemGroup } from '@enterwell/react-ui'; | ||
import { Button } from '@mui/material'; | ||
import { Stack } from '@mui/system'; | ||
import Image from 'next/image'; | ||
import { useSearchParams } from 'next/navigation'; | ||
|
||
export function ExampleSideNav() { | ||
const params = useSearchParams(); | ||
const selectedItem = params.get('item'); | ||
const show = params.get('show') === 'true'; | ||
function setShow(show: boolean) { | ||
const url = new URL(window.location.href); | ||
url.searchParams.set('show', show.toString()); | ||
window.history.pushState({}, '', url.toString()); | ||
} | ||
|
||
return ( | ||
<> | ||
{show && ( | ||
// @highlight-start | ||
<SideNav header={( | ||
<Stack direction='row' alignItems='center' spacing={2}> | ||
<div className="flex flex-row gap-1 items-center whitespace-nowrap"> | ||
<Image | ||
alt="Enterwell" | ||
width={32} | ||
height={32} | ||
src="https://enterwell.net/wp-content/uploads/2023/05/ew-logomark-monochrome-negative-64.x71089.svg" /> | ||
<span className="text-xs sm:text-sm md:text-lg">Enterwell {'<'}UI{' \\>'}</span> | ||
</div> | ||
</Stack> | ||
)}> | ||
<SideNavItem href="?item=1&show=true" selected={selectedItem === '1'}>Item 1</SideNavItem> | ||
<SideNavItem href="?item=2&show=true" selected={selectedItem === '2'}>Item 2</SideNavItem> | ||
<SideNavItemGroup label="Group 1" defaultExpanded={selectedItem === '3' || selectedItem === '4'}> | ||
<SideNavItem href="?item=3&show=true" selected={selectedItem === '3'}>Item 3</SideNavItem> | ||
<SideNavItem href="?item=4&show=true" selected={selectedItem === '4'}>Item 4</SideNavItem> | ||
</SideNavItemGroup> | ||
</SideNav> | ||
// @highlight-end | ||
)} | ||
<Button variant='contained' onClick={() => setShow(!show)}>Toggle SideNav</Button> | ||
</> | ||
) | ||
} |
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,33 @@ | ||
--- | ||
title: SideNav | ||
--- | ||
|
||
import { SideNav } from '@enterwell/react-ui'; | ||
import { ComponentWithSource } from '../../../components/docs/ComponentWithSource.tsx'; | ||
import { ExampleSideNav } from '../../../components/ExampleSideNav.tsx'; | ||
import { ComponentDescription, ComponentParameters, ComponentSource } from '../../../components/docs/ComponentDocs'; | ||
|
||
# SideNav | ||
|
||
## Description | ||
|
||
<ComponentDescription name="SideNav" /> | ||
|
||
### Parameters | ||
|
||
<ComponentParameters name="SideNav" /> | ||
|
||
## Example | ||
|
||
<ComponentWithSource component={ ExampleSideNav } centered /> | ||
|
||
## Inspect | ||
|
||
<details> | ||
<summary>Source code</summary> | ||
<ComponentSource | ||
package="@enterwell/react-ui" | ||
directory="SideNav" | ||
name="SideNav" | ||
/> | ||
</details> |
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
Empty file removed
0
packages/react-hooks/changes/Fixed useResizeObserver not returns correct ref type
Empty file.
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
"Select", | ||
"SplitButton", | ||
"TimeInput", | ||
"ItemAccordion" | ||
"ItemAccordion", | ||
"SideNav" | ||
] | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you choose native browser APIs over "Next.js's way" for any specific reason? I see that you're using Next's
useSearchParams
, so I think maybe you could integrate Next.js's routing all the way for consistency and reactivityFor example: