department-of-veterans-affairs / va-mobile-library

https://department-of-veterans-affairs.github.io/va-mobile-library/
ISC License
1 stars 0 forks source link

DS - Create Global SettingsProvider and Icon maxWidth setting #343

Open narin opened 3 months ago

narin commented 3 months ago

Description

We want to provide a mechanism for a consuming app to set global settings for our component library and settings for each component. One use case of this is setting a global max width for Icons so that engineers do not have to set a maxWidth prop for every Icon that they use. We should use React's Context API to achieve this.

Links:

Acceptance Criteria

- [ ] Using [the draft PR](https://github.com/department-of-veterans-affairs/va-mobile-library/pull/345) as reference, create a SettingsProvider that will be made available to consuming apps - [ ] Context should contain an Icon maxWidth setting - [ ] In the Icon component, use the `useContext` hook to access the `maxWidth` setting, and use the value as the default if no `maxWidth` prop is explicitly passed - [ ] Once complete, create an alpha build of the component library and test it with va-mobile-app