web/lukegbcom/wifi-qrcode: if no psk, don't show the password: line

This commit is contained in:
Luke Granger-Brown 2022-05-01 16:26:03 +01:00
parent e32a2520e8
commit 247f90d129

View file

@ -36,8 +36,6 @@ function generateQRString(details) {
function WifiQRCode({ details }) {
const hasLogo = details.eventName.match(/^http[s]?:/)
console.log(generateQRString(details))
return (
<div className={styles.background}>
<div className={styles.page}>
@ -46,7 +44,7 @@ function WifiQRCode({ details }) {
<h1 className={styles.event}>{details.eventName}</h1>}
<h2 className={styles.network}>SSID: {details.ssid}</h2>
<QRCodeSVG value={generateQRString(details)} level={"M"} includeMargin={false} size={128} className={styles.qrcode} />
<div className={styles.passwordContainer}>Password: <tt className={styles.password}>{details.psk}</tt></div>
{details.psk ? <div className={styles.passwordContainer}>Password: <tt className={styles.password}>{details.psk}</tt></div> : null}
<img src={"../../assets/wifi.png"} className={styles.wifiLogo} />
</div>
</div>