Skip to content

Commit

Permalink
refactor: Make qr code mobile friendly (#436)
Browse files Browse the repository at this point in the history
Signed-off-by: Yummy-Yums <[email protected]>
  • Loading branch information
Yummy-Yums authored Feb 17, 2025
1 parent d101c47 commit 6edf3c9
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.hyperledger.identus.mediator

import org.scalajs.dom
import com.raquo.laminar.api.L._
import com.raquo.laminar.api.L.*
import typings.qrcodeGenerator

import zio.json._
import fmgp.did._
import fmgp.did.comm._
import zio.json.*
import fmgp.did.*
import fmgp.did.comm.*
import fmgp.did.comm.protocol.oobinvitation.OOBInvitation
import typings.qrcodeGenerator.anon.CellSize

object MediatorInfo {

Expand All @@ -22,12 +22,13 @@ object MediatorInfo {
val fullPath = s"${scheme}//${host}"
val qrCodeData = OutOfBand.from(invitation.toPlaintextMessage).makeURI(s"$fullPath")

val divQRCode = div()
val divQRCode = div(width := "55%")
{
val aux = qrcodeGenerator.mod.^.apply(qrcodeGenerator.TypeNumber.`0`, qrcodeGenerator.ErrorCorrectionLevel.L)
aux.addData(qrCodeData)
aux.make()
divQRCode.ref.innerHTML = aux.createSvgTag(8d)
val cellSize = CellSize().setScalable(true)
divQRCode.ref.innerHTML = aux.createSvgTag(cellSize)
}

def apply(): HtmlElement = // rootElement
Expand Down

0 comments on commit 6edf3c9

Please sign in to comment.