operational-ui icon indicating copy to clipboard operation
operational-ui copied to clipboard

Refactor Card component prop types

Open mpotomin opened this issue 5 years ago • 3 comments

Problem

It is hard to use the Card component with all the possible props types it gets: CardPropsWithChildrenOrData, CardPropsWithSections, CardPropsWithTabs since too many of the parameters of those types are intersecting and/or are optional. It needs better type discrimination.

Suggestion

  1. Improve type strictness and unleash the power of the discriminated types by improving typing of CardPropsWithChildrenOrData, CardPropsWithSections and CardPropsWithTabs, deriving from BaseProps
  2. Add naked prop parameter to improve Card styling possibilities

mpotomin avatar Mar 12 '19 11:03 mpotomin

How about we just split them up into different components?

Card.Tabs, Card.Sections, etc.?

TejasQ avatar Mar 12 '19 11:03 TejasQ

What is the update on this? Are you still up to split them up into different components?

bradd123 avatar Jul 11 '19 18:07 bradd123

I think there’s no conclusion here actually. We currently don’t have the time to look at Card enough to make an informed decision on this so I think we can leave it up to the community.

What are your thoughts?

TejasQ avatar Jul 11 '19 22:07 TejasQ