import { h, Component } from 'preact'; import twitterImage from 'images/twitter-logo.svg'; import githubImage from 'images/github-logo.svg'; import websiteImage from 'images/external-link-logo.svg'; function blockChat(activeChannelId) { const formData = new FormData(); formData.append('chat_id', activeChannelId); formData.append('controller', 'chat_channels'); getCsrfToken().then(sendFetch('block-chat', formData)); } export default class UserDetails extends Component { render() { const { user} = this.props; const channelId = this.props.activeChannelId; const channel = this.props.activeChannel || {}; const socialIcons = []; if (user.twitter_username) { socialIcons.push( twitter logo , ); } if (user.github_username) { socialIcons.push( github logo , ); } if (user.website_url) { socialIcons.push( external link icon , ); } let userLocation = ''; if (user.location && user.location.length > 0) { userLocation = (
location
{user.location}
); } let blockButton = ''; if (channel.channel_type === 'direct' && window.currentUser.id != user.id) { blockButton = } return (
{`${user.username}

{user.name}

{socialIcons}
{user.summary}
{userLocation}
joined
{user.joined_at}
{blockButton}
); } }