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

Refactor Connect wallet #3827

Draft
wants to merge 32 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fbd12b5
Refactor(ProfileManager):
0oM4R Jan 16, 2025
6668980
WIP: add password field
0oM4R Jan 16, 2025
e2427a3
Refactor(ProfileManager):
0oM4R Jan 20, 2025
5cc3af9
Refactor(ProfileManager): create login tab
0oM4R Jan 20, 2025
fe7c495
Refactor(ProfileManager): create login, enahnce pawwsord field
0oM4R Jan 20, 2025
0959d9d
Refactor(ProfileManager):
0oM4R Jan 21, 2025
0f60d9e
Refactor(ProfileManager)/WIP:
0oM4R Jan 21, 2025
e56c4f7
Refactor(ProfileManager)/WIP: add a flag to prevent user to add email…
0oM4R Jan 22, 2025
87dacc9
Refactor(ProfileManager)/WIP: Enhance mnemonic validation flow
0oM4R Jan 22, 2025
b2bcfd8
Follow-Refactor(ProfileManager)/WIP: Enhance mnemonic validation flow
0oM4R Jan 22, 2025
fa22b79
Refactor(ProfileManager:TermsDialog
0oM4R Jan 22, 2025
e02a3bf
Refactor(ProfileManager:LoginTab):
0oM4R Jan 22, 2025
4e5c6b2
Refactor(ProfileManager:WalletPassword):
0oM4R Jan 22, 2025
fa7a8b8
Refactor(ProfileManager:ConnectWallet)WIP:
0oM4R Jan 22, 2025
1121e3e
Merge branch 'development' of github.com:threefoldtech/tfgrid-sdk-ts …
0oM4R Jan 23, 2025
1a87fe4
Refactor(ProfileManager:Walletlogin):
0oM4R Jan 23, 2025
dfabd7d
Refactor(ProfileManager:Walletlogin):
0oM4R Jan 23, 2025
3332700
Refactor(ProfileManager:ConnectWallet)WIP:
0oM4R Jan 23, 2025
36d2815
Refactor(ProfileManager): apply the new components and cleanup the code
0oM4R Jan 23, 2025
f68826e
Feature(ProfileManager): add skeleton loader
0oM4R Jan 23, 2025
2acadf2
Feature(ProfileManager):
0oM4R Jan 23, 2025
5211651
Chore(ProfileManager:connectWallet): add ids to elements
0oM4R Jan 29, 2025
b3c9975
Chore(ProfileManager:skeletonLoader): add ids to elements, and enhanc…
0oM4R Jan 29, 2025
fc93a45
FIX(ProfileManager): remove session storage
0oM4R Jan 29, 2025
91b9e14
FIX(ProfileManager): remove session storage
0oM4R Jan 29, 2025
bb5f2eb
chore(ProfileManager):
0oM4R Jan 29, 2025
ce9eb7e
FIX(ProfileManager): restore session storage
0oM4R Jan 29, 2025
d809598
Chore(ProfileManager): fix activate flow and add clear error function
0oM4R Jan 29, 2025
47262c9
Chore(ProfileManager): rename files and fix imports
0oM4R Jan 29, 2025
5723b8c
Chore(ProfileManager): remove extra lines of enable validation reload
0oM4R Jan 29, 2025
ba96570
Merge branch 'development' of github.com:threefoldtech/tfgrid-sdk-ts …
0oM4R Feb 2, 2025
ef37dee
FIX(ProfileManager): remove suspense to fix recursive calls error
0oM4R Feb 2, 2025
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
1 change: 1 addition & 0 deletions packages/playground/public/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
window.env = {
WALLET_KEY: "wallet.v1",
NETWORK: "dev",
GRAPHQL_STACKS: ["https://graphql.dev.grid.tf/graphql", "https://graphql.02.dev.grid.tf/graphql"],
GRIDPROXY_STACKS: ["https://gridproxy.dev.grid.tf", "https://gridproxy.02.dev.grid.tf"],
Expand Down
2 changes: 2 additions & 0 deletions packages/playground/scripts/build-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ STELLAR_ENV_Vars=(
STELLAR_HORIZON_URL
TFT_ASSET_ISSUER
)
WALLET_KEY="${WALLET_KEY:=wallet.v1}"

case $MODE in
"dev")
Expand Down Expand Up @@ -102,6 +103,7 @@ parss_array(){

configs="
window.env = {
WALLET_KEY: '$WALLET_KEY',
NETWORK: '$MODE',
GRAPHQL_STACKS: "[$(parss_array "$GRAPHQL_URL")]",
GRIDPROXY_STACKS: "[$(parss_array "$GRIDPROXY_URL")]",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<template>
<v-dialog :model-value="props.modelValue" persistent fullscreen width="100%" attach="#modals" id="terms-dialog">
<!-- Content card -->
<v-card id="terms-dialog__card-content" v-if="!loading">
<v-card-text class="pa-15" v-html="acceptTermsContent" id="terms-dialog__text-content"></v-card-text>
<div class="terms-footer" id="terms-dialog__footer">
<v-btn
class="mr-2"
id="terms-dialog__go-back-button"
@click="emit('update:modelValue', false)"
v-show="!loading"
:color="theme.name.value === AppThemeSelection.light ? 'black' : 'white'"
:text="capitalize('go back')"
/>
<v-btn
id="terms-dialog__accept-button"
@click="emit('onAccept')"
v-show="!loading"
:text="capitalize('accept terms and conditions')"
/>
</div>
</v-card>
<!-- Loading card -->
<v-card id="terms-dialog__card-loading" v-else :style="{ height: '100%' }">
<v-card-text
class="d-flex justify-center align-center"
:style="{ height: '100%' }"
id="terms-dialog__loading-content"
>
<v-progress-circular indeterminate id="terms-dialog__progress-indicator" />
</v-card-text>
</v-card>
</v-dialog>
</template>
<script lang="ts" setup>
import { marked } from "marked";
import { capitalize, onMounted, ref } from "vue";
import { useTheme } from "vuetify";

import { AppThemeSelection } from "@/utils/app_theme";

const loading = ref(true);
const acceptTermsContent = ref("");
const theme = useTheme();

const props = defineProps({
modelValue: {
required: true,
default: false,
type: Boolean,
},
});
const emit = defineEmits(["update:modelValue", "onAccept", "onError"]);

onMounted(async () => {
try {
const url = "https://library.threefold.me/info/legal/";
const response = await fetch(url + "readme.md");
const mdContent = await response.text();
const parsedContent = marked.parse(mdContent);

const tempDiv = document.createElement("div");
tempDiv.innerHTML = parsedContent;

parseAcceptTermsImage(tempDiv, url);
parseAcceptTermsLink(tempDiv);

const updatedHtmlContent = tempDiv.innerHTML;
acceptTermsContent.value = updatedHtmlContent;
} catch (error) {
console.error(error);
emit("onError", "Something went wrong while loading terms and conditions, please try again");
} finally {
loading.value = false;
}
});

function parseAcceptTermsImage(tempDiv: HTMLDivElement, url: string) {
const imageElements = tempDiv.querySelectorAll("img");
imageElements.forEach(imgElement => {
imgElement.setAttribute("src", url + "legal__legal_header_.jpg");
// Update the style of the image.
imgElement.setAttribute("class", "info-legal-image");
});
}

function parseAcceptTermsLink(tempDiv: HTMLDivElement) {
const url = "https://library.threefold.me/info/legal#";
const linkElements = tempDiv.querySelectorAll("a");
linkElements.forEach(linkElement => {
const currentDomainMatch = linkElement.href.match(/^(https?:\/\/[^\\/]+)/);
if (
(currentDomainMatch && linkElement.href.includes("localhost")) ||
(currentDomainMatch && linkElement.href.includes("dashboard")) // To update only internal links
) {
const currentDomain = currentDomainMatch[1];
linkElement.href = linkElement.href.replace(currentDomain, url);
}
});
}
</script>
Loading
Loading