Skip to content

Instantly share code, notes, and snippets.

@bookercodes
Last active June 4, 2018 16:12
Show Gist options
  • Save bookercodes/6cde2064f0c22fdf84124e85ce8a2cc9 to your computer and use it in GitHub Desktop.
Save bookercodes/6cde2064f0c22fdf84124e85ce8a2cc9 to your computer and use it in GitHub Desktop.
// ./src/MessageList.js
import React, { Component } from 'react'
import {
ListView,
ListViewSection,
ListViewSectionHeader,
ListViewRow,
Text
} from 'react-desktop/macOs'
class MessageList extends Component {
render() {
return (
<ListView>
<ListViewSection>
{this.props.messages.map((message, index) =>
this.renderItem(message)
)}
</ListViewSection>
</ListView>
)
}
renderItem(message) {
return (
<ListViewRow key={message.id}>
<Text color="#414141" size="13" bold>
{message.sender.name}:
</Text>
<Text color="#414141" size="13">
{message.text}
</Text>
</ListViewRow>
)
}
}
export default MessageList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment