Skip to content

Commit 4cadb0e

Browse files
authored
Merge pull request #170 from Tech-Expansion/update/link-mainnet-lite
update link mainnet lite on network toggle
2 parents e4461f5 + 88af812 commit 4cadb0e

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev -p 8080",
6+
"dev": "next dev -p 8081",
77
"build": "next build",
88
"start": "next start",
99
"lint": "next lint"

src/components/network-toggle.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ import { NetworkType, NETWORKS } from "@/lib/constants/common.constants"
1414
// Helper function to detect network from domain
1515
function getNetworkFromDomain(): NetworkType {
1616
if (typeof window === "undefined") return NetworkType.PREPROD
17-
17+
1818
const hostname = window.location.hostname
19-
19+
2020
// Check each network's domains array
2121
for (const [networkType, config] of Object.entries(NETWORKS)) {
2222
if (config.domains.some(domain => hostname.includes(domain))) {
2323
return networkType as NetworkType
2424
}
2525
}
26-
26+
2727
// Default for localhost and other unknown domains
2828
// - localhost:8080 -> PREPROD
2929
// - midnightexplorer.com -> PREPROD (configured in domains)
@@ -32,7 +32,7 @@ function getNetworkFromDomain(): NetworkType {
3232

3333
export function NetworkToggle() {
3434
const [network, setNetwork] = useState<NetworkType>(NetworkType.PREPROD)
35-
35+
3636
// Detect network on mount based on domain
3737
useEffect(() => {
3838
setNetwork(getNetworkFromDomain())
@@ -59,7 +59,7 @@ export function NetworkToggle() {
5959
</DropdownMenuTrigger>
6060

6161
{/* Menu xổ xuống */}
62-
<DropdownMenuContent align="end" className="w-[210px]">
62+
<DropdownMenuContent align="end" className="w-[240px]">
6363
{networks.map((networkType) => {
6464
const config = NETWORKS[networkType]
6565
const isCurrentNetwork = network === networkType

src/lib/constants/common.constants.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ export const NETWORKS = {
5151
iconColor: "text-purple-400",
5252
enabled: true,
5353
message: undefined,
54-
},
54+
},
5555
[NetworkType.MAINNET]: {
56-
label: "Mainnet",
57-
domain: "midnightexplorer.com",
56+
label: "Mainnet Lite",
57+
domain: "mainnet-lite.midnightexplorer.com",
5858
domains: [
59-
// "midnightexplorer.com",
60-
"mainnet.dev.midnightexplorer.com",
61-
"mainnet.test.midnightexplorer.com",
59+
"mainnet-lite.midnightexplorer.com",
60+
"mainnet-lite.dev.midnightexplorer.com",
61+
"mainnet-lite.test.midnightexplorer.com",
6262
],
6363
color: "text-green-400",
6464
iconColor: "text-green-400",
65-
enabled: false,
66-
message: "Upcoming",
65+
enabled: true,
66+
message: undefined,
6767
},
6868
} as const;
6969

0 commit comments

Comments
 (0)