* Feature 🚀 : Ability to delete messages in chat channels - Sending message ID to frontend - Deleting Message - Use pusher to delete message realtime * Minor Bug 🐞: Show message action only for current user - User can delete or edit their own messages * Test cases added * Bug 🐞: Update message id for receiver Message id was not sent to receiver by pusher * Refactoring🛠: Message controller refactoring * Test Cases📝 : Specs for Delete message added * Feature 🚀 : Ability to edit messages * Test Cases📝 : Specs for Edit message added * Move channel settings to sidecar * added spec for chat_channels_memberships_controller.rb (#6539) * added spec for chat_channels_memberships_controller.rb * simplified record not found error for membership * error message formatting updated * added error key in flash message Co-authored-by: jitendra <jitendrarajpurohit@skynox.tech> * Refining "Move sidecar to iframe" branch (#6634) * added spec for chat_channels_memberships_controller.rb * simplified record not found error for membership * error message formatting updated * added error key in flash message * 🐞 Bug Fix: Open sidecar of clicking @all * 🐞 Bug Fix: adding space after selecting the username from suggestion box * added remove channel member functionality for moderators * 🔩 Small Tweaks: Hover issue fixed * 🐞 Bug Fix: Remove sidecar toggle on @all tag (for now) * updated manually constructed urls with rails path helpers * mod users cannot remove members of other channel Co-authored-by: jitendra <jitendrarajpurohit@skynox.tech> * 🚀 Finalising the connect group/channel feature. (#6829) * added spec for chat_channels_memberships_controller.rb * simplified record not found error for membership * error message formatting updated * added error key in flash message * 🐞 Bug Fix: Open sidecar of clicking @all * 🐞 Bug Fix: adding space after selecting the username from suggestion box * added remove channel member functionality for moderators * 🔩 Small Tweaks: Hover issue fixed * 🐞 Bug Fix: Remove sidecar toggle on @all tag (for now) * updated manually constructed urls with rails path helpers * mod users cannot remove members of other channel * mod members can now invite user who have left the channel * 🐞 Bug Fix: Ability to open sidecar on mention all properly * Eslint Changes * send email notification on inviting user feature added * 🛠 Email design enhancements for channel invitation * send invitation to mod user added from internal * 🛠 Gif changes for Mod * spec fixed * inviter name issue fixed * 🚀 Open sidecar when automatically if you use link from email Co-authored-by: jitendra <jitendrarajpurohit@skynox.tech> * review changes * added spec for channel_invite_email * Bug🐞: Design problem with sidecar after merge * Bug🐞: Design problem with invitation alert box * replaced instance variables with local variable * Bug🐞: Wrong css classes fixed * Bug🐞: Edit option bug * yarn.lock file updated * code review changes * updated manually constructed urls with rails path helpers in spec * user name url issue fix in invite email * user url corrected Co-authored-by: Sarthak Sharma <7lovesharma7@gmail.com> Co-authored-by: benhalpern <bendhalpern@gmail.com>
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
import { h, Component } from 'preact';
|
||
import PropTypes from 'prop-types';
|
||
import Article from './article';
|
||
|
||
|
||
export default class Content extends Component {
|
||
static propTypes = {
|
||
resource: PropTypes.object,
|
||
activeChannelId: PropTypes.number,
|
||
pusherKey: PropTypes.string,
|
||
};
|
||
|
||
render() {
|
||
if (!this.props.resource) {
|
||
return '';
|
||
}
|
||
return (
|
||
<div
|
||
className="activechatchannel__activecontent"
|
||
id="chat_activecontent"
|
||
onClick={this.props.onTriggerContent}
|
||
>
|
||
<button
|
||
className="activechatchannel__activecontentexitbutton"
|
||
data-content="exit"
|
||
>
|
||
×
|
||
</button>
|
||
{display(this.props)}
|
||
</div>
|
||
);
|
||
}
|
||
}
|
||
|
||
function display(props) {
|
||
if (props.resource.type_of === 'loading-user') {
|
||
return (
|
||
<div
|
||
style={{
|
||
height: '210px',
|
||
width: '210px',
|
||
margin: ' 15px auto',
|
||
display: 'block',
|
||
borderRadius: '500px',
|
||
backgroundColor: '#f5f6f7',
|
||
}}
|
||
/>
|
||
);
|
||
}
|
||
if (props.resource.type_of === 'article') {
|
||
return <Article resource={props.resource} />;
|
||
}
|
||
}
|