Skip to content

Commit 7974c24

Browse files
committed
rm module device
1 parent 9ceaff1 commit 7974c24

5 files changed

Lines changed: 451 additions & 2743 deletions

File tree

components/modals/LightNodeModal.vue

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import Tooltip from "@/components/ui/Tooltip.vue"
1212
import Spinner from "@/components/ui/Spinner.vue"
1313
1414
/** Constants */
15-
import { StatusMap, StatusLabelMap, NodeSpeedMap, NodeSpeedLabelMap } from "@/services/constants/node.js"
15+
import { StatusMap, StatusLabelMap, NodeSpeedMap } from "@/services/constants/node.js"
1616
1717
/** Services */
1818
import amp from "@/services/amp"
19-
import { comma } from "@/services/utils"
19+
import { comma, isMobile } from "@/services/utils"
2020
2121
/** Stores */
2222
import { useAppStore } from "@/store/app.js"
@@ -31,8 +31,6 @@ const notificationsStore = useNotificationsStore()
3131
const showMobileWarning = useCookie("showMobileWarning", { default: () => true })
3232
const showOnboardingBanner = useCookie("showOnboardingBanner", { default: () => true })
3333
34-
const { isMobile } = useDevice()
35-
3634
const emit = defineEmits(["onClose"])
3735
const props = defineProps({
3836
show: Boolean,
@@ -51,7 +49,7 @@ onMounted(async () => {
5149
const delayedStart = setTimeout(() => {
5250
handleStart()
5351
54-
amp.log("sampling:autostartTrigger", { network: networks[selectedNetwork.value], mobile: isMobile })
52+
amp.log("sampling:autostartTrigger", { network: networks[selectedNetwork.value], mobile: isMobile() })
5553
5654
setTimeout(() => {
5755
notificationsStore.create({
@@ -89,7 +87,7 @@ onMounted(async () => {
8987
callback: () => {
9088
clearTimeout(delayedStart)
9189
92-
amp.log("sampling:cancelAutostart", { network: networks[selectedNetwork.value], mobile: isMobile })
90+
amp.log("sampling:cancelAutostart", { network: networks[selectedNetwork.value], mobile: isMobile() })
9391
},
9492
},
9593
{
@@ -101,7 +99,7 @@ onMounted(async () => {
10199
102100
amp.log("sampling:disableAutostartFromNotification", {
103101
network: networks[selectedNetwork.value],
104-
mobile: isMobile,
102+
mobile: isMobile(),
105103
})
106104
},
107105
},
@@ -338,7 +336,7 @@ const handleStop = () => {
338336
}
339337
const handleStart = async () => {
340338
nodeStore.status = StatusMap.Starting
341-
amp.log("sampling:start", { network: networks[selectedNetwork.value], mobile: isMobile })
339+
amp.log("sampling:start", { network: networks[selectedNetwork.value], mobile: isMobile() })
342340
343341
try {
344342
const logVisual = (event) => {
@@ -428,14 +426,14 @@ const handleStart = async () => {
428426
}, 1_000)
429427
430428
nodeStore.status = StatusMap.Started
431-
amp.log("sampling:started", { network: networks[selectedNetwork.value], mobile: isMobile })
429+
amp.log("sampling:started", { network: networks[selectedNetwork.value], mobile: isMobile() })
432430
433431
showDetails.value = true
434432
435433
pid.value = await node.value.local_peer_id()
436434
} catch (error) {
437435
nodeStore.status = StatusMap.Failed
438-
amp.log("sampling:failed", { network: networks[selectedNetwork.value], mobile: isMobile })
436+
amp.log("sampling:failed", { network: networks[selectedNetwork.value], mobile: isMobile() })
439437
440438
console.error("Error initializing Node:", error)
441439
console.dir(error)
@@ -446,7 +444,7 @@ watch(
446444
() => props.show,
447445
() => {
448446
if (props.show) {
449-
amp.log("sampling:open", { network: networks[selectedNetwork.value], mobile: isMobile })
447+
amp.log("sampling:open", { network: networks[selectedNetwork.value], mobile: isMobile() })
450448
}
451449
},
452450
)
@@ -583,7 +581,7 @@ watch(
583581
</Flex>
584582
</Flex>
585583

586-
<Flex v-if="isMobile && showMobileWarning" wide gap="8" :class="$style.warning">
584+
<Flex v-if="isMobile() && showMobileWarning" wide gap="8" :class="$style.warning">
587585
<Icon name="info" size="16" color="yellow" />
588586

589587
<Flex direction="column" gap="16">

nuxt.config.ts

Lines changed: 131 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -2,145 +2,145 @@ import { nodePolyfills } from "vite-plugin-node-polyfills"
22
import path from "path"
33

44
export default defineNuxtConfig({
5-
modules: ["nuxt-simple-sitemap", "@pinia/nuxt", "nuxt-og-image", "@nuxtjs/device"],
5+
modules: ["nuxt-simple-sitemap", "@pinia/nuxt", "nuxt-og-image"],
66

7-
site: {
8-
url: "https://celenium.io",
9-
},
7+
site: {
8+
url: "https://celenium.io",
9+
},
1010

11-
sitemap: {
12-
xsl: false,
13-
},
11+
sitemap: {
12+
xsl: false,
13+
},
1414

15-
routeRules: {
16-
"/node": {
17-
ssr: false,
18-
},
19-
"/": {
20-
sitemap: {
21-
changefreq: "daily",
22-
priority: 1,
23-
},
24-
},
25-
"/blocks": {
26-
sitemap: {
27-
changefreq: "daily",
28-
priority: 0.9,
29-
},
30-
},
31-
"/namespaces": {
32-
sitemap: {
33-
changefreq: "daily",
34-
priority: 0.8,
35-
},
36-
},
37-
"/txs": {
38-
sitemap: {
39-
changefreq: "daily",
40-
priority: 0.7,
41-
},
42-
},
43-
"/addresses": {
44-
sitemap: {
45-
changefreq: "daily",
46-
priority: 0.6,
47-
},
48-
},
49-
"/gas": {
50-
sitemap: {
51-
changefreq: "daily",
52-
priority: 0.5,
53-
},
54-
},
55-
"/namespaces/treemap": {
56-
sitemap: {
57-
changefreq: "weekly",
58-
priority: 0.4,
59-
},
60-
},
61-
},
15+
routeRules: {
16+
"/node": {
17+
ssr: false,
18+
},
19+
"/": {
20+
sitemap: {
21+
changefreq: "daily",
22+
priority: 1,
23+
},
24+
},
25+
"/blocks": {
26+
sitemap: {
27+
changefreq: "daily",
28+
priority: 0.9,
29+
},
30+
},
31+
"/namespaces": {
32+
sitemap: {
33+
changefreq: "daily",
34+
priority: 0.8,
35+
},
36+
},
37+
"/txs": {
38+
sitemap: {
39+
changefreq: "daily",
40+
priority: 0.7,
41+
},
42+
},
43+
"/addresses": {
44+
sitemap: {
45+
changefreq: "daily",
46+
priority: 0.6,
47+
},
48+
},
49+
"/gas": {
50+
sitemap: {
51+
changefreq: "daily",
52+
priority: 0.5,
53+
},
54+
},
55+
"/namespaces/treemap": {
56+
sitemap: {
57+
changefreq: "weekly",
58+
priority: 0.4,
59+
},
60+
},
61+
},
6262

63-
runtimeConfig: {
64-
public: {
65-
AMP: process.env.AMP,
66-
},
67-
},
63+
runtimeConfig: {
64+
public: {
65+
AMP: process.env.AMP,
66+
},
67+
},
6868

69-
app: {
70-
head: {
71-
htmlAttrs: {
72-
lang: "en",
73-
},
74-
meta: [
75-
{ name: "viewport", content: "width=device-width, initial-scale=1, maximum-scale=1" },
76-
{
77-
name: "lang",
78-
content: "en",
79-
},
80-
],
81-
link: [
82-
{
83-
id: "favicon",
84-
rel: "icon",
85-
type: "image/png",
86-
},
87-
{
88-
rel: "preconnect",
89-
href: "https://fonts.googleapis.com",
90-
},
91-
{
92-
rel: "preconnect",
93-
href: "https://fonts.gstatic.com",
94-
crossorigin: "anonymous",
95-
},
96-
{
97-
rel: "preload",
98-
as: "style",
99-
href: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",
100-
onload: "this.onload=null;this.rel='stylesheet'",
101-
},
102-
{
103-
rel: "preload",
104-
as: "style",
105-
href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@700&display=swap",
106-
onload: "this.onload=null;this.rel='stylesheet'",
107-
},
108-
{
109-
rel: "preload",
110-
as: "style",
111-
href: "https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap",
112-
onload: "this.onload=null;this.rel='stylesheet'",
113-
},
114-
],
115-
},
69+
app: {
70+
head: {
71+
htmlAttrs: {
72+
lang: "en",
73+
},
74+
meta: [
75+
{ name: "viewport", content: "width=device-width, initial-scale=1, maximum-scale=1" },
76+
{
77+
name: "lang",
78+
content: "en",
79+
},
80+
],
81+
link: [
82+
{
83+
id: "favicon",
84+
rel: "icon",
85+
type: "image/png",
86+
},
87+
{
88+
rel: "preconnect",
89+
href: "https://fonts.googleapis.com",
90+
},
91+
{
92+
rel: "preconnect",
93+
href: "https://fonts.gstatic.com",
94+
crossorigin: "anonymous",
11695
},
96+
{
97+
rel: "preload",
98+
as: "style",
99+
href: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",
100+
onload: "this.onload=null;this.rel='stylesheet'",
101+
},
102+
{
103+
rel: "preload",
104+
as: "style",
105+
href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@700&display=swap",
106+
onload: "this.onload=null;this.rel='stylesheet'",
107+
},
108+
{
109+
rel: "preload",
110+
as: "style",
111+
href: "https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap",
112+
onload: "this.onload=null;this.rel='stylesheet'",
113+
},
114+
],
115+
},
116+
},
117117

118-
css: ["@/assets/styles/base.scss", "@/assets/styles/flex.scss", "@/assets/styles/text.scss"],
118+
css: ["@/assets/styles/base.scss", "@/assets/styles/flex.scss", "@/assets/styles/text.scss"],
119119

120-
pinia: {
121-
autoImports: ["defineStore"],
122-
},
120+
pinia: {
121+
autoImports: ["defineStore"],
122+
},
123123

124-
ogImage: {
125-
fonts: ["Inter:400", "Inter:600", "IBM+Plex+Mono:400"],
126-
},
124+
ogImage: {
125+
fonts: ["Inter:400", "Inter:600", "IBM+Plex+Mono:400"],
126+
},
127127

128-
devtools: {
129-
enabled: false,
130-
},
128+
devtools: {
129+
enabled: false,
130+
},
131131

132-
vite: {
133-
worker: {
134-
format: "es",
135-
},
136-
define: {
137-
global: "globalThis",
138-
},
139-
resolve: {
140-
alias: {
141-
"unenv/runtime/node/buffer/index/": path.resolve(__dirname, "./node_modules/buffer/index"),
142-
},
143-
},
144-
plugins: [nodePolyfills()],
145-
},
146-
})
132+
vite: {
133+
worker: {
134+
format: "es",
135+
},
136+
define: {
137+
global: "globalThis",
138+
},
139+
resolve: {
140+
alias: {
141+
"unenv/runtime/node/buffer/index/": path.resolve(__dirname, "./node_modules/buffer/index"),
142+
},
143+
},
144+
plugins: [nodePolyfills()],
145+
},
146+
})

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
},
1414
"devDependencies": {
1515
"@nuxt/devtools": "latest",
16-
"@nuxtjs/device": "^3.2.2",
1716
"cross-env": "^7.0.3",
1817
"nuxt": "3.12.4",
1918
"nuxt-og-image": "3.0.0-rc.52",

0 commit comments

Comments
 (0)