Skip to content

Commit 10b6071

Browse files
committed
update: move string lable -> contract file , chain name undefine fix
1 parent fcfd8ae commit 10b6071

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

components/ui/ConnectBtn.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"use client";
2+
3+
import { CONNECT_BTN_LABEL } from "@/lib/constants";
14
import { ConnectButton } from "@rainbow-me/rainbowkit";
25
import { motion } from "framer-motion";
36
import Image from "next/image";
@@ -25,7 +28,7 @@ function ConnectBtn() {
2528
whileTap={{ scale: 0.98 }}
2629
className="rounded-xl bg-emerald-500 px-4 py-2 font-bold text-white shadow-md transition-shadow duration-200 hover:shadow-emerald-300/40 dark:bg-emerald-400 dark:text-black dark:hover:shadow-emerald-400/30"
2730
>
28-
Connect Wallet
31+
{CONNECT_BTN_LABEL.connectWallet}
2932
</motion.button>
3033
);
3134
}
@@ -38,7 +41,7 @@ function ConnectBtn() {
3841
whileTap={{ scale: 0.98 }}
3942
className="rounded-xl bg-red-500 px-4 py-2 font-bold text-white shadow-md transition-shadow duration-200 hover:shadow-red-300/40 dark:bg-red-500 dark:text-white"
4043
>
41-
Wrong Network
44+
{CONNECT_BTN_LABEL.wrongNetwork}
4245
</motion.button>
4346
);
4447
}
@@ -54,7 +57,7 @@ function ConnectBtn() {
5457
{chain.hasIcon && chain.iconUrl && (
5558
<Image
5659
src={chain.iconUrl}
57-
alt={chain.name!}
60+
alt={chain.name ?? "Unknown chain"}
5861
width={24}
5962
height={24}
6063
unoptimized
@@ -74,7 +77,7 @@ function ConnectBtn() {
7477
{chain.hasIcon && chain.iconUrl ? (
7578
<Image
7679
src={chain.iconUrl}
77-
alt={chain.name!}
80+
alt={chain.name ?? "Unknown chain"}
7881
width={20}
7982
height={20}
8083
unoptimized

lib/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ export const NAV_LINKS = [
44
// Add navigation links here if needed in the future
55
];
66

7+
export const CONNECT_BTN_LABEL = {
8+
connectWallet: "Connect Wallet",
9+
wrongNetwork: "Wrong Network",
10+
};
11+
712
export const FEATURES_DATA = [
813
{
914
image: "/cards/FeatureCard1.png",

0 commit comments

Comments
 (0)