Skip to content

πŸ› Megamenu - Redundant calls to API that overwrites local dataΒ #60

@amankumarrr

Description

@amankumarrr

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions