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/left menu #30

Merged
merged 3 commits into from
Jun 28, 2024
Merged

Feat/left menu #30

merged 3 commits into from
Jun 28, 2024

Conversation

rfgvieira
Copy link

Description

  • Adds left lateral menu component to project
  • Import Label, NavigationMenu, Separator components

Related Issues

Visual reference

image

import { Separator } from "../ui/separator";

type MenuItems = {
route: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe it would be nice to have a onClick here and I don't think the route is necessary

const items: MenuItems[] = [
{
route: "",
text: "Dashboard",
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 do a setup for i18n and put the strings there?

Copy link
Author

Choose a reason for hiding this comment

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

it's necessary do this is the actual sprint?
It is not better to do when we have more time?

Copy link
Contributor

Choose a reason for hiding this comment

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

it's easier to start using it from the beginning.

dashboard/src/components/LateralMenu/LateralMenu.tsx Outdated Show resolved Hide resolved
dashboard/src/components/LateralMenu/LateralMenu.tsx Outdated Show resolved Hide resolved
const LateralMenu = (): JSX.Element => {
return (
<NavigationMenu
className="sticky bg-gray-700 z-50 pt-6 flex-col"
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are you changing the z-index?

Copy link
Author

Choose a reason for hiding this comment

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

because this component will be always be presented on top of others components

Copy link
Collaborator

Choose a reason for hiding this comment

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

i don't see this as necessary, it will just create bugs

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not our case, this side menu will not cover any other components

dashboard/src/components/ui/label.tsx Outdated Show resolved Hide resolved
dashboard/src/components/LateralMenu/LateralMenu.tsx Outdated Show resolved Hide resolved
dashboard/src/components/LateralMenu/LateralMenu.tsx Outdated Show resolved Hide resolved
@rfgvieira rfgvieira force-pushed the feat/left-menu branch 2 times, most recently from 886643b to 904cbdd Compare June 28, 2024 12:41
@@ -7,6 +7,12 @@ Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Add component
To add a new component to projet use the following command on terminal:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It would be nice to put a link to the docs https://ui.shadcn.com/docs/cli

Comment on lines 35 to 36
"vite": "^5.3.1",
"@vitejs/plugin-react": "^4.3.1"
Copy link
Contributor

@lfjnascimento lfjnascimento Jun 28, 2024

Choose a reason for hiding this comment

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

Why you moved those from devDependencies to dependencies?

Copy link
Author

Choose a reason for hiding this comment

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

Because when running pnpm build command there is a warning to move this two dependencies to dependencies

const items: MenuItems[] = [
{
route: "",
text: "Dashboard",
Copy link
Contributor

Choose a reason for hiding this comment

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

it's easier to start using it from the beginning.

@rfgvieira rfgvieira force-pushed the feat/left-menu branch 3 times, most recently from 73ab1a5 to e1923ce Compare June 28, 2024 13:16
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO: this change may have its own commit

</NavigationMenuLink>
);

const LateralMenu = (): JSX.Element => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: SideMenu

onClick: () => void;
text: string;
icon: JSX.Element;
selected: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think LateralMenu should control who is selected and not the item

Copy link
Author

Choose a reason for hiding this comment

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

I plan to change this when we have setup Routes file

},
{
onClick: emptyFunc,
text: "Tree Monitor",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It is more common to use label in this case, text is more like a larger chunk of words

@WilsonNet
Copy link

I thought we were not supposed to style to look like the figma design and use the base styles of the library as much as possible

@rfgvieira rfgvieira force-pushed the feat/left-menu branch 2 times, most recently from 4ef873a to 9a0a51d Compare June 28, 2024 15:08
Copy link
Collaborator

@mari1912 mari1912 left a comment

Choose a reason for hiding this comment

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

LGTM

rfgvieira added 3 commits June 28, 2024 12:41
Adds section explain how to add component to read me
Part of #17
Adds left lateral menu component to project
Import Label, NavigationMenu, Separator components
Closes #17
@rfgvieira rfgvieira merged commit bb0f90d into main Jun 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Left menu component
4 participants