Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 668479d

Browse files
committed
Tweak as per git review
1 parent fa9fd97 commit 668479d

File tree

2 files changed

+35
-42
lines changed

2 files changed

+35
-42
lines changed

src/components/views/settings/tabs/room/BridgeSettingsTab.js

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2019 New Vector Ltd
2+
Copyright 2019 The Matrix.org Foundation C.I.C.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -33,17 +33,6 @@ export default class BridgeSettingsTab extends React.Component {
3333
roomId: PropTypes.string.isRequired,
3434
};
3535

36-
constructor() {
37-
super();
38-
39-
this.state = {
40-
};
41-
}
42-
43-
componentWillMount() {
44-
45-
}
46-
4736
_renderBridgeCard(event, room) {
4837
const content = event.getContent();
4938
if (!content || !content.channel || !content.protocol) {
@@ -56,21 +45,18 @@ export default class BridgeSettingsTab extends React.Component {
5645

5746
let creator = null;
5847
if (content.creator) {
59-
const pill = <Pill
60-
type={Pill.TYPE_USER_MENTION}
61-
room={room}
62-
url={makeUserPermalink(content.creator)}
63-
shouldShowPillAvatar={true}
64-
/>;
65-
creator = (<p>{
66-
_t("This bridge was provisioned by %(pill)s", {
67-
pill,
68-
})
69-
} </p>);
48+
creator = <p> { _t("This bridge was provisioned by <user />", {}, {
49+
user: <Pill
50+
type={Pill.TYPE_USER_MENTION}
51+
room={room}
52+
url={makeUserPermalink(content.creator)}
53+
shouldShowPillAvatar={true}
54+
/>,
55+
})}</p>;
7056
}
7157

72-
const bot = (<p> {_t("This bridge is managed by the %(pill)s bot user.", {
73-
pill: <Pill
58+
const bot = (<p> {_t("This bridge is managed by the <user /> bot user.", {}, {
59+
user: <Pill
7460
type={Pill.TYPE_USER_MENTION}
7561
room={room}
7662
url={makeUserPermalink(event.getSender())}
@@ -79,20 +65,20 @@ export default class BridgeSettingsTab extends React.Component {
7965
})} </p>);
8066
let channelLink = channelName;
8167
if (channel.external_url) {
82-
channelLink = <a target="_blank" href={channel.external_url}>{channelName}</a>;
68+
channelLink = <a target="_blank" href={channel.external_url} rel="noopener">{channelName}</a>;
8369
}
8470

8571
let networkLink = networkName;
8672
if (network && network.external_url) {
87-
networkLink = <a target="_blank" href={network.external_url}>{networkName}</a>;
73+
networkLink = <a target="_blank" href={network.external_url} rel="noopener">{networkName}</a>;
8874
}
8975

9076
const chanAndNetworkInfo = (
91-
(_t("Bridged into %(channelLink)s %(networkLink)s, on %(protocolName)s", {
77+
_t("Bridged into <channelLink /> <networkLink />, on <protocolName />", {}, {
9278
channelLink,
9379
networkLink,
9480
protocolName,
95-
}))
81+
})
9682
);
9783

9884
let networkIcon = null;
@@ -101,9 +87,13 @@ export default class BridgeSettingsTab extends React.Component {
10187
MatrixClientPeg.get().getHomeserverUrl(),
10288
network.avatar, 32, 32, "crop",
10389
);
104-
networkIcon = <BaseAvatar width={32} height={32} resizeMethod='crop'
105-
name={ networkName } idName={ networkName }
106-
url={ avatarUrl } />;
90+
networkIcon = <BaseAvatar
91+
width={32}
92+
height={32}
93+
resizeMethod='crop'
94+
name={ networkName }
95+
idName={ networkName }
96+
url={ avatarUrl } />;
10797
}
10898

10999
let channelIcon = null;
@@ -112,13 +102,16 @@ export default class BridgeSettingsTab extends React.Component {
112102
MatrixClientPeg.get().getHomeserverUrl(),
113103
channel.avatar, 32, 32, "crop",
114104
);
115-
console.log(channel.avatar);
116-
channelIcon = <BaseAvatar width={32} height={32} resizeMethod='crop'
117-
name={ networkName } idName={ networkName }
118-
url={ avatarUrl } />;
105+
channelIcon = <BaseAvatar
106+
width={32}
107+
height={32}
108+
resizeMethod='crop'
109+
name={ networkName }
110+
idName={ networkName }
111+
url={ avatarUrl } />;
119112
}
120113

121-
const heading = _t("Connected to %(channelIcon)s %(channelName)s on %(networkIcon)s %(networkName)s", {
114+
const heading = _t("Connected to <channelIcon /> <channelName /> on <networkIcon /> <networkName />", { }, {
122115
channelIcon,
123116
channelName,
124117
networkName,
@@ -127,7 +120,7 @@ export default class BridgeSettingsTab extends React.Component {
127120

128121
return (<li key={event.stateKey}>
129122
<div>
130-
<h3> {heading} </h3>
123+
<h3>{heading}</h3>
131124
<p>{_t("Connected via %(protocolName)s", { protocolName })}</p>
132125
<details>
133126
{creator}

src/i18n/strings/en_EN.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -763,10 +763,10 @@
763763
"Room version:": "Room version:",
764764
"Developer options": "Developer options",
765765
"Open Devtools": "Open Devtools",
766-
"This bridge was provisioned by %(pill)s": "This bridge was provisioned by %(pill)s",
767-
"This bridge is managed by the %(pill)s bot user.": "This bridge is managed by the %(pill)s bot user.",
768-
"Bridged into %(channelLink)s %(networkLink)s, on %(protocolName)s": "Bridged into %(channelLink)s %(networkLink)s, on %(protocolName)s",
769-
"Connected to %(channelIcon)s %(channelName)s on %(networkIcon)s %(networkName)s": "Connected to %(channelIcon)s %(channelName)s on %(networkIcon)s %(networkName)s",
766+
"This bridge was provisioned by <user />": "This bridge was provisioned by <user />",
767+
"This bridge is managed by the <user /> bot user.": "This bridge is managed by the <user /> bot user.",
768+
"Bridged into <channelLink /> <networkLink />, on <protocolName />": "Bridged into <channelLink /> <networkLink />, on <protocolName />",
769+
"Connected to <channelIcon /> <channelName /> on <networkIcon /> <networkName />": "Connected to <channelIcon /> <channelName /> on <networkIcon /> <networkName />",
770770
"Connected via %(protocolName)s": "Connected via %(protocolName)s",
771771
"Bridge Info": "Bridge Info",
772772
"Below is a list of bridges connected to this room.": "Below is a list of bridges connected to this room.",

0 commit comments

Comments
 (0)