Commit 331ae0ca authored by mgabdev's avatar mgabdev

Edits for chat button

parent 9f1643a1
...@@ -23,6 +23,7 @@ export default class IconButton extends React.PureComponent { ...@@ -23,6 +23,7 @@ export default class IconButton extends React.PureComponent {
animate: PropTypes.bool, animate: PropTypes.bool,
overlay: PropTypes.bool, overlay: PropTypes.bool,
tabIndex: PropTypes.string, tabIndex: PropTypes.string,
type: PropTypes.string,
}; };
static defaultProps = { static defaultProps = {
...@@ -64,6 +65,7 @@ export default class IconButton extends React.PureComponent { ...@@ -64,6 +65,7 @@ export default class IconButton extends React.PureComponent {
pressed, pressed,
tabIndex, tabIndex,
title, title,
type,
} = this.props; } = this.props;
const classes = classNames(className, 'icon-button', { const classes = classNames(className, 'icon-button', {
...@@ -106,6 +108,7 @@ export default class IconButton extends React.PureComponent { ...@@ -106,6 +108,7 @@ export default class IconButton extends React.PureComponent {
style={style} style={style}
tabIndex={tabIndex} tabIndex={tabIndex}
disabled={disabled} disabled={disabled}
type={type}
> >
<Icon id={icon} style={{ transform: `rotate(${rotate}deg)` }} fixedWidth aria-hidden='true' /> <Icon id={icon} style={{ transform: `rotate(${rotate}deg)` }} fixedWidth aria-hidden='true' />
</button> </button>
......
...@@ -138,7 +138,6 @@ class Header extends ImmutablePureComponent { ...@@ -138,7 +138,6 @@ class Header extends ImmutablePureComponent {
menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' }); menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' });
menu.push({ text: intl.formatMessage(messages.domain_blocks), to: '/domain_blocks' }); menu.push({ text: intl.formatMessage(messages.domain_blocks), to: '/domain_blocks' });
} else { } else {
menu.push({ text: intl.formatMessage(messages.chat), action: this.onChat });
menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('acct') }), action: this.props.onMention }); menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('acct') }), action: this.props.onMention });
if (account.getIn(['relationship', 'following'])) { if (account.getIn(['relationship', 'following'])) {
...@@ -338,7 +337,16 @@ class Header extends ImmutablePureComponent { ...@@ -338,7 +337,16 @@ class Header extends ImmutablePureComponent {
</Button> </Button>
} }
{account.get('id') !== me && {account.get('id') !== me &&
<IconButton icon='comments' className='button button-alternative-2 chat-button hidden-sm' onClick={this.onChat} title={intl.formatMessage(messages.chat)} /> <form method='POST' action='https://chat.gab.com/direct-message'>
<input type="hidden" name="username" value={account.get('username')} />
<IconButton
type='submit'
icon='comments'
className='button button-alternative-2 chat-button'
onClick={this.onChat}
title={intl.formatMessage(messages.chat)}
/>
</form>
} }
<DropdownMenuContainer items={menu} icon='ellipsis-v' size={24} direction='right' /> <DropdownMenuContainer items={menu} icon='ellipsis-v' size={24} direction='right' />
</div> </div>
......
...@@ -20,11 +20,11 @@ Rails.application.config.content_security_policy do |p| ...@@ -20,11 +20,11 @@ Rails.application.config.content_security_policy do |p|
if Rails.env.development? if Rails.env.development?
webpacker_urls = %w(ws http).map { |protocol| "#{protocol}#{Webpacker.dev_server.https? ? 's' : ''}://#{Webpacker.dev_server.host_with_port}" } webpacker_urls = %w(ws http).map { |protocol| "#{protocol}#{Webpacker.dev_server.https? ? 's' : ''}://#{Webpacker.dev_server.host_with_port}" }
p.connect_src :self, :blob, assets_host, Rails.configuration.x.streaming_api_base_url, *webpacker_urls p.connect_src :self, :blob, assets_host, Rails.configuration.x.streaming_api_base_url, *webpacker_urls, "https://*.gab.com"
p.script_src :self, :unsafe_inline, :unsafe_eval, assets_host p.script_src :self, :unsafe_inline, :unsafe_eval, assets_host, "https://*.gab.com"
else else
p.connect_src :self, :blob, assets_host, Rails.configuration.x.streaming_api_base_url p.connect_src :self, :blob, assets_host, Rails.configuration.x.streaming_api_base_url, "https://*.gab.com"
p.script_src :self, assets_host p.script_src :self, assets_host, "https://*.gab.com"
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment