1.0.9 • Published 1 year ago

badmfck-presenter v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Presenter is a wraper over react-router-dom

Create sitemap, setup presenter, navigate throught sitemap.

Sitemap is an instance of array, filled with INavigationPoint

example: const sitemap=[ {
name:"home", id:"/", sub:[ {name:"Contancts",id:"contacts"} {name:"Products",id:"products",sub: {name:"Product Details",id:"prod",path:"prod/:id"} } ] } ]

Use and update current site path

useCurrentPath();

Use and update menu (id: parent menu id)

useMenu(id?:string)

Create router from sitemap, Oufift - react component with

useCreateRouter=(sitemap:INavigationPoint[],Outfit:React.ReactElement,ErrorPage?:React.ReactElement,InnerErrorPage?:React.ReactElement)

Use presenter open access to navChange method - will change navigation by INavigationPoint or INavigationPoint.id

export const usePresenter=():IUsePresenter=>{ return { navChange:navigationChange, navDisable:navigationPointDisable, } }

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago