Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -27,14 +27,14 @@ interface IProps extends QRCodeRenderersOptions {
|
|||
}
|
||||
|
||||
const defaultOptions: QRCodeToDataURLOptions = {
|
||||
errorCorrectionLevel: 'L', // we want it as trivial-looking as possible
|
||||
errorCorrectionLevel: "L", // we want it as trivial-looking as possible
|
||||
};
|
||||
|
||||
const QRCode: React.FC<IProps> = ({ data, className, ...options }) => {
|
||||
const [dataUri, setUri] = React.useState<string>(null);
|
||||
React.useEffect(() => {
|
||||
let cancelled = false;
|
||||
toDataURL(data, { ...defaultOptions, ...options }).then(uri => {
|
||||
toDataURL(data, { ...defaultOptions, ...options }).then((uri) => {
|
||||
if (cancelled) return;
|
||||
setUri(uri);
|
||||
});
|
||||
|
@ -43,9 +43,11 @@ const QRCode: React.FC<IProps> = ({ data, className, ...options }) => {
|
|||
};
|
||||
}, [JSON.stringify(data), options]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
return <div className={classNames("mx_QRCode", className)}>
|
||||
{ dataUri ? <img src={dataUri} className="mx_VerificationQRCode" alt={_t("QR Code")} /> : <Spinner /> }
|
||||
</div>;
|
||||
return (
|
||||
<div className={classNames("mx_QRCode", className)}>
|
||||
{dataUri ? <img src={dataUri} className="mx_VerificationQRCode" alt={_t("QR Code")} /> : <Spinner />}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default QRCode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue