seas-computing / mark-one

A UI component library for building React Apps (in development)
https://seas-computing.github.io/mark-one/
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Export MessageContext Components #179

Open jonseitz opened 1 month ago

jonseitz commented 1 month ago

Currently, src/Alerts/MessageContext.ts exports a number of the base components needed to assemble a working message reducer in a consuming application. However, the barrel file in src/Alerts/index.ts is only exporting default, so the MessageContext itself is the only component that can be directly import into another app from mark-one. This results in us needing to do the following:

import { GlobalMessage } from 'mark-one';
import { MessageReducerAction, messageReducer } from 'mark-one/lib/Alerts/MessageContext';

As an immediate fix, we can update the index.ts to export everything from MessageContext.

As a longer term approach, we may want to define some kind of MessageWrapper that would bundle together more of the functionality into a single component that we can import along with a useDispatchMessage hook.