Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update app btns & QR code #3681

Merged
merged 15 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/playground/src/components/deposit_dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</v-col>
<v-divider class="mx-4" vertical></v-divider>
<v-col>
<QRPlayStore :qr="qrCodeText" />
<QRPlayStore :qr="qrCodeText" :msg="qrHeader" />
</v-col>
</v-row>
</v-container>
Expand Down Expand Up @@ -94,6 +94,8 @@ const props = defineProps({
openDepositDialog: Boolean,
twinId: Number,
});
const qrHeader = `<b> OR </b>
<p class="mb-3">Use ThreeFold Connect to scan this QRcode:</p>`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the best practice is to use slot,


function loadingDots() {
if (dots.value === "...") {
Expand Down
4 changes: 2 additions & 2 deletions packages/playground/src/components/qr_play_store.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<div class="d-flex flex-column text-center align-center">
<b> OR </b>
<p class="mb-3">Use ThreeFold Connect to scan this QRcode:</p>
<span v-html="msg"></span>
<div class="d-flex justify-center py-2">
<QrcodeGenerator :data="props.qr" />
</div>
Expand All @@ -22,6 +21,7 @@
<script setup lang="ts">
const props = defineProps({
qr: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! we can use this component to have the login QR code as well!

msg: String,
});

const apps = [
Expand Down
7 changes: 6 additions & 1 deletion packages/playground/src/dashboard/twin_view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
<v-col lg="4" md="12" sm="12" class="my-4" v-if="profileManager.profile">
<QRPlayStore
:qr="'TFT:' + bridge + '?message=twin_' + profileManager.profile.twinId + '&sender=me&amount=100'"
:msg="qrHeader"
/>
</v-col>
</v-row>
Expand All @@ -204,6 +205,8 @@ import { KycStatus } from "@threefold/grid_client";
import { generatePublicKey } from "@threefold/rmb_direct_client";
import { computed, onMounted, ref } from "vue";

import { manual } from "@/utils/manual";

import router from "../router";
import { useGrid, useProfileManager } from "../stores";
import type { FarmInterface } from "../types";
Expand Down Expand Up @@ -233,7 +236,9 @@ const kycDialogLoading = ref(false);
const profileManagerController = useProfileManagerController();
const balance = profileManagerController.balance;
const insufficientBalance = computed(() => balance.value?.free == undefined || balance.value?.free < 100);

const qrHeader = computed(() => {
return `Scan the QR code using <a class="app-link" href="${manual.tf_connect_app}" target="_blank">Threefold Connect</a> to fund your account.`;
});
onMounted(async () => {
const profile = profileManager.profile!;
if (!grid) {
Expand Down
4 changes: 4 additions & 0 deletions packages/playground/src/weblets/profile_manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@
<section class="qr d-flex flex-column align-center">
<QRPlayStore
:qr="'TFT:' + bridge + '?message=twin_' + profileManager.profile.twinId + '&sender=me&amount=100'"
:msg="qrHeader"
/>
</section>
</v-col>
Expand Down Expand Up @@ -454,6 +455,9 @@ const props = defineProps({
type: Boolean,
},
});
const qrHeader = computed(() => {
return `Scan the QR code using <a class="app-link" href="${manual.tf_connect_app}" target="_blank">Threefold Connect</a> to fund your account.`;
});
const mnemonicRef = ref();
const emailRef = ref();

Expand Down
Loading