mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 22:14:58 +08:00
Merge remote-tracking branch 'origin/develop' into dbkr/composer_at_room_pills
This commit is contained in:
commit
49ee78dab1
@ -15,13 +15,14 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import GeminiScrollbar from 'react-gemini-scrollbar';
|
||||||
import {MatrixClient} from 'matrix-js-sdk';
|
import {MatrixClient} from 'matrix-js-sdk';
|
||||||
import sdk from '../../index';
|
import sdk from '../../index';
|
||||||
import { _t, _tJsx } from '../../languageHandler';
|
import { _t, _tJsx } from '../../languageHandler';
|
||||||
import withMatrixClient from '../../wrappers/withMatrixClient';
|
import withMatrixClient from '../../wrappers/withMatrixClient';
|
||||||
import AccessibleButton from '../views/elements/AccessibleButton';
|
import AccessibleButton from '../views/elements/AccessibleButton';
|
||||||
import dis from '../../dispatcher';
|
import dis from '../../dispatcher';
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import Modal from '../../Modal';
|
import Modal from '../../Modal';
|
||||||
|
|
||||||
import FlairStore from '../../stores/FlairStore';
|
import FlairStore from '../../stores/FlairStore';
|
||||||
@ -115,18 +116,17 @@ export default withMatrixClient(React.createClass({
|
|||||||
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
const TintableSvg = sdk.getComponent("elements.TintableSvg");
|
||||||
|
|
||||||
let content;
|
let content;
|
||||||
|
let contentHeader;
|
||||||
if (this.state.groups) {
|
if (this.state.groups) {
|
||||||
const groupNodes = [];
|
const groupNodes = [];
|
||||||
this.state.groups.forEach((g) => {
|
this.state.groups.forEach((g) => {
|
||||||
groupNodes.push(<GroupTile groupId={g} />);
|
groupNodes.push(<GroupTile groupId={g} />);
|
||||||
});
|
});
|
||||||
|
contentHeader = groupNodes.length > 0 ? <h3>{ _t('Your Communities') }</h3> : <div />;
|
||||||
content = groupNodes.length > 0 ?
|
content = groupNodes.length > 0 ?
|
||||||
<div>
|
<GeminiScrollbar className="mx_MyGroups_joinedGroups">
|
||||||
<h3>{ _t('Your Communities') }</h3>
|
|
||||||
<div className="mx_MyGroups_joinedGroups">
|
|
||||||
{ groupNodes }
|
{ groupNodes }
|
||||||
</div>
|
</GeminiScrollbar> :
|
||||||
</div> :
|
|
||||||
<div className="mx_MyGroups_placeholder">
|
<div className="mx_MyGroups_placeholder">
|
||||||
{ _t(
|
{ _t(
|
||||||
"You're not currently a member of any communities.",
|
"You're not currently a member of any communities.",
|
||||||
@ -176,6 +176,7 @@ export default withMatrixClient(React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_MyGroups_content">
|
<div className="mx_MyGroups_content">
|
||||||
|
{ contentHeader }
|
||||||
{ content }
|
{ content }
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
|
@ -44,21 +44,21 @@ export default React.createClass({
|
|||||||
|
|
||||||
const label = <EmojiText
|
const label = <EmojiText
|
||||||
element="div"
|
element="div"
|
||||||
title={groupName}
|
title={this.props.group.groupId}
|
||||||
className="mx_GroupInviteTile_name"
|
className="mx_RoomTile_name"
|
||||||
dir="auto"
|
dir="auto"
|
||||||
>
|
>
|
||||||
{ groupName }
|
{ groupName }
|
||||||
</EmojiText>;
|
</EmojiText>;
|
||||||
|
|
||||||
const badge = <div className="mx_GroupInviteTile_badge">!</div>;
|
const badge = <div className="mx_RoomSubList_badge mx_RoomSubList_badgeHighlight">!</div>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AccessibleButton className="mx_GroupInviteTile" onClick={this.onClick}>
|
<AccessibleButton className="mx_RoomTile mx_RoomTile_highlight" onClick={this.onClick}>
|
||||||
<div className="mx_GroupInviteTile_avatarContainer">
|
<div className="mx_RoomTile_avatar">
|
||||||
{ av }
|
{ av }
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_GroupInviteTile_nameContainer">
|
<div className="mx_RoomTile_nameContainer">
|
||||||
{ label }
|
{ label }
|
||||||
{ badge }
|
{ badge }
|
||||||
</div>
|
</div>
|
||||||
|
@ -194,6 +194,9 @@ module.exports = React.createClass({
|
|||||||
node.parentNode.replaceChild(pillContainer, node);
|
node.parentNode.replaceChild(pillContainer, node);
|
||||||
// Pills within pills aren't going to go well, so move on
|
// Pills within pills aren't going to go well, so move on
|
||||||
pillified = true;
|
pillified = true;
|
||||||
|
|
||||||
|
// update the current node with one that's now taken its place
|
||||||
|
node = pillContainer;
|
||||||
}
|
}
|
||||||
} else if (node.nodeType == Node.TEXT_NODE) {
|
} else if (node.nodeType == Node.TEXT_NODE) {
|
||||||
const Pill = sdk.getComponent('elements.Pill');
|
const Pill = sdk.getComponent('elements.Pill');
|
||||||
|
@ -555,13 +555,23 @@ module.exports = React.createClass({
|
|||||||
render: function() {
|
render: function() {
|
||||||
const RoomSubList = sdk.getComponent('structures.RoomSubList');
|
const RoomSubList = sdk.getComponent('structures.RoomSubList');
|
||||||
|
|
||||||
const inviteSectionExtraTiles = this._makeGroupInviteTiles();
|
|
||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
return (
|
return (
|
||||||
<GeminiScrollbar className="mx_RoomList_scrollbar"
|
<GeminiScrollbar className="mx_RoomList_scrollbar"
|
||||||
autoshow={true} onScroll={self._whenScrolling} ref="gemscroll">
|
autoshow={true} onScroll={self._whenScrolling} ref="gemscroll">
|
||||||
<div className="mx_RoomList">
|
<div className="mx_RoomList">
|
||||||
|
<RoomSubList list={[]}
|
||||||
|
extraTiles={this._makeGroupInviteTiles()}
|
||||||
|
label={_t('Community Invites')}
|
||||||
|
editable={false}
|
||||||
|
order="recent"
|
||||||
|
isInvite={true}
|
||||||
|
collapsed={self.props.collapsed}
|
||||||
|
searchFilter={self.props.searchFilter}
|
||||||
|
onHeaderClick={self.onSubListHeaderClick}
|
||||||
|
onShowMoreRooms={self.onShowMoreRooms}
|
||||||
|
/>
|
||||||
|
|
||||||
<RoomSubList list={self.state.lists['im.vector.fake.invite']}
|
<RoomSubList list={self.state.lists['im.vector.fake.invite']}
|
||||||
label={_t('Invites')}
|
label={_t('Invites')}
|
||||||
editable={false}
|
editable={false}
|
||||||
@ -573,7 +583,6 @@ module.exports = React.createClass({
|
|||||||
searchFilter={self.props.searchFilter}
|
searchFilter={self.props.searchFilter}
|
||||||
onHeaderClick={self.onSubListHeaderClick}
|
onHeaderClick={self.onSubListHeaderClick}
|
||||||
onShowMoreRooms={self.onShowMoreRooms}
|
onShowMoreRooms={self.onShowMoreRooms}
|
||||||
extraTiles={inviteSectionExtraTiles}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<RoomSubList list={self.state.lists['m.favourite']}
|
<RoomSubList list={self.state.lists['m.favourite']}
|
||||||
|
@ -326,6 +326,7 @@
|
|||||||
"Drop here to tag %(section)s": "Drop here to tag %(section)s",
|
"Drop here to tag %(section)s": "Drop here to tag %(section)s",
|
||||||
"Press <StartChatButton> to start a chat with someone": "Press <StartChatButton> to start a chat with someone",
|
"Press <StartChatButton> to start a chat with someone": "Press <StartChatButton> to start a chat with someone",
|
||||||
"You're not in any rooms yet! Press <CreateRoomButton> to make a room or <RoomDirectoryButton> to browse the directory": "You're not in any rooms yet! Press <CreateRoomButton> to make a room or <RoomDirectoryButton> to browse the directory",
|
"You're not in any rooms yet! Press <CreateRoomButton> to make a room or <RoomDirectoryButton> to browse the directory": "You're not in any rooms yet! Press <CreateRoomButton> to make a room or <RoomDirectoryButton> to browse the directory",
|
||||||
|
"Community Invites": "Community Invites",
|
||||||
"Invites": "Invites",
|
"Invites": "Invites",
|
||||||
"Favourites": "Favourites",
|
"Favourites": "Favourites",
|
||||||
"People": "People",
|
"People": "People",
|
||||||
|
Loading…
Reference in New Issue
Block a user