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

Replace Navbar with Sidebar #1167

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Replace Navbar with Sidebar #1167

wants to merge 23 commits into from

Conversation

vivek-harness
Copy link
Contributor

@vivek-harness vivek-harness commented Feb 27, 2025

Replaces the current Navbar with latest Sidebar from Shadcn (https://ui.shadcn.com/blocks/sidebar#sidebar-02)

Sidebar.Changes.mov

@vivek-harness vivek-harness added the enhancement New feature or request label Feb 27, 2025
@vivek-harness vivek-harness self-assigned this Feb 27, 2025
Copy link

netlify bot commented Feb 27, 2025

Deploy Preview for harness-design ready!

Name Link
🔨 Latest commit f3755e0
🔍 Latest deploy log https://app.netlify.com/sites/harness-design/deploys/67c1e31cab3f530008466e8b
😎 Deploy Preview https://deploy-preview-1167--harness-design.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 27, 2025

Deploy Preview for harness-xd-review ready!

Name Link
🔨 Latest commit f3755e0
🔍 Latest deploy log https://app.netlify.com/sites/harness-xd-review/deploys/67c1e31be0c13d0008e59cb4
😎 Deploy Preview https://deploy-preview-1167--harness-xd-review.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

return (
<form {...props}>
{props.logo}
<Sidebar.Group className="py-0 -mt-2 px-2">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<Sidebar.Group className="py-0 -mt-2 px-2">
<Sidebar.Group className="py-0">
  1. it seems we can get rid of -mt-2 which breaks the height of the form parent, if we need to get closer to the logo we can just change its current height

  2. We also do not need to specify px-2, because initially Sidebar.Group has already set the necessary value for it.

image image

)}
</Sidebar.Header>
<Sidebar.Content>
<Sidebar.Group className="px-4 pt-5">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<Sidebar.Group className="px-4 pt-5">
<Sidebar.Group className="px-2 pt-5">
image

</Sidebar.Group>

{!!recentMenuItems.length && (
<Sidebar.Group title="Recent" className="border-t px-4 pt-3">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<Sidebar.Group title="Recent" className="border-t px-4 pt-3">
<Sidebar.Group title="Recent" className="border-t px-2 pt-3">

same

</Sidebar.Group>
)}

<Sidebar.Group className="border-t px-4 pt-5">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<Sidebar.Group className="border-t px-4 pt-5">
<Sidebar.Group className="border-t px-2 pt-5">

same

<Sidebar.MenuItem>
<Sidebar.MenuButton
asChild
className="cursor-pointer"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
className="cursor-pointer"

I think we can set this class as the default for this component, as it is interactive in nature, so we don't have to pass it every time.

<Icon
name="account"
size={12}
className="text-icons-4 transition-colors hover:text-primary !w-[12px] !h-[auto]"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
className="text-icons-4 transition-colors hover:text-primary !w-[12px] !h-[auto]"
className="text-icons-4 transition-colors hover:text-primary"

I would prefer to get rid of the [&>svg]:size-4 class initially in the parent SidebarMenuButton component, as this approach does not work in our case, since we pass the svg through the Icon component to which we specify the required sizes, and in the current situation we have to overwrite each time the value set in the parent, so it does not seem to make any sense

<NavLink className="block" to={item.to || ''} end>
{({ isActive }) => (
<Sidebar.MenuItem
className={cn('hover:bg-background-4 rounded text-foreground-3 transition-colors hover:text-primary', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
className={cn('hover:bg-background-4 rounded text-foreground-3 transition-colors hover:text-primary', {
className={cn('hover:bg-background-4 rounded text-foreground-3 transition-colors hover:text-primary', {

extra space

<Icon
name={iconName!}
size={10}
className={cn('!w-[12px] !h-[auto]', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
className={cn('!w-[12px] !h-[auto]', {
className={cn( {

similar story

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants