Updated chat in profile
- Chat in profile now directs to private message with user
This commit is contained in:
parent
3d3b51ee1a
commit
02ca61f669
@ -36,6 +36,8 @@ export default class IconButton extends React.PureComponent {
|
||||
};
|
||||
|
||||
handleClick = (e) => {
|
||||
if (!this.props.onClick) return;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if (!this.props.disabled) {
|
||||
@ -89,6 +91,7 @@ export default class IconButton extends React.PureComponent {
|
||||
style={style}
|
||||
tabIndex={tabIndex}
|
||||
disabled={disabled}
|
||||
type={type}
|
||||
>
|
||||
<Icon id={icon} fixedWidth aria-hidden='true' />
|
||||
</button>
|
||||
|
@ -4,7 +4,6 @@ import React from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import PropTypes from 'prop-types';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import axios from 'axios';
|
||||
import Button from 'gabsocial/components/button';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import { autoPlayGif, me, isStaff } from 'gabsocial/initial_state';
|
||||
@ -94,20 +93,6 @@ class Header extends ImmutablePureComponent {
|
||||
window.removeEventListener('resize', this.handleResize);
|
||||
}
|
||||
|
||||
onChat = () => {
|
||||
const { account } = this.props;
|
||||
|
||||
axios.post('https://chat.gab.com/private-message', {
|
||||
username: account.get('username'),
|
||||
})
|
||||
.then(function (response) {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
handleResize = debounce(() => {
|
||||
this.setState({ isSmallScreen: (window.innerWidth <= 895) });
|
||||
}, 5, {
|
||||
@ -343,7 +328,6 @@ class Header extends ImmutablePureComponent {
|
||||
type='submit'
|
||||
icon='comments'
|
||||
className='button button-alternative-2 chat-button'
|
||||
onClick={this.onChat}
|
||||
title={intl.formatMessage(messages.chat)}
|
||||
/>
|
||||
</form>
|
||||
|
Loading…
x
Reference in New Issue
Block a user