andycmaj / react-chat-renderer

React JSX factory implementation for Slack
15 stars 0 forks source link

add input block and plain-text-input element #26

Closed davemeyer closed 4 years ago

davemeyer commented 4 years ago

closes: #25 adds a Input block level component as well as a PlainTextInput element component.

also some additions to Modal to support the optional submit and close props that are REQUIRED if you have any input options. maybe we should just always require those?

davemeyer commented 4 years ago

yeah the problem is that the top level Modal is the one with the "optional" props. so we would need a ModalWithInput component and a ModalWIthoutInput component. but as far as i know there isn't a way to limit the types of children that go into the components. so nothing would prevent me from adding a Input to my ModalWithoutInput component. just thoughts.

andycmaj commented 4 years ago

isn't a way to limit the types of children that go into the components. so nothing would prevent me from adding a Input to my ModalWithoutInput component

ah yes... we might be able to do something with https://github.com/asynchronous-dev/react-chat-renderer/blob/master/src/components/ContainerProps.ts but yeah in general i don't think JSX works this way. will have to do some research into babel/typescript