Skip to content

Commit 733688b

Browse files
committed
Fix bugs and breadcrumbs refactoring
1 parent 6583f84 commit 733688b

File tree

9 files changed

+35
-14
lines changed

9 files changed

+35
-14
lines changed

assets/styles/base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ body {
245245
-webkit-font-smoothing: antialiased;
246246
-moz-osx-font-smoothing: grayscale;
247247

248-
user-select: none;
248+
user-select: text;
249249
}
250250

251251
*::-webkit-scrollbar {

components/cmd/CommandMenu.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,6 @@ const searchAction = {
862862
if (!searchTerm.value.length) return
863863
864864
const { data } = await search(searchTerm.value.trim())
865-
console.log('Manual search data', data);
866865
if (!data.value.length) {
867866
notificationsStore.create({
868867
notification: {
@@ -928,9 +927,6 @@ const debouncedSearch = useDebounceFn(async (e) => {
928927
929928
data.value = [...bookmarks, ...data.value]
930929
931-
console.log('debouncedSearch data', data);
932-
console.log('debouncedSearch bookmarks', bookmarks);
933-
934930
if (!data.value?.length) return
935931
936932
amp.log("showAutocomplete", { count: data.value.length, firstType: data.value[0].type })

components/modules/address/AddressOverview.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import UndelegationsTable from "./tables/UndelegationsTable.vue"
1717
import AmountInCurrency from "@/components/AmountInCurrency.vue"
1818
1919
/** Services */
20-
import { comma, tia } from "@/services/utils"
20+
import { comma, splitAddress } from "@/services/utils"
2121
import { MsgTypes } from "@/services/constants/messages"
2222
2323
/** API */
@@ -573,7 +573,7 @@ const handleOpenQRModal = () => {
573573
<Text size="12" weight="600" color="secondary">Address</Text>
574574
575575
<Flex align="center" gap="10">
576-
<AddressBadge :hash="address.hash" />
576+
<Text size="12" weight="600" color="secondary"> {{ splitAddress(address.hash) }} </Text>
577577
578578
<CopyButton :text="address.hash" />
579579
</Flex>

components/modules/tx/TxOverview.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const handleViewRawTransaction = () => {
7676

7777
<Flex align="center" gap="12">
7878
<BookmarkButton
79-
type="tx"
79+
type="transaction"
8080
:id="tx.hash"
8181
/>
8282

@@ -194,7 +194,6 @@ const handleViewRawTransaction = () => {
194194

195195
<CopyButton :text="tx.signers[0]" />
196196
</Flex>
197-
<!-- <Text size="12" weight="600" color="secondary"> {{ splitAddress(tx.signers[0]) }} </Text> -->
198197
</Flex>
199198
<Flex align="center" justify="between">
200199
<Text size="12" weight="600" color="tertiary"> Events</Text>

pages/address/[hash].vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ useHead({
7979
onBeforeRouteLeave(() => {
8080
cacheStore.current.address = null
8181
})
82+
83+
const displayName = computed(() => {
84+
const { $getDisplayName } = useNuxtApp()
85+
86+
return $getDisplayName('address', address.value.hash)
87+
})
8288
</script>
8389
8490
<template>
@@ -88,7 +94,7 @@ onBeforeRouteLeave(() => {
8894
:items="[
8995
{ link: '/', name: 'Explore' },
9096
{ link: '/addresses', name: 'Addresses' },
91-
{ link: route.fullPath, name: `${address.hash}` },
97+
{ link: route.fullPath, name: `${displayName}` },
9298
]"
9399
:class="$style.breadcrumbs"
94100
/>

pages/block/[height].vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ useHead({
8282
},
8383
],
8484
})
85+
86+
const displayName = computed(() => {
87+
const { $getDisplayName } = useNuxtApp()
88+
89+
return $getDisplayName('block', block.value?.height)
90+
})
8591
</script>
8692
8793
<template>
@@ -91,7 +97,7 @@ useHead({
9197
:items="[
9298
{ link: '/', name: 'Explore' },
9399
{ link: '/blocks', name: 'Blocks' },
94-
{ link: route.fullPath, name: `Block ${comma(block.height)}` },
100+
{ link: route.fullPath, name: `${displayName}` },
95101
]"
96102
:class="$style.breadcrumbs"
97103
/>

pages/namespace/[id].vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ useHead({
8080
onBeforeRouteLeave(() => {
8181
cacheStore.current.namespace = null
8282
})
83+
84+
const displayName = computed(() => {
85+
const { $getDisplayName } = useNuxtApp()
86+
87+
return $getDisplayName('namespace', namespace.value.namespace_id)
88+
})
89+
8390
</script>
8491
8592
<template>
@@ -90,7 +97,7 @@ onBeforeRouteLeave(() => {
9097
:items="[
9198
{ link: '/', name: 'Explore' },
9299
{ link: '/namespaces', name: 'Namespaces' },
93-
{ link: route.fullPath, name: `${getNamespaceID(namespace.namespace_id)}` },
100+
{ link: route.fullPath, name: `${displayName}` },
94101
]"
95102
/>
96103

pages/tx/[hash].vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ useHead({
8282
},
8383
],
8484
})
85+
86+
const displayName = computed(() => {
87+
const { $getDisplayName } = useNuxtApp()
88+
89+
return $getDisplayName('tx', tx.value?.hash)
90+
})
8591
</script>
8692
8793
<template>
@@ -93,7 +99,7 @@ useHead({
9399
{ link: '/txs', name: 'Transactions' },
94100
{
95101
link: route.fullPath,
96-
name: `Transaction ${tx.hash.toUpperCase().slice(0, 4)} ••• ${tx.hash.toUpperCase().slice(-4)}`,
102+
name: `${displayName}`,
97103
},
98104
]"
99105
:class="$style.breadcrumbs"

store/bookmarks.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const useBookmarksStore = defineStore("bookmarks", () => {
3939
for (let i = 0; i < store.length; i++) {
4040
let el = store[i]
4141
if (el.id === id) {
42-
return el.alias
42+
return el.alias || el.id
4343
}
4444
}
4545

@@ -99,6 +99,7 @@ export const useBookmarksStore = defineStore("bookmarks", () => {
9999
return bookmarks.value.namespaces
100100
case 'tx':
101101
case 'txs':
102+
case 'transaction':
102103
return bookmarks.value.txs
103104
default:
104105
return null

0 commit comments

Comments
 (0)