Skip to content

Message

brandonk1234 edited this page Sep 6, 2016 · 1 revision

Message

The message component would be best used when building a chat/messaging app. The component has a number of options and props that you can add to it.

Props

The props needed for this component are listed and explained below:

  • title - This prop must be a string
  • body - This prop must be a string
  • onClick - This prop must be a function
  • avatar - This prop must be a string
  • onCloseButtonClicked - This prop must be a function
  • icon - This prop must be a string
  • iconColor - This prop must be a string
  • author - This prop must be a string

Example

<Message 
    title="Brandon Karunakaran" 
    body="Brandon recieved a message from the message/notification ui element"
    onClick={this.onClick}
    avatar="http://placehold.it/400x100"
    onCloseButtonClicked={this.onCloseButtonClicked}
    icon="alarm"
    iconColor="red"
    author="brandon Karunakaran"
/>

// ...React Component
onClick: function() {
    console.log('this component has been clicked')
},

onCloseButtonClicked: function() {
   console.log('the close button has been clicked')
},

Related