SSWConsulting / SSWConsulting/SSW.MegaMenu
🐛 Megamenu - Redundant calls to API that overwrites local data
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:
- Install this as a library
- Use
MegaMenuLayoutand pass the prop calledmenuBarItems
Expected Behavior
It should not call the API if the menuBarItems has data
Tasks
- Avoid the API call if the
menuBarItemsis 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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