-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Michele F. <michele-franchi@users.noreply.github.com>
- Loading branch information
1 parent
36d1f43
commit f211ebc
Showing
20 changed files
with
1,238 additions
and
1,803 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<template> | ||
<app-dropdown v-if="status === 'connected'"> | ||
<div class="wallet-account-controls"> | ||
<app-identicon | ||
:hash="aeSdk.address" | ||
class="wallet-account-controls__identicon"/> | ||
<app-link | ||
class="wallet-account-controls__link" | ||
to="/wallet"> | ||
{{ formatEllipseHash(aeSdk.address) }} | ||
</app-link> | ||
</div> | ||
<template #menu> | ||
<app-button @click="disconnectWallet"> | ||
Disconnect Wallet | ||
</app-button> | ||
</template> | ||
</app-dropdown> | ||
|
||
<app-button | ||
v-else | ||
class="wallet-account-controls__button" | ||
to="/wallet"> | ||
Connect Wallet | ||
</app-button> | ||
</template> | ||
<script setup> | ||
import { storeToRefs } from 'pinia' | ||
import { formatEllipseHash } from '@/utils/format' | ||
import { useWalletStore } from '@/stores/wallet' | ||
const { go } = useRouter() | ||
const walletStore = useWalletStore() | ||
const { aeSdk, status } = storeToRefs(walletStore) | ||
const { disconnect } = walletStore | ||
function disconnectWallet() { | ||
disconnect() | ||
go() | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.wallet-account-controls { | ||
display: flex; | ||
align-items: center; | ||
&__identicon { | ||
margin-right: var(--space-1); | ||
width: 32px; | ||
} | ||
&__link { | ||
font-family: var(--font-monospaced); | ||
font-size: 13px; | ||
} | ||
&__button { | ||
color: var(--color-white) !important; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<template> | ||
<account-details-panel | ||
v-if="accountDetails" | ||
class="wallet-account-panel__account-details-panel" | ||
:account-details="accountDetails"/> | ||
|
||
<client-only> | ||
<app-tabs | ||
v-if="isTabsVisible" | ||
v-model="activeTabIndex"> | ||
<app-tab title="Activities"> | ||
<account-activities-panel/> | ||
</app-tab> | ||
<app-tab title="Transactions"> | ||
<account-transactions-panel/> | ||
</app-tab> | ||
<app-tab title="AENS Names"> | ||
<account-names-panel/> | ||
</app-tab> | ||
<app-tab | ||
title="Tokens" | ||
:is-preselected="isTokensTabSelected"> | ||
<account-tokens-panel/> | ||
</app-tab> | ||
</app-tabs> | ||
</client-only> | ||
</template> | ||
<script setup> | ||
import { storeToRefs } from 'pinia' | ||
import { useRoute, useRouter } from 'nuxt/app' | ||
import { useWalletStore } from '@/stores/wallet' | ||
import { useAccountStore } from '@/stores/accountDetails' | ||
import { isDesktop } from '@/utils/screen' | ||
const walletStore = useWalletStore() | ||
const accountStore = useAccountStore() | ||
const { aeSdk } = storeToRefs(walletStore) | ||
const { accountDetails, accountTokens } = storeToRefs(accountStore) | ||
const { fetchAccount } = accountStore | ||
const TAB_KEYS = ['activities', 'transactions', 'aens-names', 'tokens'] | ||
const { push, replace } = useRouter() | ||
const route = useRoute() | ||
const isTabsVisible = computed(() => process.client && | ||
((accountDetails.value && !accountDetails.value?.notExistent) || | ||
!!accountTokens.value?.data.length)) | ||
const isTokensTabSelected = computed(() => process.client && | ||
accountDetails.value?.notExistent && | ||
!!accountTokens.value?.data.length) | ||
const activeTabIndex = computed({ | ||
get() { | ||
const { type: activeTabName } = route.query | ||
if (activeTabName === undefined) { | ||
return 0 | ||
} | ||
return TAB_KEYS.indexOf(activeTabName) | ||
}, | ||
set(index) { | ||
const newRoute = { | ||
query: { | ||
type: TAB_KEYS[index], | ||
}, | ||
} | ||
if (activeTabIndex.value === index) { | ||
// if navigating back | ||
return replace(newRoute) | ||
} | ||
return push(newRoute) | ||
}, | ||
}) | ||
if (process.client) { | ||
const limit = isDesktop() ? null : 3 | ||
await fetchAccount(aeSdk.value.address, { limit }) | ||
watch(() => aeSdk.value.address, async() => { | ||
await fetchAccount(aeSdk.value.address, { limit }) | ||
}) | ||
} | ||
</script> | ||
<style scoped> | ||
.wallet-account-panel__account-details-panel { | ||
margin-bottom: var(--space-4); | ||
@media (--desktop) { | ||
margin-bottom: var(--space-6); | ||
} | ||
} | ||
</style> |
Oops, something went wrong.