Skip to content

Commit

Permalink
Merge pull request #2538 from matrix-org/bwindels/community-redesign-…
Browse files Browse the repository at this point in the history
…cleanup

Redesign: community page cleanup
  • Loading branch information
bwindels committed Jan 31, 2019
2 parents 31ae357 + d8226b3 commit 60f2826
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
9 changes: 7 additions & 2 deletions res/css/structures/_GroupView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ limitations under the License.
}

.mx_GroupView_header {
min-height: 70px;
min-height: 52px;
align-items: center;
display: flex;
padding-bottom: 10px;
Expand All @@ -34,7 +34,7 @@ limitations under the License.
.mx_GroupView_header_view {
border-bottom: 1px solid $primary-hairline-color;
padding-bottom: 0px;
padding-left: 8px;
padding-left: 19px;
padding-right: 8px;
}

Expand Down Expand Up @@ -349,3 +349,8 @@ limitations under the License.
.mx_GroupView_changeDelayWarning {
padding: 40px 20px;
}

.mx_GroupView .mx_MemberInfo .gm-scroll-view > :not(.mx_MemberInfo_avatar) {
padding-left: 16px;
padding-right: 16px;
}
2 changes: 1 addition & 1 deletion res/css/views/rooms/_MemberList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ limitations under the License.
padding: 8px;
margin: 9px;
display: flex;
justify-content: center;
color: $button-fg-color;
font-weight: 600;

Expand All @@ -82,7 +83,6 @@ limitations under the License.
}

.mx_MemberList_invite span {
margin: 0 auto;
background-image: url('$(res)/img/feather-icons/user-add.svg');
background-repeat: no-repeat;
background-position: center left;
Expand Down
4 changes: 2 additions & 2 deletions src/components/structures/GroupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ export default React.createClass({
avatarImage = <GroupAvatar groupId={this.props.groupId}
groupName={this.state.profileForm.name}
groupAvatarUrl={this.state.profileForm.avatar_url}
width={48} height={48} resizeMethod='crop'
width={28} height={28} resizeMethod='crop'
/>;
}

Expand Down Expand Up @@ -1228,7 +1228,7 @@ export default React.createClass({
groupAvatarUrl={groupAvatarUrl}
groupName={groupName}
onClick={onGroupHeaderItemClick}
width={48} height={48}
width={28} height={28}
/>;
if (summary.profile && summary.profile.name) {
nameNode = <div onClick={onGroupHeaderItemClick}>
Expand Down
23 changes: 9 additions & 14 deletions src/components/views/groups/GroupMemberInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,15 @@ module.exports = React.createClass({
}
}

const avatarUrl = this.context.matrixClient.mxcUrlToHttp(
this.props.groupMember.avatarUrl,
36, 36, 'crop',
);

const BaseAvatar = sdk.getComponent('avatars.BaseAvatar');
const avatar = (
<BaseAvatar name={this.props.groupMember.userId} width={36} height={36}
url={avatarUrl}
/>
);
const avatarUrl = this.props.groupMember.avatarUrl;
let avatarElement;
if (avatarUrl) {
const httpUrl = this.context.matrixClient.mxcUrlToHttp(avatarUrl, 800, 800);
avatarElement = (<div className="mx_MemberInfo_avatar">
<img src={httpUrl} />
</div>);
}

const groupMemberName = (
this.props.groupMember.displayname || this.props.groupMember.userId
Expand All @@ -190,10 +188,7 @@ module.exports = React.createClass({
<AccessibleButton className="mx_MemberInfo_cancel" onClick={this._onCancel}>
<img src={require("../../../../res/img/cancel.svg")} width="18" height="18" className="mx_filterFlipColor" />
</AccessibleButton>
<div className="mx_MemberInfo_avatar">
{ avatar }
</div>

{ avatarElement }
<EmojiText element="h2">{ groupMemberName }</EmojiText>

<div className="mx_MemberInfo_profile">
Expand Down
18 changes: 9 additions & 9 deletions src/components/views/groups/GroupRoomInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ module.exports = React.createClass({
},

render: function() {
const BaseAvatar = sdk.getComponent('avatars.BaseAvatar');
const EmojiText = sdk.getComponent('elements.EmojiText');
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
const InlineSpinner = sdk.getComponent('elements.InlineSpinner');
Expand Down Expand Up @@ -204,22 +203,23 @@ module.exports = React.createClass({
</div>;
}

const avatarUrl = this.context.matrixClient.mxcUrlToHttp(
this.state.groupRoom.avatarUrl,
36, 36, 'crop',
);
const avatarUrl = this.state.groupRoom.avatarUrl;
let avatarElement;
if (avatarUrl) {
const httpUrl = this.context.matrixClient.mxcUrlToHttp(avatarUrl, 800, 800);
avatarElement = (<div className="mx_MemberInfo_avatar">
<img src={httpUrl} />
</div>);
}

const groupRoomName = this.state.groupRoom.displayname;
const avatar = <BaseAvatar name={groupRoomName} width={36} height={36} url={avatarUrl} />;
return (
<div className="mx_MemberInfo">
<GeminiScrollbarWrapper autoshow={true}>
<AccessibleButton className="mx_MemberInfo_cancel" onClick={this._onCancel}>
<img src={require("../../../../res/img/cancel.svg")} width="18" height="18" className="mx_filterFlipColor" />
</AccessibleButton>
<div className="mx_MemberInfo_avatar">
{ avatar }
</div>
{ avatarElement }

<EmojiText element="h2">{ groupRoomName }</EmojiText>

Expand Down
2 changes: 1 addition & 1 deletion test/components/structures/GroupView-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('GroupView', function() {
expect(avatarImgElement).toBeTruthy();
expect(avatarImgElement.src).toContain(
'https://my.home.server/_matrix/media/v1/thumbnail/' +
'someavatarurl?width=48&height=48&method=crop',
'someavatarurl?width=28&height=28&method=crop',
);

const name = ReactTestUtils.findRenderedDOMComponentWithClass(root, 'mx_GroupView_header_name');
Expand Down

0 comments on commit 60f2826

Please sign in to comment.