docbrown/app/javascript/chat/view.jsx
Ben Halpern 94e5154668
Add initial invitation framework for chat channels (#528)
* Add initial invitation framework for chat channels

* Update chat_channel specs

* Add DIY concept of accepting invite

* Add some js and fix spec

* Add full invite accept functionality

* Remove console.log from chat
2018-07-02 16:31:20 -04:00

26 lines
No EOL
859 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { h, Component } from 'preact';
export default class View extends Component {
render() {
const channels = this.props.channels.map((channel) => {
return <div>{channel.channel_name}
<button onClick={this.props.onAcceptInvitation} data-content={channel.membership_id}>Accept</button>
<button onClick={this.props.onDeclineInvitation} data-content={channel.membership_id}>Decline</button>
</div>
});
return <div className="chatNonChatView">
<button
class="chatNonChatView_exitbutton"
data-content="exit"
onClick={this.props.onViewExit}
>×</button>
<h1>Channel Invitations</h1>
<h2>Invitations are a work in progress </h2>
{channels}
</div>
}
}