studiobakers / react-ui-toolkit

Bakers Studio's React-based UI Toolkit
MIT License
15 stars 2 forks source link

Review and improve the structure of Context files #198

Open jamcry opened 2 years ago

jamcry commented 2 years ago

From @edizcelik :

By the way, we can update the file structure here. We recently started using this convention on Tinyman and it looks quite nice:

.../ToastContext.tsx     <- this includes Contexts and the ToastContextProvider
.../ToastContext.utils.ts      <-  this includes the custom hooks for the consumers
.../ToastContext.reducer.ts      <- includes the reducer and the state stuff
.../ToastContext.constants.ts    <- includes constants related to the Context
.../ToastContext.types.ts      <- includes types related to the Context (if any)

Originally posted by @edizcelik in https://github.com/Hipo/react-ui-toolkit/issues/197#issuecomment-1165351660

We can do this for Toast and Toggle contexts