Skip to content

Commit 8bb9022

Browse files
committed
Add blobstream to footer and cmd
1 parent 3290b23 commit 8bb9022

5 files changed

Lines changed: 44 additions & 11 deletions

File tree

components/TheFooter.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ const handleChangeTheme = (target) => {
165165
<NuxtLink to="/addresses" :class="$style.link">
166166
<Text size="12" weight="500" color="tertiary"> Addresses </Text>
167167
</NuxtLink>
168+
<NuxtLink to="/blobstream" :class="$style.link">
169+
<Text size="12" weight="500" color="tertiary"> Blobstream </Text>
170+
</NuxtLink>
168171
<NuxtLink to="/gas" :class="$style.link">
169172
<Text size="12" weight="500" color="tertiary"> Gas Tracker </Text>
170173
</NuxtLink>

components/cmd/CommandMenu.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,15 @@ const rawNavigationActions = [
273273
router.push("/addresses")
274274
},
275275
},
276+
{
277+
type: "callback",
278+
icon: "arrow-narrow-right",
279+
title: "Go to Blobstream",
280+
runText: "Open Blobstream",
281+
callback: () => {
282+
router.push("/blobstream")
283+
},
284+
},
276285
{
277286
type: "callback",
278287
icon: "arrow-narrow-right",

components/ui/Modal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ const onKeydown = (e) => {
201201
202202
.close_icon {
203203
position: absolute;
204-
top: 16px;
205-
right: 16px;
204+
top: 12px;
205+
right: 12px;
206206
207207
fill: var(--txt-tertiary);
208208
background: transparent;

pages/blobstream.vue

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import { DateTime } from "luxon"
44
55
/** UI */
66
import Button from "@/components/ui/Button.vue"
7-
import Tooltip from "@/components/ui/Tooltip.vue"
8-
import AmountInCurrency from "@/components/AmountInCurrency.vue"
7+
// import Tooltip from "@/components/ui/Tooltip.vue"
98
109
/** Services */
1110
import { capitilize, comma, shortHex } from "@/services/utils"
1211
1312
/** API */
14-
import { fetchNetworks, fetchCommitments, fetchCommitmentsByNetwork, fetchContracts } from "@/services/api/blobstream";
13+
import { fetchNetworks, fetchCommitments, fetchCommitmentsByNetwork } from "@/services/api/blobstream";
1514
1615
/** Store */
1716
import { useCacheStore } from "@/store/cache"
@@ -72,17 +71,21 @@ const router = useRouter()
7271
7372
const isRefetching = ref(false)
7473
const networks = ref([])
75-
const selectedNetwork = ref("")
7674
const commitments = ref([])
7775
7876
const page = ref(route.query.page ? parseInt(route.query.page) : 1)
77+
const selectedNetwork = ref(route.query.network ? route.query.network : "")
7978
const handleNextCondition = ref(true)
8079
const limit = ref(20)
8180
const sort = ref("desc")
8281
8382
const getNetworks = async () => {
8483
const { data } = await fetchNetworks()
8584
networks.value = data.value.filter(n => n.last_height > 0)
85+
86+
if (networks.value.length === 1) {
87+
selectedNetwork.value = networks.value[0].network
88+
}
8689
}
8790
8891
const getCommitments = async () => {
@@ -107,18 +110,27 @@ const getCommitments = async () => {
107110
commitments.value = data.value
108111
}
109112
110-
handleNextCondition.value = commitments.value.length < limit.value
113+
handleNextCondition.value = commitments.value?.length < limit.value
111114
112115
isRefetching.value = false
113116
}
114117
118+
const updateRouteQuery = () => {
119+
router.replace({
120+
query: {
121+
network: selectedNetwork.value ? selectedNetwork.value : undefined,
122+
page: page.value,
123+
},
124+
})
125+
}
126+
115127
/** Refetch commitments */
116128
watch(
117129
() => page.value,
118130
async () => {
119131
getCommitments()
120132
121-
router.replace({ query: { page: page.value } })
133+
updateRouteQuery()
122134
},
123135
)
124136
@@ -130,6 +142,8 @@ watch(
130142
} else {
131143
page.value = 1
132144
}
145+
146+
updateRouteQuery()
133147
},
134148
)
135149
@@ -189,7 +203,7 @@ getCommitments()
189203
align="center"
190204
direction="column"
191205
gap="12"
192-
:class="[$style.card_network, selectedNetwork === n.network && $style.card_active, isRefetching && $style.disabled]"
206+
:class="[$style.card_network, selectedNetwork === n.network && $style.card_active, isRefetching && $style.disabled, networks?.length === 1 && $style.unclickable]"
193207
>
194208
<Flex align="center" gap="6">
195209
<Text size="13" weight="600" height="110" color="primary"> {{ capitilize(n.network) }} </Text>
@@ -235,7 +249,7 @@ getCommitments()
235249
</Flex>
236250
237251
<Flex direction="column" gap="16" wide :class="[$style.table, isRefetching && $style.disabled]">
238-
<div v-if="commitments.length > 0" :class="$style.table_scroller">
252+
<div v-if="commitments?.length > 0" :class="$style.table_scroller">
239253
<table>
240254
<thead>
241255
<tr>
@@ -487,7 +501,11 @@ getCommitments()
487501
}
488502
489503
.card_active {
490-
box-shadow: inset 0 0 0 1px var(--neutral-green);
504+
box-shadow: inset 0 0 0 1px var(--green);
505+
}
506+
507+
.unclickable {
508+
pointer-events: none;
491509
}
492510
493511
.empty {

services/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ export const useBlobstreamURL = () => {
7575
case "mocha.celenium.io":
7676
return Server.BLOBSTREAM.testnet
7777

78+
case "arabica.celenium.io":
79+
return Server.BLOBSTREAM.testnet
80+
7881
default:
7982
return Server.BLOBSTREAM.mainnet
8083
}

0 commit comments

Comments
 (0)