mastodon/app/javascript/mastodon/features/ui/components/messaging.js

157 lines
4.0 KiB
JavaScript
Raw Normal View History

2019-12-21 15:16:13 +01:00
import React from 'react';
2019-12-18 16:16:08 +01:00
2019-12-21 15:16:13 +01:00
import ImmutablePropTypes from 'react-immutable-proptypes';
import { isStaff } from '../../../initial_state';
export default class Messaging extends React.PureComponent {
2019-12-18 16:16:08 +01:00
static propTypes = {
2019-12-21 15:16:13 +01:00
following : ImmutablePropTypes.list,
conversations: ImmutablePropTypes.list,
2019-12-18 16:16:08 +01:00
};
2019-12-21 15:16:13 +01:00
const;
newMessage = 'meh';
openConversationWith(account) {
let conversationFound = account;
// if conversation exist, focus on it
if (conversationFound) {
} else {
2019-12-18 16:16:08 +01:00
2019-12-21 15:16:13 +01:00
}
// else, create conversation and focus on it
};
2019-12-18 16:16:08 +01:00
submitCompose() {
};
constructor() {
super();
2019-12-21 15:16:13 +01:00
this.props.conversations = [
{
withAccount: '@machin',
messages : [],
opened : true,
},
{
withAccount: '@chuck',
messages : [],
opened : false,
},
];
this.props.following = [
{ username: 'wulfila', handle: '@wulfila' },
{ username: 'machin', handle: '@machin' },
{ username: 'chuck norris', handle: '@chuck' },
];
2019-12-18 16:16:08 +01:00
}
render() {
2019-12-21 15:16:13 +01:00
const contactlist = null;
// return (
// <div >
// messagerie todo
//
//
// </div >
// );
2019-12-18 16:16:08 +01:00
// const contactlist = this.props.following.foreEach(elem => (
// <li className='user-item'>
// <div
// className='username'
// onClick={this.openConversationWith(elem.username)}
// >
// Machin
// </div >
// <div className='last-active'>3 min</div >
// </li >
// ));
2019-12-21 15:16:13 +01:00
return (
<div className='messaging-container'>
<div className='messaging-box'>
<div className='title'>
<i
role='img'
className='fa fa-envelope column-header__icon fa-fw'
/>
Messaging box
{isStaff &&
<span >
Je suis admin oui oui
</span >
}
</div >
<div className='user-list column-header'>
<h2 className='title'>User list</h2 >
<ul >
{contactlist}
</ul >
</div >
</div >
<div className='conversations_list'>
<ul >
<li className='conversations_item has-new-message'>
<div className='title'>
<i
role='img'
className='fa fa-envelope column-header__icon fa-fw'
/>
Un Gens
<span className='new-message-counter'>
(3)</span >
<button className='btn-small'>
<i
role='img'
className='fa fa-caret-down column-header__icon fa-fw'
/>
</button >
</div >
<div className='conversation_stream'>
<div className='message theirs'>
<p >oh hello there! 😋 </p >
<div className='arrow-down' />
</div >
<div className='message mine'>
<p >General Emoji</p >
<div className='arrow-down' />
</div >
<div className='message theirs'>
<p >we just achieved comedy</p >
<div className='arrow-down' />
</div >
</div >
<div className='conversation_input'>
<form
action='#'
onSubmit={this.submitCompose()}
>
<textarea
name='messager'
id=''
cols='30'
rows='10'
className='messager-textarea'
placeholder='allez dis nous tout'
/>
<input
type='submit'
name='submit'
value='Send'
/>
</form >
</div >
</li >
</ul >
</div >
</div >
);
2019-12-18 16:16:08 +01:00
}
};