From cbdeb4345ae00c078a495c9bf0fb10a00315df3c Mon Sep 17 00:00:00 2001 From: AnisHADJARAB Date: Fri, 27 Sep 2024 15:12:37 +0000 Subject: [PATCH] fix pairing to adapt to latest version - still mocking ending --- public/style/4nk.css | 14 +- src/html/confirmation-modal.html | 15 ++ src/html/confirmation-modal.js | 13 ++ src/html/home.js | 14 +- src/html/login-modal.html | 13 +- src/index.ts | 9 +- src/services/database.ts | 2 +- src/services/routing.service.ts | 53 ++++++- src/services/service.ts | 262 +++++++++++++++++++------------ src/websockets.ts | 7 + vite.config.ts | 2 + 11 files changed, 281 insertions(+), 123 deletions(-) create mode 100644 src/html/confirmation-modal.html create mode 100644 src/html/confirmation-modal.js diff --git a/public/style/4nk.css b/public/style/4nk.css index abf34bd..852af49 100644 --- a/public/style/4nk.css +++ b/public/style/4nk.css @@ -20,6 +20,10 @@ body { background-blend-mode :soft-light; height: 100vh; } + .message { + font-size: 14px; + overflow-wrap: anywhere; + } /** Modal Css */ .modal { @@ -35,7 +39,7 @@ body { } .modal-content { - width: 40%; + width: 55%; height: 30%; background-color: white; border-radius: 4px; @@ -55,14 +59,14 @@ body { } .confirmation-box { - margin-top: 20px; + /* margin-top: 20px; */ align-content: center; width: 70%; height: 20%; - padding: 20px; - font-size: 1.6em; + /* padding: 20px; */ + font-size: 1.5em; color: #333333; - top: 20%; + top: 5%; position: relative; } diff --git a/src/html/confirmation-modal.html b/src/html/confirmation-modal.html new file mode 100644 index 0000000..2c3557c --- /dev/null +++ b/src/html/confirmation-modal.html @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/src/html/confirmation-modal.js b/src/html/confirmation-modal.js new file mode 100644 index 0000000..2349489 --- /dev/null +++ b/src/html/confirmation-modal.js @@ -0,0 +1,13 @@ +import Routing from "/src/services/routing.service.ts"; + +const router = await Routing.getInstance(); +export async function confirm() { + router.confirm() +} + +export async function closeConfirmationModal() { + router.closeConirmationModal() +} + +window.confirm = confirm; +window.closeConfirmationModal = closeConfirmationModal; \ No newline at end of file diff --git a/src/html/home.js b/src/html/home.js index 85464cf..0ad4963 100644 --- a/src/html/home.js +++ b/src/html/home.js @@ -25,9 +25,9 @@ document.querySelectorAll('.tab').forEach(tab => { //// Modal - export async function openModal(prd) { + export async function openModal(myAddress, receiverAddress) { const router = await Routing.getInstance(); - router.openLoginModal(prd) + router.openLoginModal(myAddress, receiverAddress) } @@ -73,12 +73,12 @@ docReady(function () { }); function scanDevice() { - service.sendPairingTx('decodedText') + // service.sendPairingTx('decodedText') - // const scannerImg = document.querySelector('#scanner') - // if(scannerImg) scannerImg.style.display = 'none' - // const scannerQrCode = document.querySelector('.qr-code-scanner') - // if(scannerQrCode) scannerQrCode.style.display = 'block' + const scannerImg = document.querySelector('#scanner') + if(scannerImg) scannerImg.style.display = 'none' + const scannerQrCode = document.querySelector('.qr-code-scanner') + if(scannerQrCode) scannerQrCode.style.display = 'block' } window.scanDevice = scanDevice \ No newline at end of file diff --git a/src/html/login-modal.html b/src/html/login-modal.html index 48677b1..a83dca2 100644 --- a/src/html/login-modal.html +++ b/src/html/login-modal.html @@ -1,9 +1,16 @@ -