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: create navbar component #99

Merged
merged 5 commits into from
Sep 27, 2024
Merged

Conversation

coxmars
Copy link
Contributor

@coxmars coxmars commented Sep 27, 2024

Pull Request

Summary 📌

This PR enhances the Navbar component by introducing props for dynamic content, improving its reusability and flexibility across the application.

Changes Made ⚡️

Implementation of Dynamic Navbar Component

  • Modified the Navbar component in components/Navbar.tsx to accept props for customizable content.
  • Implemented TypeScript interfaces for proper type checking of component props.
  • Refactored the component to use passed props instead of hardcoded values.

Added Props

  • logoSrc: For customizable logo source
  • logoAlt: For accessible alt text for the logo
  • title: For customizable navbar title
  • navItems: An array of navigation items (label and href)
  • ctaButton: For customizable call-to-action button (label and href)

Improved Responsiveness

  • Maintained the existing responsive design, ensuring the component works well on both mobile and desktop views.

Current output

https://www.loom.com/share/c84b5b3305eb4f239765952ee246ee61?sid=1aa46b47-82f3-451c-9c22-e156b6083d99

Time spent breakdown

Maybe around a couple of hours, I was doing other work stuff

Usage Example 🚀

const navItems = [
    { label: 'My Profile', href: '/profile' },
    { label: 'My funds', href: '/funds' }
  ];

<Navbar
      logoSrc={process.env.NEXT_PUBLIC_APP_ROOT + "icons/starklogo.png"}
      logoAlt="Go Stark Me logo"
      title="Go Stark Me"
      navItems={navItems}
      ctaButton={{
        label: "Connect wallet",
        href: "/"
      }}
  />

@EmmanuelAR EmmanuelAR self-requested a review September 27, 2024 14:49
Copy link
Collaborator

@EmmanuelAR EmmanuelAR left a comment

Choose a reason for hiding this comment

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

Comments in navbar file

frontend/gostarkme-web/components/ui/Navbar.tsx Outdated Show resolved Hide resolved
@coxmars coxmars requested a review from EmmanuelAR September 27, 2024 19:36
@EmmanuelAR EmmanuelAR merged commit 98a4afd into web3wagers:dev Sep 27, 2024
3 of 4 checks passed
@EmmanuelAR
Copy link
Collaborator

LGTM! Exc work @coxmars

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.

[feat] Add app navbar
2 participants