Skip to content

Commit 2df19e8

Browse files
committed
fix: detail
1 parent a710b4c commit 2df19e8

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

netlify.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ REACT_APP_ETHEREUM_YEAR_BADGE_API_URI = "https://genesis-nft-backend-git-sepolia
178178
REACT_APP_BADGE_REGISTRY_URL="https://badge-registry.canvas.scroll.cat/badge-registry"
179179
REACT_APP_BADGE_INDEXER_URL="https://canvas-indexer.scroll.cat"
180180
REACT_APP_ETHEREUM_YEAR_BADGE_ADDRESS = "0xB59B6466B21a089c93B14030AF88b164905a58fd"
181-
REACT_APP_SCR_HOLDING_BADGE_ADDRESS="0xef071708e09becfeac1e3d8afa1602bb6eb57922"
181+
REACT_APP_SCR_HOLDING_BADGE_ADDRESS="0xeF071708e09BECFEac1e3d8AfA1602BB6eB57922"
182182

183183

184184
[context.sepolia.environment]
@@ -237,7 +237,7 @@ REACT_APP_ETHEREUM_YEAR_BADGE_API_URI = "https://genesis-nft-backend-git-sepolia
237237
REACT_APP_BADGE_REGISTRY_URL="https://badge-registry.canvas.scroll.cat/badge-registry"
238238
REACT_APP_BADGE_INDEXER_URL="https://canvas-indexer.scroll.cat"
239239
REACT_APP_ETHEREUM_YEAR_BADGE_ADDRESS = "0xB59B6466B21a089c93B14030AF88b164905a58fd"
240-
REACT_APP_SCR_HOLDING_BADGE_ADDRESS="0xef071708e09becfeac1e3d8afa1602bb6eb57922"
240+
REACT_APP_SCR_HOLDING_BADGE_ADDRESS="0xeF071708e09BECFEac1e3d8AfA1602BB6eB57922"
241241

242242

243243
[context.mainnet.environment]

src/hooks/useValidateENSSubdomain.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const useValidateENSSubdomain = value => {
1717
const controller = useRef<any>()
1818

1919
useEffect(() => {
20-
if (preValue) {
20+
if (preValue !== undefined) {
2121
handleValidateName(value)
2222
}
2323
}, [value])

src/pages/canvas/Dashboard/ENSSubdomainDialog/ClaimENS.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useMemo } from "react"
2-
import Img from "react-cool-img"
32

43
import { Box, Stack, SvgIcon, Typography } from "@mui/material"
54

@@ -11,6 +10,7 @@ import useCanvasProfileStore, { ENSSubdomainDialogTypeEnum } from "@/stores/canv
1110
import usePerkStore from "@/stores/perksStore"
1211
import { truncateAddress } from "@/utils"
1312

13+
import BadgeImage from "../../components/BadgeImage"
1414
import PerksButton from "../../components/PerksButton"
1515

1616
const ClaimENS = () => {
@@ -114,7 +114,8 @@ const ClaimENS = () => {
114114
</Typography>
115115
<Stack direction="row" gap={["1.6rem", "2.4rem"]} justifyContent="center">
116116
{perk.imageURL.map((imageURL, index) => (
117-
<Img
117+
<BadgeImage
118+
key={imageURL}
118119
src={imageURL}
119120
alt=""
120121
style={{ width: isMobile ? "5.6rem" : "10rem", height: isMobile ? "5.6rem" : "10rem" }}

src/pages/canvas/Dashboard/PerksDialog/PerkItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ const PerkItem = props => {
5454
<Stack direction="row" gap="1.6rem" justifyContent="center">
5555
{imageURL.map((url, index) => (
5656
<BadgeImage
57+
key={url}
5758
src={url}
5859
alt={`required-badge-${index}`}
5960
placeholder={BadgePlaceholderSvg}
60-
width={isMobile ? "48px" : "64px"}
61-
height={isMobile ? "48px" : "64px"}
61+
style={{ width: isMobile ? "4.8rem" : "6.4rem", height: isMobile ? "4.8rem" : "6.4rem" }}
6262
/>
6363
))}
6464
</Stack>

src/pages/canvas/mint-scr/index.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const MintScr = () => {
1818
const alertWarning = useSnackbar()
1919
const [scrAmount, setSCRAmount] = useState("")
2020
const [mintLoading, setMintLoading] = useState(false)
21-
const [burnLoading, setBurnLoading] = useState(false)
21+
// const [burnLoading, setBurnLoading] = useState(false)
2222

2323
const handleChangeSCRAmount = e => {
2424
setSCRAmount(sanitizeNumericalString(e.target.value))
@@ -49,30 +49,30 @@ const MintScr = () => {
4949
}
5050
}
5151

52-
const handleBurnToken = async () => {
53-
if (chainId !== CHAIN_ID.L2) {
54-
alertWarning("please switch to L2")
55-
return
56-
}
57-
try {
58-
setBurnLoading(true)
59-
const signer = await provider?.getSigner(0)
60-
const tokenInterface = new ethers.Contract(SCR_TOKEN_ADDRESS, ERC20ABI, signer)
61-
const amount = amountToBN(scrAmount)
62-
const tx = await tokenInterface.burn(walletCurrentAddress, amount)
63-
const txReceipt = await tx.wait()
64-
if (txReceipt?.status === 1) {
65-
alertWarning(`Burned ${scrAmount} SCR successfully`, "success")
66-
setSCRAmount("")
67-
}
68-
} catch (e) {
69-
if (!isUserRejected(e)) {
70-
alertWarning(e.message)
71-
}
72-
} finally {
73-
setBurnLoading(false)
74-
}
75-
}
52+
// const handleBurnToken = async () => {
53+
// if (chainId !== CHAIN_ID.L2) {
54+
// alertWarning("please switch to L2")
55+
// return
56+
// }
57+
// try {
58+
// setBurnLoading(true)
59+
// const signer = await provider?.getSigner(0)
60+
// const tokenInterface = new ethers.Contract(SCR_TOKEN_ADDRESS, ERC20ABI, signer)
61+
// const amount = amountToBN(scrAmount)
62+
// const tx = await tokenInterface.burn(walletCurrentAddress, amount)
63+
// const txReceipt = await tx.wait()
64+
// if (txReceipt?.status === 1) {
65+
// alertWarning(`Burned ${scrAmount} SCR successfully`, "success")
66+
// setSCRAmount("")
67+
// }
68+
// } catch (e) {
69+
// if (!isUserRejected(e)) {
70+
// alertWarning(e.message)
71+
// }
72+
// } finally {
73+
// setBurnLoading(false)
74+
// }
75+
// }
7676
return (
7777
<Stack direction="column" justifyContent="center" alignItems="center" sx={{ width: "100%", height: `calc(100vh - ${NORMAL_HEADER_HEIGHT})` }}>
7878
<TextField
@@ -85,12 +85,12 @@ const MintScr = () => {
8585
onChange={handleChangeSCRAmount}
8686
/>
8787
<Stack sx={{ width: "25rem", mt: "2rem" }} gap="2rem">
88-
<PerksButton loading={mintLoading} onClick={handleMintToken}>
88+
<PerksButton loading={mintLoading} disabled={!scrAmount} onClick={handleMintToken}>
8989
Mint
9090
</PerksButton>
91-
<PerksButton loading={burnLoading} onClick={handleBurnToken}>
91+
{/* <PerksButton loading={burnLoading} onClick={handleBurnToken}>
9292
Burn
93-
</PerksButton>
93+
</PerksButton> */}
9494
</Stack>
9595
</Stack>
9696
)

src/stores/perksStore.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const usePerkStore = create<EnsSubdomainStore>()(set => ({
2727
generatePerks: async props => {
2828
const { walletCurrentAddress, userBadges, ensClaimed } = props
2929

30-
// console.log(userBadges, "userBadges")
3130
const perkList = [
3231
{
3332
id: "claim-ens-subdomain",

0 commit comments

Comments
 (0)