polish design and disable buttons after click
parent
ccf6c9efdc
commit
1f65cfb7f6
|
@ -132,4 +132,19 @@ limitations under the License.
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx_VerificationPanel_reciprocate_section {
|
||||||
|
.mx_FormButton {
|
||||||
|
margin: 0 10px;
|
||||||
|
padding: 10px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// show Yes/No buttons next to each other
|
||||||
|
.mx_VerificationPanel_reciprocateButtons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,6 +144,16 @@ export default class VerificationPanel extends React.PureComponent {
|
||||||
</React.Fragment>;
|
</React.Fragment>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onReciprocateYesClick = () => {
|
||||||
|
this.setState({reciprocateButtonClicked: true});
|
||||||
|
this.state.reciprocateQREvent.confirm();
|
||||||
|
};
|
||||||
|
|
||||||
|
_onReciprocateNoClick = () => {
|
||||||
|
this.setState({reciprocateButtonClicked: true});
|
||||||
|
this.state.reciprocateQREvent.cancel();
|
||||||
|
};
|
||||||
|
|
||||||
renderQRReciprocatePhase() {
|
renderQRReciprocatePhase() {
|
||||||
const {member} = this.props;
|
const {member} = this.props;
|
||||||
const FormButton = sdk.getComponent("elements.FormButton");
|
const FormButton = sdk.getComponent("elements.FormButton");
|
||||||
|
@ -152,15 +162,25 @@ export default class VerificationPanel extends React.PureComponent {
|
||||||
if (this.state.reciprocateQREvent) {
|
if (this.state.reciprocateQREvent) {
|
||||||
// riot web doesn't support scanning yet, so assume here we're the client being scanned.
|
// riot web doesn't support scanning yet, so assume here we're the client being scanned.
|
||||||
body = <React.Fragment>
|
body = <React.Fragment>
|
||||||
<p>{_t("Almost there! Is %(displayName)s show the same shield?", {
|
<p>{_t("Almost there! Is %(displayName)s showing the same shield?", {
|
||||||
displayName: member.displayName || member.name || member.userId,
|
displayName: member.displayName || member.name || member.userId,
|
||||||
})}</p>
|
})}</p>
|
||||||
<E2EIcon isUser={true} status="verified" size={128} hideTooltip={true} />
|
<E2EIcon isUser={true} status="verified" size={128} hideTooltip={true} />
|
||||||
<FormButton label={_t("No")} kind="danger" onClick={this.state.reciprocateQREvent.cancel} />
|
<div className="mx_VerificationPanel_reciprocateButtons">
|
||||||
<FormButton label={_t("Yes")} onClick={this.state.reciprocateQREvent.confirm} />
|
<FormButton
|
||||||
|
label={_t("No")} kind="danger"
|
||||||
|
disabled={this.state.reciprocateButtonClicked}
|
||||||
|
onClick={this._onReciprocateNoClick}
|
||||||
|
/>
|
||||||
|
<FormButton
|
||||||
|
label={_t("Yes")}
|
||||||
|
disabled={this.state.reciprocateButtonClicked}
|
||||||
|
onClick={this._onReciprocateYesClick}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</React.Fragment>;
|
</React.Fragment>;
|
||||||
} else {
|
} else {
|
||||||
body = <p><Spinner/></p>;
|
body = <p><Spinner /></p>;
|
||||||
}
|
}
|
||||||
return <div className="mx_UserInfo_container mx_VerificationPanel_reciprocate_section">
|
return <div className="mx_UserInfo_container mx_VerificationPanel_reciprocate_section">
|
||||||
<h3>{_t("Verify by scanning")}</h3>
|
<h3>{_t("Verify by scanning")}</h3>
|
||||||
|
|
Loading…
Reference in New Issue