Skip to content

Commit

Permalink
Resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
balaktsisc committed Feb 29, 2024
1 parent f9e76d2 commit 86b4e1d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
53 changes: 47 additions & 6 deletions src/lib/components/wallet/QRGenerator.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,60 @@
<script lang='ts'>
import { onMount } from 'svelte';
// import QRCode from 'qrcode-generator';
import QRCode from 'qrcode'
import type { qrItem } from './qrItem';
import { alertController } from 'ionic-svelte';
import { qrStore } from './qrStore';
import { goto } from '$app/navigation';
import { reload } from 'ionicons/icons';
export let qr1: qrItem;
onMount(() => {
const qrCodeElement = document.getElementById(qr1.data);
QRCode.toCanvas(qrCodeElement, qr1.data, { width: 200, height: 200 });
});
const showAlert = async (options) => {
const alert = await alertController.create(options);
await alert.present();
};
function deleteQR() {
const options = {
header: 'Αφαίρεση QR;',
message: 'Θέλεις να αφαιρεθεί το QR από το πορτοφόλι σου;',
buttons: [{
text: 'ΟΧΙ',
role: 'cancel',
handler: () => {
return;
}
},
{
text: 'ΝΑΙ',
role: 'confirm',
handler: () => {
qrStore.update((store) => store.filter((item) => item.data !== qr1.data));
}
}]
};
showAlert(options);
}
</script>


<div style="display: flex; flex-direction: column; align-items: center;">
<ion-label>{qr1.title}</ion-label>
<canvas style="padding:0; margin:0;" id="{qr1.data}"></canvas>
</div>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<ion-div on:click={deleteQR}>
<canvas id="{qr1.data}"></canvas>
<ion-label>{qr1.title}</ion-label>
</ion-div>

<style>
ion-div {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
</style>
2 changes: 1 addition & 1 deletion src/routes/pages/homepage/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,4 @@
justify-content: center;
align-items: center;
}
</style>
</style>

0 comments on commit 86b4e1d

Please sign in to comment.