SSWConsulting / SSWConsulting/SSW.MegaMenu

🐛 Megamenu - Redundant calls to API that overwrites local data

Open
#60 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Describe the Bug

For our SSW.Website, JSON data generated by TinaCMS is added as a param (i.e menuBarItems) . However, the current implementation calls ssw.com.au/api/get-megamenu regardless of the parameters, leading to overwritten props data.

To Reproduce

Steps to reproduce the behavior:

  1. Install this as a library
  2. Use MegaMenuLayout and pass the prop called menuBarItems
Expected Behavior

It should not call the API if the menuBarItems has data

Tasks
  • Avoid the API call if the menuBarItems is already provided
  • Update REAMDE for NextJS project as it may not run directly due to Server Side Rendering
  • Add ClassName props as an optional prop to add customizable anchor links styling

Ideally, we should export types such as iconMap and other types used for the website's TinaCMS schema, rather than keeping them within the website itself.

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the MegaMenuLayout entry point and reproduce the issue by passing populated menuBarItems while using the library. Trace the megamenu API request and verify that it is skipped when local data is provided; also review the README guidance for NextJS server-side rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.