diff --git a/resources/js/components/App.vue b/resources/js/components/App.vue index a0a541f..2fb6681 100644 --- a/resources/js/components/App.vue +++ b/resources/js/components/App.vue @@ -20,7 +20,7 @@ import ScaleTransition from '~/components/ScaleTransition.vue'; import SideNavbar from '~/components/SideNavbar.vue'; import SnackbarGroup from '~/components/SnackbarGroup.vue'; import UserNavbar from '~/components/UserNavbar.vue'; -import { watch } from 'vue'; +import { computed, watch } from 'vue'; import { useRouter } from 'vue-router'; const appStore = useAppStore(); @@ -30,6 +30,20 @@ const router = useRouter(); await appStore.init(); })(); +const canaryHost = computed(() => appStore.config.network === 'canary'); + +(() => { + if (window.bootstrap?.name) { + return; + } + + if (canaryHost.value) { + document.title = 'Canary Enjin Platform'; + } else { + document.title = 'Enjin Platform'; + } +})(); + watch( () => appStore.loggedIn, () => { diff --git a/resources/js/components/SideNavbar.vue b/resources/js/components/SideNavbar.vue index ad6f2ff..4526f44 100644 --- a/resources/js/components/SideNavbar.vue +++ b/resources/js/components/SideNavbar.vue @@ -46,22 +46,13 @@ import CanaryEnjinLogo from '~/components/CanaryEnjinLogo.vue'; const navigations = computed(() => useAppStore().navigations); -const canaryHost = computed( - () => - window.location.origin.includes('canary') || - window.location.origin.includes('staging') || - useAppStore().config.network === 'canary' -); +const canaryHost = computed(() => useAppStore().config.network === 'canary'); -(() => { - if (!canaryHost.value) { - document.title = 'Canary Enjin Platform'; - } else { - document.title = 'Enjin Platform'; +const pageTitle = () => { + if (window.bootstrap?.name) { + return window.bootstrap.name; } -})(); -const pageTitle = () => { if (canaryHost.value) { return 'Canary Platform'; } else { diff --git a/resources/js/components/SignTransaction.vue b/resources/js/components/SignTransaction.vue index 6b7732b..a1a574b 100644 --- a/resources/js/components/SignTransaction.vue +++ b/resources/js/components/SignTransaction.vue @@ -9,11 +9,19 @@ Signing
-
+
+ + Address: + + {{ addressShortHex(connectionStore.account.address) }} + + +
+
Transaction fee: - {{ `${feeCost} ENJ` }} + {{ `${feeCost} ${currencySymbolByNetwork(useAppStore().config.network)}` }}
@@ -40,7 +48,7 @@
-

Please sign your transaction in your wallet

+

Please sign the transaction in your wallet

@@ -56,8 +64,9 @@ import { ref } from 'vue'; import LoadingCircle from './LoadingCircle.vue'; import snackbar from '~/util/snackbar'; import Identicon from './Identicon.vue'; -import { formatPriceFromENJ } from '~/util'; +import { currencySymbolByNetwork, formatPriceFromENJ } from '~/util'; import { useConnectionStore } from '~/store/connection'; +import { useAppStore } from '~/store'; const props = defineProps<{ transaction: any; diff --git a/resources/js/components/UserNavbar.vue b/resources/js/components/UserNavbar.vue index a1c00ac..b63b780 100644 --- a/resources/js/components/UserNavbar.vue +++ b/resources/js/components/UserNavbar.vue @@ -64,14 +64,13 @@ const help = ref(false); const appStore = useAppStore(); const navigations = computed(() => appStore.navigations); -const canaryHost = computed( - () => - window.location.origin.includes('canary') || - window.location.origin.includes('staging') || - useAppStore().config.network === 'canary' -); +const canaryHost = computed(() => useAppStore().config.network === 'canary'); const pageTitle = () => { + if (window.bootstrap?.name) { + return window.bootstrap.name; + } + if (canaryHost.value) { return 'Canary Platform'; } else { diff --git a/resources/js/components/WalletConnectButton.vue b/resources/js/components/WalletConnectButton.vue index b700b93..582583b 100644 --- a/resources/js/components/WalletConnectButton.vue +++ b/resources/js/components/WalletConnectButton.vue @@ -6,7 +6,7 @@ > - +
@@ -68,6 +68,15 @@ const connectionStore = useConnectionStore(); const loading = ref(false); const showAccountsModal = ref(false); +const walletName = computed(() => { + if (connectionStore.provider === 'wc') { + return 'Enjin Wallet'; + } else if (connectionStore.provider === 'polkadot.js') { + return 'Polkadot.JS'; + } + + return ''; +}); const walletSession = computed(() => connectionStore.wallet); diff --git a/resources/js/components/pages/Settings.vue b/resources/js/components/pages/Settings.vue index 42cae75..6fa3340 100644 --- a/resources/js/components/pages/Settings.vue +++ b/resources/js/components/pages/Settings.vue @@ -162,7 +162,7 @@ const tokenName = ref(); const walletAccount = ref(publicKeyToAddress(appStore.user?.account)); const enableTokenCreate = ref(false); const enableAccountModify = ref(true); -const loading = ref(appStore.user ? false : true); +const loading = ref(appStore.user || !appStore.hasMultiTenantPackage ? false : true); const creating = ref(false); const updating = ref(false); @@ -287,4 +287,12 @@ watch( } } ); + +(() => { + setTimeout(() => { + if (loading.value) { + loading.value = false; + } + }, 2000); +})(); diff --git a/resources/js/shims-vue.d.ts b/resources/js/shims-vue.d.ts index f64a56d..c271a8e 100644 --- a/resources/js/shims-vue.d.ts +++ b/resources/js/shims-vue.d.ts @@ -7,7 +7,9 @@ declare module '*.vue' { interface Window { bootstrap: { + network: string; url: string; daemon: string; + name: string; }; } diff --git a/resources/js/store/index.ts b/resources/js/store/index.ts index 0e3c222..520fce1 100644 --- a/resources/js/store/index.ts +++ b/resources/js/store/index.ts @@ -65,11 +65,21 @@ export const useAppStore = defineStore('app', { link, }; }); - if (this.hasBeamPackage) this.addBeamNavigation(); - if (this.hasFuelTanksPackage) this.addFuelTanksNavigation(); - if (this.hasMarketplacePackage) this.addMarketplaceNavigation(); - if (this.loggedIn) await this.getUser(); + if (this.hasBeamPackage) { + this.addBeamNavigation(); + } + if (this.hasFuelTanksPackage) { + this.addFuelTanksNavigation(); + } + if (this.hasMarketplacePackage) { + this.addMarketplaceNavigation(); + } + + if (this.loggedIn && this.hasMultiTenantPackage) { + await this.getUser(); + } + await useConnectionStore().getSession(); return await this.fetchCollectionIds(); @@ -120,6 +130,14 @@ export const useAppStore = defineStore('app', { if (window.bootstrap?.daemon) { this.config.daemon = window.bootstrap.daemon; } + + if (window.bootstrap?.name) { + document.title = window.bootstrap.name; + } + + if (window.bootstrap?.network) { + this.config.network = window.bootstrap.network; + } }, async checkURL(url: URL) { try { @@ -248,5 +266,8 @@ export const useAppStore = defineStore('app', { hasMarketplacePackage(state: AppState) { return state.config.packages.find((p) => p.name === 'platform-marketplace'); }, + hasMultiTenantPackage(state: AppState) { + return state.config.packages.find((p) => p.name === 'platform-multi-tenant'); + }, }, }); diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php index f678d25..760cedc 100644 --- a/resources/views/app.blade.php +++ b/resources/views/app.blade.php @@ -15,7 +15,7 @@ @vite('resources/js/app.ts', 'vendor/platform-ui/build')