@@ -13,10 +13,10 @@ import Tooltip from "@/components/ui/Tooltip.vue"
1313import { fetchPriceSeries } from " @/services/api/stats"
1414
1515/** Store */
16- import { useAppStore } from " @/store/app"
17- import { useRollupsRankingStore } from " @/store/rollupsrank "
16+ import { useAppStore } from " @/store/app.store "
17+ import { useActivityStore } from " @/store/activity.store "
1818const appStore = useAppStore ()
19- const rollupRankingStore = useRollupsRankingStore ()
19+ const activityStore = useActivityStore ()
2020
2121const head = computed (() => appStore .lastHead )
2222const currentPrice = computed (() => appStore .currentPrice )
@@ -26,15 +26,15 @@ const totalSupplyUSD = computed(() => totalSupply.value * currentPrice.value?.cl
2626const totalFees = computed (() => head .value .total_fee / 1_000_000 )
2727const totalFeesUSD = computed (() => totalFees .value * currentPrice .value ? .close )
2828const topRollup = computed (() => {
29- let rankCategory = getRankCategory (roundTo (rollupRankingStore ? .rollups_ranking ? .top_rollup ? .rank / 10 , 0 ))
29+ let rankCategory = getRankCategory (roundTo (activityStore ? .rollups_ranking ? .top_rollup ? .rank / 10 , 0 ))
3030 return {
31- slug: rollupRankingStore ? .rollups_ranking ? .top_rollup ? .slug ,
32- name: rollupRankingStore ? .rollups_ranking ? .top_rollup ? .name ,
31+ slug: activityStore ? .rollups_ranking ? .top_rollup ? .slug ,
32+ name: activityStore ? .rollups_ranking ? .top_rollup ? .name ,
3333 rank: {
3434 name: rankCategory? .name ,
35- score: rollupRankingStore ? .rollups_ranking ? .top_rollup ? .rank ,
35+ score: activityStore ? .rollups_ranking ? .top_rollup ? .rank ,
3636 color: rankCategory? .color ,
37- }
37+ },
3838 }
3939})
4040
@@ -46,16 +46,16 @@ const price = reactive({
4646})
4747
4848onMounted (async () => {
49- const dataSeries = await fetchPriceSeries ( { from: parseInt (DateTime .now ().minus ({ days: 3 }).ts / 1_000 )})
49+ const dataSeries = await fetchPriceSeries ({ from: parseInt (DateTime .now ().minus ({ days: 3 }).ts / 1_000 ) })
5050 series .value = dataSeries
5151 appStore .currentPrice = series .value [0 ]
5252 price .value = parseFloat (series .value [0 ].close )
5353
5454 const prevDayClosePrice = parseFloat (series .value [1 ].close )
5555 price .diff = (Math .abs (prevDayClosePrice - price .value ) / ((prevDayClosePrice + price .value ) / 2 )) * 100
56- let side = ' stay'
56+ let side = " stay"
5757 if (price .value - prevDayClosePrice !== 0 ) {
58- side = price .value - prevDayClosePrice > 0 ? ' rise' : ' fall'
58+ side = price .value - prevDayClosePrice > 0 ? " rise" : " fall"
5959 }
6060 price .side = side
6161})
@@ -69,12 +69,20 @@ onMounted(async () => {
6969 < NuxtLink : to= " `/rollup/rank/${topRollup?.slug}`" >
7070 < Tooltip>
7171 < Flex align= " center" gap= " 6" : class = " $style.stat" >
72- < Icon v- if = " topRollup?.name" name= " laurel" size= " 14" : color= " topRollup?.rank?.color" : style= " {marginTop: '1px'}" / >
73- < Icon v- else name= " laurel" size= " 14" color= " tertiary" : class = " $style.icon" : style= " {marginTop: '1px'}" / >
72+ < Icon
73+ v- if = " topRollup?.name"
74+ name= " laurel"
75+ size= " 14"
76+ : color= " topRollup?.rank?.color"
77+ : style= " { marginTop: '1px' }"
78+ / >
79+ < Icon v- else name= " laurel" size= " 14" color= " tertiary" : class = " $style.icon" : style= " { marginTop: '1px' }" / >
7480 < Flex align= " center" gap= " 4" >
7581 < Text size= " 12" weight= " 500" color= " tertiary" noWrap : class = " $style.key" > Top Rollup: < / Text >
7682
77- < Text v- if = " topRollup?.name" size= " 12" weight= " 600" color= " secondary" noWrap : class = " $style.value" > {{ topRollup? .name }} < / Text >
83+ < Text v- if = " topRollup?.name" size= " 12" weight= " 600" color= " secondary" noWrap : class = " $style.value" >
84+ {{ topRollup? .name }}
85+ < / Text >
7886 < Skeleton v- else w= " 40" h= " 12" / >
7987 < / Flex>
8088 < / Flex>
@@ -103,7 +111,9 @@ onMounted(async () => {
103111 < Flex align= " center" gap= " 4" >
104112 < Text size= " 12" weight= " 500" color= " tertiary" noWrap : class = " $style.key" > Txs: < / Text >
105113
106- < Text v- if = " head.total_tx" size= " 12" weight= " 600" noWrap : class = " $style.value" > {{ abbreviate (head .total_tx ) }}< / Text >
114+ < Text v- if = " head.total_tx" size= " 12" weight= " 600" noWrap : class = " $style.value" > {{
115+ abbreviate (head .total_tx )
116+ }}< / Text >
107117 < Skeleton v- else w= " 40" h= " 12" / >
108118 < / Flex>
109119 < / Flex>
0 commit comments