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
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.
Description
Currently the
width
andheight
props are optional on the Icon component. Ideally, we wantheight
to be required if awidth
is provided and visa versa. We also want them both to be required ifpreventScaling
is true. Similarly, we want eithername
orsvg
to be required. These rules can be achieved using TypeScriptAcceptance 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