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

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

[CU] Add conditional typings to Icon #99

Closed narin closed 3 months ago

narin commented 5 months ago

Description

Currently the width and height props are optional on the Icon component. Ideally, we want height to be required if a width is provided and visa versa. We also want them both to be required if preventScaling is true. Similarly, we want either name or svg to be required. These rules can be achieved using TypeScript

Acceptance Criteria

Using TypeScript typing: - [ ] Make `width` required when `height` is provided and visa versa - [ ] Make `width` and `height` required if `preventScaling` is set to `true` - [ ] Make `name` required if `svg` is not provided and visa versa
TimRoe commented 3 months ago

Closing as this was addressed on PR #222 doing 1st and 3rd ACs and making the 2nd AC no longer relevant by defaulting 24x24 sizing if no explicit height/width.