1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-04-20 08:16:38 +02:00

Replace deprecated QRCode component with QRCodeSVG

This commit is contained in:
Aleksandr Gumroian 2025-04-16 16:43:05 +02:00
parent e01295504b
commit 5d0276a80f
No known key found for this signature in database
GPG Key ID: 9E77849C64F0A733

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2019-2024 CZ.NIC z.s.p.o. (https://www.nic.cz/) * Copyright (C) 2019-2025 CZ.NIC z.s.p.o. (https://www.nic.cz/)
* *
* This is free software, licensed under the GNU General Public License v3. * This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information. * See /LICENSE for more information.
@ -9,7 +9,7 @@ import React, { useState } from "react";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import QRCode from "qrcode.react"; import { QRCodeSVG } from "qrcode.react";
import { createAndDownloadPdf, toQRCodeContent } from "./qrCodeHelpers"; import { createAndDownloadPdf, toQRCodeContent } from "./qrCodeHelpers";
import Button from "../../bootstrap/Button"; import Button from "../../bootstrap/Button";
@ -69,13 +69,12 @@ function QRCodeModal({ shown, setShown, SSID, password }) {
<Modal setShown={setShown} shown={shown}> <Modal setShown={setShown} shown={shown}>
<ModalHeader setShown={setShown} title={_("Wi-Fi QR Code")} /> <ModalHeader setShown={setShown} title={_("Wi-Fi QR Code")} />
<ModalBody> <ModalBody>
<QRCode <QRCodeSVG
className="d-block mx-auto img-logo-black" className="d-block mx-auto img-logo-black"
renderAs="svg"
value={toQRCodeContent(SSID, password)} value={toQRCodeContent(SSID, password)}
level="M" level="M"
size={350} size={350}
includeMargin marginSize={0}
/> />
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>