formatted files

This commit is contained in:
Agusti Bau 2020-05-02 13:25:18 +02:00
parent a84a3c4780
commit baa9cd8078
2 changed files with 50 additions and 50 deletions

View File

@ -19,7 +19,7 @@ import TagTile from './TagTile';
import React from 'react'; import React from 'react';
import { Draggable } from 'react-beautiful-dnd'; import { Draggable } from 'react-beautiful-dnd';
import {ContextMenu, toRightOf, useContextMenu} from "../../structures/ContextMenu"; import { ContextMenu, toRightOf, useContextMenu } from "../../structures/ContextMenu";
import * as sdk from '../../../index'; import * as sdk from '../../../index';
export default function DNDTagTile(props) { export default function DNDTagTile(props) {
@ -42,7 +42,7 @@ export default function DNDTagTile(props) {
index={props.index} index={props.index}
type="draggable-TagTile" type="draggable-TagTile"
> >
{ (provided, snapshot) => ( {(provided, snapshot) => (
<div <div
ref={provided.innerRef} ref={provided.innerRef}
{...provided.draggableProps} {...provided.draggableProps}
@ -50,12 +50,12 @@ export default function DNDTagTile(props) {
> >
<TagTile <TagTile
{...props} {...props}
contextMenuButtonRef= {handle} contextMenuButtonRef={handle}
menuDisplayed={menuDisplayed} menuDisplayed={menuDisplayed}
openMenu={openMenu} openMenu={openMenu}
/> />
</div> </div>
) } )}
</Draggable> </Draggable>
{contextMenu} {contextMenu}
</div>; </div>;

View File

@ -84,7 +84,7 @@ export default createReactClass({
this.props.tag, this.props.tag,
).then((profile) => { ).then((profile) => {
if (this.unmounted) return; if (this.unmounted) return;
this.setState({profile}); this.setState({ profile });
}).catch((err) => { }).catch((err) => {
console.warn('Could not fetch group profile for ' + this.props.tag, err); console.warn('Could not fetch group profile for ' + this.props.tag, err);
}); });
@ -111,18 +111,18 @@ export default createReactClass({
}, },
onMouseOver: function() { onMouseOver: function() {
this.setState({hover: true}); this.setState({ hover: true });
}, },
onMouseOut: function() { onMouseOut: function() {
this.setState({hover: false}); this.setState({ hover: false });
}, },
openMenu: function(e) { openMenu: function(e) {
// Prevent the TagTile onClick event firing as well // Prevent the TagTile onClick event firing as well
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
this.setState({hover: false}); this.setState({ hover: false });
this.props.openMenu(); this.props.openMenu();
}, },
@ -154,7 +154,7 @@ export default createReactClass({
// FIXME: this ought to use AccessibleButton for a11y but that causes onMouseOut/onMouseOver to fire too much // FIXME: this ought to use AccessibleButton for a11y but that causes onMouseOut/onMouseOver to fire too much
const contextButton = this.state.hover || this.props.menuDisplayed ? const contextButton = this.state.hover || this.props.menuDisplayed ?
<div className="mx_TagTile_context_button" onClick={this.openMenu} ref={this.props.contextMenuButtonRef}> <div className="mx_TagTile_context_button" onClick={this.openMenu} ref={this.props.contextMenuButtonRef}>
{ "\u00B7\u00B7\u00B7" } {"\u00B7\u00B7\u00B7"}
</div> : <div ref={this.props.contextMenuButtonRef} />; </div> : <div ref={this.props.contextMenuButtonRef} />;
const AccessibleTooltipButton = sdk.getComponent("elements.AccessibleTooltipButton"); const AccessibleTooltipButton = sdk.getComponent("elements.AccessibleTooltipButton");
@ -177,8 +177,8 @@ export default createReactClass({
width={avatarHeight} width={avatarHeight}
height={avatarHeight} height={avatarHeight}
/> />
{ contextButton } {contextButton}
{ badgeElement } {badgeElement}
</div> </div>
</AccessibleTooltipButton>; </AccessibleTooltipButton>;
}, },