Skip to content

Commit e919c06

Browse files
authored
Merge pull request #134 from celenium-io/dev
Terminal Link
2 parents 0117383 + febf727 commit e919c06

File tree

149 files changed

+3769
-4417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+3769
-4417
lines changed

.oxlintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"rules": {
3+
"no-async-promise-executor": "off"
4+
},
5+
"ignorePatterns": ["services/lumina-node-wasm/**", "services/utils/blob.js", "services/utils/blobtx.js"]
6+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"oxc.enable": true
3+
}

app.vue

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as Sentry from "@sentry/vue"
55
/** Services */
66
import Socket from "@/services/api/socket"
77
import amp from "@/services/amp"
8+
import { watchForUpdate } from "@/services/version"
89
910
/** Components */
1011
import ModalsManager from "@/components/modals/ModalsManager.vue"
@@ -16,22 +17,22 @@ import { fetchHead } from "@/services/api/main"
1617
import { fetchLatestBlocks } from "@/services/api/block"
1718
1819
/** Store */
19-
import { useNodeStore } from "@/store/node"
20-
import { useAppStore } from "@/store/app"
21-
import { useBookmarksStore } from "@/store/bookmarks"
22-
import { useSettingsStore } from "@/store/settings"
23-
import { useEnumStore } from "@/store/enums"
24-
import { useLegalStore } from "@/store/legal"
25-
import { useNotificationsStore } from "@/store/notifications"
26-
import { useRollupsRankingStore } from "@/store/rollupsrank"
20+
import { useNodeStore } from "@/store/node.store"
21+
import { useAppStore } from "@/store/app.store"
22+
import { useBookmarksStore } from "@/store/bookmarks.store"
23+
import { useSettingsStore } from "@/store/settings.store"
24+
import { useEnumStore } from "@/store/enums.store"
25+
import { useLegalStore } from "@/store/legal.store"
26+
import { useNotificationsStore } from "@/store/notifications.store"
27+
import { useActivityStore } from "@/store/activity.store"
2728
const nodeStore = useNodeStore()
2829
const appStore = useAppStore()
2930
const bookmarksStore = useBookmarksStore()
3031
const settingsStore = useSettingsStore()
3132
const enumStore = useEnumStore()
3233
const legalStore = useLegalStore()
3334
const notificationsStore = useNotificationsStore()
34-
const rollupsRankingStore = useRollupsRankingStore()
35+
const activityStore = useActivityStore()
3536
3637
bookmarksStore.$subscribe((mutation, state) => {
3738
localStorage.setItem("bookmarks", JSON.stringify(state.bookmarks))
@@ -42,11 +43,50 @@ settingsStore.$subscribe((mutation, state) => {
4243
legalStore.$subscribe((mutation, state) => {
4344
localStorage.setItem("legal", JSON.stringify(state.legal))
4445
})
45-
rollupsRankingStore.$subscribe((mutation, state) => {
46+
activityStore.$subscribe((mutation, state) => {
4647
localStorage.setItem("rollups_ranking", JSON.stringify(state.rollups_ranking))
4748
})
4849
50+
let watchInterval = null
51+
4952
onMounted(async () => {
53+
/**
54+
* Watch for package.json->version and notify users about the new version
55+
*/
56+
appStore.version = (await $fetch("/api/version")).version
57+
if (!import.meta.dev)
58+
watchInterval = watchForUpdate(appStore.version, (newVersion) => {
59+
clearInterval(watchInterval)
60+
notificationsStore.create({
61+
notification: {
62+
type: "success",
63+
icon: "info",
64+
title: "New update is available",
65+
description: "Refresh the page to get the latest update with new features & bug fixes.",
66+
autoDestroy: false,
67+
irremovable: true,
68+
actions: [
69+
{
70+
name: "Refresh",
71+
icon: "refresh",
72+
callback: () => {
73+
location.reload()
74+
},
75+
},
76+
{
77+
name: "Changelog",
78+
icon: "menu",
79+
callback: () => {
80+
window
81+
.open(`https://github.com/celenium-io/celenium-interface/releases/tag/v${newVersion}`, "_blank")
82+
.focus()
83+
},
84+
},
85+
],
86+
},
87+
})
88+
})
89+
5090
if (localStorage.bookmarks) {
5191
bookmarksStore.bookmarks = JSON.parse(localStorage.bookmarks)
5292
}
@@ -56,7 +96,7 @@ onMounted(async () => {
5696
}
5797
5898
settingsStore.init()
59-
rollupsRankingStore.init()
99+
activityStore.init()
60100
61101
const runtimeConfig = useRuntimeConfig()
62102
amp.init(runtimeConfig.public.AMP)
@@ -117,6 +157,10 @@ onMounted(async () => {
117157
Socket.close()
118158
}
119159
})
160+
161+
onBeforeUnmount(() => {
162+
clearInterval(watchInterval)
163+
})
120164
</script>
121165
122166
<template>
@@ -127,9 +171,9 @@ onMounted(async () => {
127171
<NuxtPage />
128172
129173
<div id="tooltip" />
130-
<div id="modal" />
131174
<div id="dropdown" />
132175
<div id="popover" />
176+
<div id="modal" />
133177
134178
<ModalsManager />
135179
<Notifications />

assets/icons.json

Lines changed: 5 additions & 1 deletion
Large diffs are not rendered by default.

assets/styles/base.scss

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ $grayscale: (
4646
--neutral-mint: #109373;
4747
--dark-mint: #1e473d;
4848
--legendary: #ff5a17;
49-
--epic: #7448E7;
50-
--rare: #007AFF;
49+
--epic: #7448e7;
50+
--rare: #007aff;
5151

5252
/* Grayscale */
5353
@each $gray, $value in $grayscale {
@@ -78,10 +78,9 @@ $grayscale: (
7878
--validator-active: #85f891;
7979
--validator-inactive: #1ca7ed;
8080
--validator-jailed: #f8774a;
81-
// --supply: #65c7f8;
8281
--supply: #1ca7ed;
8382
--staking: #85f891;
84-
--geo-map: #8B8C8D;
83+
--geo-map: #8b8c8d;
8584
}
8685

8786
[theme="dimmed"] {
@@ -105,7 +104,6 @@ $grayscale: (
105104
--txt-white: rgba(255, 255, 255, 95%);
106105

107106
/* General */
108-
// --brand: #18d2a5;
109107
--brand: #33a853;
110108
--blue: #0b84fe;
111109
--red: #eb5757;
@@ -120,8 +118,8 @@ $grayscale: (
120118
--neutral-mint: #109373;
121119
--dark-mint: #1e473d;
122120
--legendary: #ff5a17;
123-
--epic: #7448E7;
124-
--rare: #007AFF;
121+
--epic: #7448e7;
122+
--rare: #007aff;
125123

126124
/* Grayscale */
127125
@each $gray, $value in $grayscale {
@@ -146,7 +144,7 @@ $grayscale: (
146144
--block-progress-fill-background: #33a853;
147145
--logo-name: var(--txt-primary);
148146
--bar-fill: rgb(243, 147, 45);
149-
--geo-map: #8B8C8D;
147+
--geo-map: #8b8c8d;
150148
}
151149

152150
[theme="light"] {
@@ -170,7 +168,6 @@ $grayscale: (
170168
--txt-white: rgba(255, 255, 255, 95%);
171169

172170
/* General */
173-
// --brand: #18d2a5;
174171
--brand: #0ade71;
175172
--blue: #0b84fe;
176173
--red: #eb5757;
@@ -185,8 +182,8 @@ $grayscale: (
185182
--neutral-mint: #109373;
186183
--dark-mint: #c4f9eb;
187184
--legendary: #ff5a17;
188-
--epic: #7448E7;
189-
--rare: #007AFF;
185+
--epic: #7448e7;
186+
--rare: #007aff;
190187

191188
/* Grayscale */
192189
@each $gray, $value in $grayscale {
@@ -211,7 +208,7 @@ $grayscale: (
211208
--block-progress-fill-background: #33a853;
212209
--logo-name: var(--txt-primary);
213210
--bar-fill: rgb(243, 147, 45);
214-
--geo-map: #8B8C8D;
211+
--geo-map: #8b8c8d;
215212
}
216213

217214
@font-face {
@@ -273,7 +270,7 @@ body {
273270
-webkit-font-smoothing: antialiased;
274271
-moz-osx-font-smoothing: grayscale;
275272
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
276-
273+
277274
user-select: text;
278275
}
279276

components/ActionBar.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ import Search from "@/components/modules/navigation/Search.vue"
1111
import { isMobile } from "@/services/utils"
1212
1313
/** Store */
14-
import { useAppStore } from "@/store/app"
14+
import { useAppStore } from "@/store/app.store"
1515
const appStore = useAppStore()
1616
</script>
1717

1818
<template>
1919
<Flex wide align="center" justify="between" gap="24" :class="$style.wrapper">
2020
<Flex wide align="center" gap="12">
21-
<Button v-if="isMobile()" @click="appStore.showSidebar = !appStore.showSidebar" type="secondary" size="medium" :class="$style.menu_btn">
21+
<Button
22+
v-if="isMobile()"
23+
@click="appStore.showSidebar = !appStore.showSidebar"
24+
type="secondary"
25+
size="medium"
26+
:class="$style.menu_btn"
27+
>
2228
<Icon name="menu" size="16" color="primary" />
2329
</Button>
2430

components/AmountInCurrency.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { amountToString } from "@/services/utils"
66
import Tooltip from "@/components/ui/Tooltip.vue"
77
88
/** Store */
9-
import { useAppStore } from "@/store/app"
9+
import { useAppStore } from "@/store/app.store"
1010
const appStore = useAppStore()
1111
1212
const currentPrice = computed(() => appStore.currentPrice)
@@ -74,12 +74,12 @@ const calculatedAmount = computed(() => {
7474
...defaultCurrencyStyle,
7575
...props.styles.currency,
7676
},
77-
}
77+
},
7878
}
7979
8080
let tiaDisplay
8181
let tiaExchange
82-
if (finalAmount.amount.unit === 'utia') {
82+
if (finalAmount.amount.unit === "utia") {
8383
tiaExchange = finalAmount.amount.value / 1_000_000
8484
8585
if (finalAmount.amount.currency === "TIA") {

components/BadgeValue.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { space } from "@/services/utils"
66
77
/** Store */
8-
import { useNotificationsStore } from "@/store/notifications"
8+
import { useNotificationsStore } from "@/store/notifications.store"
99
const notificationsStore = useNotificationsStore()
1010
1111
const props = defineProps({

components/BookmarkButton.vue

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import Button from "@/components/ui/Button.vue"
44
55
/** Services */
6-
import { capitilize } from "~/services/utils"
6+
import { capitilize } from "@/services/utils"
77
88
/** Store */
9-
import { useBookmarksStore } from "@/store/bookmarks"
10-
import { useCacheStore } from "@/store/cache"
11-
import { useModalsStore } from "@/store/modals"
12-
import { useNotificationsStore } from "@/store/notifications"
9+
import { useBookmarksStore } from "@/store/bookmarks.store"
10+
import { useCacheStore } from "@/store/cache.store"
11+
import { useModalsStore } from "@/store/modals.store"
12+
import { useNotificationsStore } from "@/store/notifications.store"
1313
const bookmarksStore = useBookmarksStore()
1414
const cacheStore = useCacheStore()
1515
const modalsStore = useModalsStore()
@@ -39,7 +39,6 @@ const bookmarkText = computed(() => {
3939
4040
const handleBookmark = () => {
4141
if (!isBookmarked.value) {
42-
4342
let newBookmark = {
4443
id: props.id,
4544
type: capitilize(props.type),
@@ -70,7 +69,6 @@ const handleBookmark = () => {
7069
cacheStore.current.bookmark = newBookmark
7170
modalsStore.open("edit_alias")
7271
}
73-
7472
} else {
7573
let notification = {}
7674
@@ -101,7 +99,6 @@ const handleBookmark = () => {
10199
onMounted(() => {
102100
isBookmarked.value = bookmarksStore.getBookmark(props.type, props.id) ? true : false
103101
})
104-
105102
</script>
106103

107104
<template>

components/Connection.vue

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { Dropdown, DropdownTitle, DropdownItem, DropdownDivider } from "@/compon
55
66
/** Services */
77
import amp from "@/services/amp"
8-
import { disconnect } from "~/services/wallet"
8+
import { disconnect } from "@/services/wallet"
99
import { arabica, mainnet, mammoth, mocha } from "@/services/chains"
1010
1111
/** Store */
12-
import { useAppStore } from "@/store/app"
13-
import { useModalsStore } from "@/store/modals"
14-
import { useNotificationsStore } from "@/store/notifications"
12+
import { useAppStore } from "@/store/app.store"
13+
import { useModalsStore } from "@/store/modals.store"
14+
import { useNotificationsStore } from "@/store/notifications.store"
1515
const appStore = useAppStore()
1616
const modalsStore = useModalsStore()
1717
const notificationsStore = useNotificationsStore()
@@ -22,28 +22,22 @@ const { hostname } = useRequestURL()
2222
2323
switch (hostname) {
2424
case "celenium.io":
25-
// case "dev.celenium.io":
2625
appStore.network = mainnet
2726
break
2827
2928
case "mocha.celenium.io":
3029
case "mocha-4.celenium.io":
3130
appStore.network = mocha
3231
break
33-
32+
3433
case "mammoth.celenium.io":
3534
appStore.network = mammoth
3635
break
3736
38-
case "mammoth.celenium.io":
39-
appStore.network = mammoth
40-
break
41-
42-
// case "arabica.celenium.io":
4337
case "localhost":
4438
appStore.network = arabica
4539
break
46-
40+
4741
default:
4842
appStore.network = arabica
4943
break

0 commit comments

Comments
 (0)