mirror of https://framagit.org/tykayn/mastodon.git
46 lines
1.0 KiB
JavaScript
46 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
import ConversationItem from './conversation-item';
|
|
import { mockRecipient, mockRecipient2 } from './mockConversation';
|
|
|
|
export default class ConversationStack extends React.Component {
|
|
|
|
static propTypes = {
|
|
conversations: PropTypes.array,
|
|
};
|
|
|
|
static defaultProps = {
|
|
conversations: [mockRecipient, mockRecipient2],
|
|
};
|
|
|
|
openConversationWith(account) {
|
|
console.log('openConversationWith name', account.username);
|
|
}
|
|
|
|
render() {
|
|
let list = this.props.conversations.map(conversations =>
|
|
(
|
|
<li
|
|
className='conversation-item-wrapper'
|
|
key={conversations.id}
|
|
>
|
|
<ConversationItem
|
|
recipient={mockRecipient}
|
|
messages={mockRecipient.messages}
|
|
key={conversations.id}
|
|
onClick={this.openConversationWith}
|
|
/>
|
|
</li >
|
|
),
|
|
);
|
|
return (
|
|
<ul className='stack conversations_list'>
|
|
{list}
|
|
</ul >
|
|
|
|
);
|
|
};
|
|
|
|
}
|