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

feat: Wallet account view 4 #678

Merged
merged 74 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
f7e82c0
add basic wallet connection
janmichek Oct 25, 2023
0a703fe
fix header styles
janmichek Oct 25, 2023
8c2c797
add basic connection UI
janmichek Oct 26, 2023
d8b2949
componentize UI
janmichek Oct 26, 2023
84d0241
print basic account information
janmichek Oct 26, 2023
4fa3684
fix scanning wallet
janmichek Oct 31, 2023
8e51885
add hint
janmichek Oct 31, 2023
4a025cf
add disconnect action
janmichek Oct 31, 2023
7ac1dec
display all account information
janmichek Oct 31, 2023
3062026
create dropdown UI
janmichek Nov 1, 2023
4f8a619
fix header controls
janmichek Nov 1, 2023
0e2c3d2
fix css selector
janmichek Nov 1, 2023
676fc42
fix network id connection
janmichek Nov 1, 2023
2e7589f
extend button UI
janmichek Nov 1, 2023
1d8aec0
detect denied status
janmichek Nov 1, 2023
c8e883f
handle denied state
janmichek Nov 1, 2023
ba20011
fix imports
janmichek Nov 1, 2023
1ba4594
fix loading transitions
janmichek Nov 1, 2023
64c6159
fix connection controls
janmichek Nov 2, 2023
4b1d5ec
change button style
janmichek Nov 2, 2023
5121c1b
remove comments
janmichek Nov 2, 2023
9affa85
remove unused code
janmichek Nov 2, 2023
c3b2c63
update navigation when wallet changed
janmichek Nov 6, 2023
9685710
fix reloading page after wallet disconnect
janmichek Nov 9, 2023
be6bc87
fix identicon image
janmichek Nov 9, 2023
a411e38
fix identicon
janmichek Nov 9, 2023
62e7d3c
fix cors
janmichek Nov 13, 2023
547e4d5
fix cors attempt
janmichek Nov 13, 2023
0bd93c3
fix cors attempt
janmichek Nov 13, 2023
d41469c
fix cors attempt
janmichek Nov 13, 2023
dce5b01
fix cors attempt
janmichek Nov 13, 2023
fa3f3dd
fix cors attempt
janmichek Nov 13, 2023
0cac19e
fix cors attempt
janmichek Nov 13, 2023
dbf3f55
fix cors attempt
janmichek Nov 13, 2023
d81ea05
fix cors attempt
janmichek Nov 13, 2023
e131740
fix cors attempt
janmichek Nov 13, 2023
0f0949d
fix cors attempt
janmichek Nov 13, 2023
f05bfd8
fix cors attempt
janmichek Nov 13, 2023
9ba06a0
fix cors attempt
janmichek Nov 13, 2023
7bcaa55
regenerate yarn.lock
janmichek Dec 20, 2023
ec1918c
fix code style
janmichek Dec 20, 2023
717178f
fix after rebase
janmichek Mar 11, 2024
60d1a50
enlarge button
janmichek Mar 19, 2024
ccff919
fix env example
janmichek Mar 19, 2024
0f92db7
improve ui
janmichek Mar 19, 2024
5c69a5b
change hint
janmichek Mar 19, 2024
7b3afdd
change hint
janmichek Mar 19, 2024
1a78c91
fix code style
janmichek May 23, 2024
2a1c571
regenerate yarn lock
janmichek May 23, 2024
1a09bb1
regenerate yarn lock
janmichek May 23, 2024
c9e201d
Merge branch 'develop' into Wallet-assets-listing
janmichek May 29, 2024
d365eaa
regenerate yarn lock
janmichek May 29, 2024
6f3aa2c
regenerate yarn lock
janmichek May 29, 2024
fa8e136
remove duplicate dependency
janmichek Jun 3, 2024
2e5a0f1
remove unused code
janmichek Jun 3, 2024
889b7de
Merge branch 'develop' into Wallet-assets-listing
janmichek Jun 5, 2024
25d1940
Merge branch 'develop' into Wallet-assets-listing
janmichek Jun 5, 2024
e3c47a9
regenerate yarn lock
janmichek Jun 5, 2024
120b62c
Merge branch 'develop' into Wallet-assets-listing
janmichek Jul 18, 2024
a3401e6
fix indent
janmichek Jul 18, 2024
db353ae
fix layout
janmichek Jul 18, 2024
4f72169
remove unused panel header
janmichek Jul 22, 2024
f8b6605
Merge branch 'develop' into Wallet-assets-listing
janmichek Jul 22, 2024
f3756a2
regenerate yarn.lock
janmichek Jul 22, 2024
d21e085
enlarge button
janmichek Jul 22, 2024
fff7ca5
detect new status
janmichek Jul 22, 2024
dad3329
fix loading state
janmichek Jul 23, 2024
61bcd02
change CSP server settings
janmichek Jul 23, 2024
2878c3a
change CSP server settings
janmichek Jul 23, 2024
26c09db
change CSP server settings
janmichek Jul 23, 2024
19f8928
fix typo
janmichek Jul 23, 2024
4b6bd7a
add avatar proxy
janmichek Jul 23, 2024
9947a36
revert headers settings
janmichek Jul 23, 2024
9367b03
change wording
janmichek Jul 23, 2024
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
42 changes: 19 additions & 23 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,51 @@ import {sentryVitePlugin} from '@sentry/vite-plugin'
export default defineNuxtConfig({
srcDir: './src',
css: ['@/assets/styles/main.css'],

devServer: {
port: 8080,
},

nitro: {
routeRules: {
"/proxy/avatar/**": {proxy: 'https://avatars.z52da5wt.xyz/**', cors: true,},
'/proxy/nodes': {proxy: 'http://138.68.22.27:3113/v2/debug/network', cors: true},
'/proxy/gate': {proxy: 'https://api.gateio.ws/api/v4/spot/tickers?currency_pair=AE_USDT', cors: true},
'/proxy/mexc': {proxy: 'https://api.mexc.com/api/v3/ticker/24hr?symbol=AEUSDT', cors: true},
'/proxy/coinw': {proxy: 'https://api.coinw.com/api/v1/public?command=returnTicker', cors: true},
},
},

modules: [
'@pinia/nuxt',
'@nuxtjs/plausible',
'nuxt-monaco-editor',
'nuxt-booster',
],

imports: {
dirs: ['./stores'],
},

plausible: {
apiHost: 'https://plausible.dev.service.aepps.com',
trackLocalhost: false,
},

appConfig: {
APP_VERSION: process.env.APP_VERSION,
},

runtimeConfig: {
public: {
SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN,
SENTRY_DSN: process.env.SENTRY_DSN,
APP_DOMAIN: process.env.APP_DOMAIN,
MIDDLEWARE_URL: process.env.MIDDLEWARE_URL,
NODE_URL: process.env.NODE_URL,
WEBSOCKET_URL: process.env.WEBSOCKET_URL,
DEX_BACKEND_URL: process.env.DEX_BACKEND_URL,
NETWORK_NAME: process.env.NETWORK_NAME,
ALTERNATIVE_NETWORK_URL: process.env.ALTERNATIVE_NETWORK_URL,
ALTERNATIVE_NETWORK_NAME: process.env.ALTERNATIVE_NETWORK_NAME,
AE_TOKEN_ID: process.env.AE_TOKEN_ID,
DEBUG_MODE: process.env.DEBUG_MODE,
CONTRACT_VERIFICATION_SERVICE_URL: process.env.CONTRACT_VERIFICATION_SERVICE_URL,
SH_DEX_CONTRACTS: process.env.SH_DEX_CONTRACTS?.split(';'),
SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN,
SENTRY_DSN: process.env.SENTRY_DSN,
APP_DOMAIN: process.env.APP_DOMAIN,
MIDDLEWARE_URL: process.env.MIDDLEWARE_URL,
NODE_URL: process.env.NODE_URL,
WEBSOCKET_URL: process.env.WEBSOCKET_URL,
DEX_BACKEND_URL: process.env.DEX_BACKEND_URL,
NETWORK_NAME: process.env.NETWORK_NAME,
NETWORK_ID: process.env.NETWORK_ID,
ALTERNATIVE_NETWORK_URL: process.env.ALTERNATIVE_NETWORK_URL,
ALTERNATIVE_NETWORK_NAME: process.env.ALTERNATIVE_NETWORK_NAME,
AE_TOKEN_ID: process.env.AE_TOKEN_ID,
DEBUG_MODE: process.env.DEBUG_MODE,
CONTRACT_VERIFICATION_SERVICE_URL: process.env.CONTRACT_VERIFICATION_SERVICE_URL,
SH_DEX_CONTRACTS: process.env.SH_DEX_CONTRACTS?.split(';'),
},
},

janmichek marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -70,9 +65,7 @@ export default defineNuxtConfig({
'postcss-nested': {},
},
},

sourcemap: true,

vite: {
build: {target: 'es2020'},
optimizeDeps: {
Expand All @@ -97,6 +90,7 @@ export default defineNuxtConfig({
transformAssetUrls: false,
})


return `${code}\nexport default { render: render }`
},
},
Expand All @@ -122,5 +116,7 @@ export default defineNuxtConfig({
},
},


compatibilityDate: '2024-07-16',

})
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
},
"dependencies": {
"@aeternity/aepp-sdk": "^13.3.2",
"@download/blockies": "^1.0.3",
"@sentry/tracing": "^7.114.0",
"@sentry/vite-plugin": "^2.21.1",
"@sentry/vue": "^8.17.0",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/styles/elements/_table.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ td {
vertical-align: middle;

@media (--desktop) {
padding: 10px var(--space-0) var(--space-1);
padding: 10px var(--space-0) var(--space-1) 0;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ defineProps({
text-decoration: none;
letter-spacing: 0.015em;

padding: var(--space-0) var(--space-1);
padding: var(--space-1);

border-radius: 4px;

Expand Down
6 changes: 4 additions & 2 deletions src/components/AppDropdown.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<VMenu placement="bottom">
<slot/>
<VMenu placement="bottom">
<span>
<slot/>
</span>

<template #popper>
<slot name="menu"/>
Expand Down
26 changes: 6 additions & 20 deletions src/components/AppIdenticon.vue
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
<template>
<canvas
ref="identicon"
class="app-identicon"/>
<img
:src="`/proxy/avatar/${hash}`"
class="identicon">
</template>

<script setup>
import { renderIcon } from '@download/blockies'
import { ref } from 'vue'

const props = defineProps({
id: {
defineProps({
hash: {
type: String,
required: true,
},
})

onMounted(render)

const identicon = ref()

function render() {
renderIcon(
{ seed: props.id },
identicon.value,
)
}
</script>

<style scoped>
.app-identicon {
.identicon {
display: inline-block;
border-radius: 50%;
}
Expand Down
26 changes: 11 additions & 15 deletions src/components/AppTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,19 @@ defineProps({
.v-popper {
display: inline-block;

&__popper {
&.v-popper--theme-tooltip {
.v-popper__inner {
margin: 0 var(--space-2);
padding: var(--space-3);
background: var(--color-midnight);
color: var(--color-white);
border: none;
word-break: break-word;
/* stylelint-disable max-nesting-depth */
/* as it is 3rd party component */
@media (--desktop) {
word-break: normal;
}
&__popper.v-popper--theme-tooltip {
.v-popper__inner {
margin: 0 var(--space-2);
padding: var(--space-3);
background: var(--color-midnight);
color: var(--color-white);
border: none;
word-break: break-word;

@media (--desktop) {
word-break: normal;
}
}
}
}

</style>
2 changes: 2 additions & 0 deletions src/components/TheHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
:class="[
'header__network-select',
{ 'header__network-select--open': isMobileMenuOpen }]"/>

<the-wallet-account-controls class="u-hidden-mobile"/>
</div>
<div
v-if="isSyncing"
Expand Down
63 changes: 63 additions & 0 deletions src/components/TheWalletAccountControls.vue
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>
2 changes: 1 addition & 1 deletion src/components/TokenSymbolIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<app-identicon
v-else
:id="contractId"/>
:hash="contractId"/>
</template>
<script setup>
import { useRuntimeConfig } from 'nuxt/app'
Expand Down
98 changes: 98 additions & 0 deletions src/components/WalletAccountPanel.vue
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>
Loading
Loading