move p tags for subtitles out of switch
This commit is contained in:
parent
942669ae65
commit
1b2fba3fe2
1 changed files with 18 additions and 22 deletions
|
@ -226,8 +226,8 @@ module.exports = React.createClass({
|
||||||
switch (joinRule) {
|
switch (joinRule) {
|
||||||
case "invite":
|
case "invite":
|
||||||
subTitle = [
|
subTitle = [
|
||||||
<p key="subTitle1">{_t("Sadly, you can only join it with a working invite.")}</p>,
|
_t("Sadly, you can only join it with a working invite."),
|
||||||
<p key="subTitle2">{ errCodeMessage }</p>,
|
errCodeMessage,
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
case "public":
|
case "public":
|
||||||
|
@ -246,19 +246,16 @@ module.exports = React.createClass({
|
||||||
case MessageCase.InvitedEmailMismatch: {
|
case MessageCase.InvitedEmailMismatch: {
|
||||||
title = _t("The room invite wasn't sent to your account");
|
title = _t("The room invite wasn't sent to your account");
|
||||||
const joinRule = this._joinRule();
|
const joinRule = this._joinRule();
|
||||||
switch (joinRule) {
|
if (joinRule === "public") {
|
||||||
case "public":
|
subTitle = _t("Luckily, you can still join it because this is a public room.");
|
||||||
subTitle = _t("Luckily, you can still join it because this is a public room.");
|
primaryActionLabel = _t("Join the discussion");
|
||||||
primaryActionLabel = _t("Join the discussion");
|
primaryActionHandler = this.props.onJoinClick;
|
||||||
|
} else {
|
||||||
|
subTitle = _t("Sign in with a different account, ask for another invite, or add the e-mail address %(email)s to this account.", {email: this.props.invitedEmail});
|
||||||
|
if (joinRule !== "invite") {
|
||||||
|
primaryActionLabel = _t("Try to join anyway");
|
||||||
primaryActionHandler = this.props.onJoinClick;
|
primaryActionHandler = this.props.onJoinClick;
|
||||||
break;
|
}
|
||||||
default:
|
|
||||||
subTitle = _t("Sign in with a different account, ask for another invite, or add the e-mail address %(email)s to this account.", {email: this.props.invitedEmail});
|
|
||||||
if (joinRule !== "invite") {
|
|
||||||
primaryActionLabel = _t("Try to join anyway");
|
|
||||||
primaryActionHandler = this.props.onJoinClick;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -293,12 +290,12 @@ module.exports = React.createClass({
|
||||||
case MessageCase.OtherError: {
|
case MessageCase.OtherError: {
|
||||||
title = _t("%(roomName)s is not accessible at this time.", {roomName: this._roomName()});
|
title = _t("%(roomName)s is not accessible at this time.", {roomName: this._roomName()});
|
||||||
subTitle = ([
|
subTitle = ([
|
||||||
<p key="subTitle1">{ _t("Try again later, or ask a room admin to check if you have access.") }</p>,
|
_t("Try again later, or ask a room admin to check if you have access."),
|
||||||
<p key="subTitle2">{ _t("%(errcode)s was returned when trying to access the room.", {errcode: this.props.error.errcode}) }</p>,
|
_t("%(errcode)s was returned when trying to access the room.", {errcode: this.props.error.errcode}),
|
||||||
<p key="subTitle3">{ _t("If you think you're seeing this message in error, please <issueLink>submit a bug report</issueLink>.", {}, {
|
_t("If you think you're seeing this message in error, please <issueLink>submit a bug report</issueLink>.", {}, {
|
||||||
issueLink: label => <a href="https://github.com/vector-im/riot-web/issues/new/choose"
|
issueLink: label => <a href="https://github.com/vector-im/riot-web/issues/new/choose"
|
||||||
target="_blank" rel="noopener">{ label }</a>,
|
target="_blank" rel="noopener">{ label }</a>,
|
||||||
}) }</p>,
|
}),
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -308,11 +305,10 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
let subTitleElements;
|
let subTitleElements;
|
||||||
if (subTitle) {
|
if (subTitle) {
|
||||||
if (Array.isArray(subTitle)) {
|
if (!Array.isArray(subTitle)) {
|
||||||
subTitleElements = subTitle;
|
subTitle = [subTitle];
|
||||||
} else {
|
|
||||||
subTitleElements = [<p key="subTitle1">{ subTitle }</p>];
|
|
||||||
}
|
}
|
||||||
|
subTitleElements = subTitle.map((t, i) => <p key={`subTitle${i}`}>{t}</p>);
|
||||||
}
|
}
|
||||||
|
|
||||||
const classes = classNames("mx_RoomPreviewBar", "dark-panel", {
|
const classes = classNames("mx_RoomPreviewBar", "dark-panel", {
|
||||||
|
|
Loading…
Reference in a new issue