Convert VerificationQRCode to TS
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
05971e0492
commit
88cadd52a8
1 changed files with 8 additions and 8 deletions
|
@ -15,20 +15,20 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { replaceableComponent } from "../../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../../utils/replaceableComponent";
|
||||||
import QRCode from "../QRCode";
|
import QRCode from "../QRCode";
|
||||||
|
import { QRCodeData } from "matrix-js-sdk/src/crypto/verification/QRCode";
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
qrCodeData: QRCodeData;
|
||||||
|
}
|
||||||
|
|
||||||
@replaceableComponent("views.elements.crypto.VerificationQRCode")
|
@replaceableComponent("views.elements.crypto.VerificationQRCode")
|
||||||
export default class VerificationQRCode extends React.PureComponent {
|
export default class VerificationQRCode extends React.PureComponent<IProps> {
|
||||||
static propTypes = {
|
public render(): JSX.Element {
|
||||||
qrCodeData: PropTypes.object.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
return (
|
||||||
<QRCode
|
<QRCode
|
||||||
data={[{ data: this.props.qrCodeData.buffer, mode: 'byte' }]}
|
data={[{ data: this.props.qrCodeData.getBuffer(), mode: 'byte' }]}
|
||||||
className="mx_VerificationQRCode"
|
className="mx_VerificationQRCode"
|
||||||
width={196} />
|
width={196} />
|
||||||
);
|
);
|
Loading…
Reference in a new issue