From 424454764846425f62c7d727f88f79ab1c7c0423 Mon Sep 17 00:00:00 2001 From: Tiyo Date: Mon, 6 Nov 2023 16:52:24 +0800 Subject: [PATCH 1/6] del code --- packages/client/src/index.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/client/src/index.tsx b/packages/client/src/index.tsx index 1185300f..5029c9e2 100644 --- a/packages/client/src/index.tsx +++ b/packages/client/src/index.tsx @@ -18,13 +18,6 @@ setup().then(async (result) => { ); const { mount: mountDevTools } = await import("@latticexyz/dev-tools"); - const comp = []; - network.world.components.forEach((c) => { - if (comp.findIndex((item) => item.id === c.id) === -1) { - comp.push(c); - } - }); - network.world.components = comp; mountDevTools({ config: mudConfig, publicClient: network.publicClient, From f35ab936fc7459eff5ba955f50236825d9aac314 Mon Sep 17 00:00:00 2001 From: Tiyo Date: Tue, 7 Nov 2023 17:30:08 +0800 Subject: [PATCH 2/6] fix: fix battle bug --- .../client/src/components/Battle/index.tsx | 19 ++--- packages/client/src/index.tsx | 24 +++--- packages/client/src/mud/createSystemCalls.ts | 2 +- packages/client/src/pages/game/index.tsx | 74 +++++++++++++------ packages/client/src/pages/home/index.tsx | 5 +- packages/contracts/worlds.json | 2 +- 6 files changed, 79 insertions(+), 47 deletions(-) diff --git a/packages/client/src/components/Battle/index.tsx b/packages/client/src/components/Battle/index.tsx index f0ac9190..ce2a721d 100644 --- a/packages/client/src/components/Battle/index.tsx +++ b/packages/client/src/components/Battle/index.tsx @@ -19,7 +19,7 @@ import btnBg from "@/assets/img/battle/btn-bg.svg"; import Appearance from '@/components/Appearance'; import "./styles.scss"; import { useEntityQuery } from "@latticexyz/react"; -import { Has, getComponentValue, NotValue } from '@latticexyz/recs'; +import { Has, getComponentValue, NotValue, HasValue } from '@latticexyz/recs'; import { useMUD } from '@/mud/MUDContext'; import { decodeEntity } from "@latticexyz/store-sync/recs"; import { getRandomStr } from '@/utils/utils'; @@ -63,8 +63,9 @@ export default function Battle(props) { if (!timeout) { timeout = setTimeout(async () => { let resultBattle:any = await forceEnd(battle.id) + console.log(resultBattle) if (resultBattle.isEnd && resultBattle.winner) { - props.finishBattle(battle.winner, battle.attacker, battle.defender) + props.finishBattle(resultBattle.winner, resultBattle.attacker, resultBattle.defender) return } }, 23000) @@ -85,18 +86,18 @@ export default function Battle(props) { // } } - const battles = useEntityQuery([Has(BattleList), NotValue(BattleList, {isEnd: true})]).map((entity) => { + const battles = useEntityQuery([Has(BattleList), HasValue(BattleList, {isEnd: false})]).map((entity) => { let id = decodeEntity({ battleId: "uint256" }, entity); let battle:any = getComponentValue(BattleList, entity) battle.id = id.battleId.toString() return battle; }); - if (battles.length) { - let battleTemp:any = battles.filter((item:any) => (item.attacker.toLocaleLowerCase() == props?.curPlayer?.addr.toLocaleLowerCase() || item.defender.toLocaleLowerCase() == props?.curPlayer?.addr.toLocaleLowerCase()))[0] - if (battleTemp) { - battle = battleTemp - initBattle() - } + let battleTemp:any = battles?.filter((item:any) => (item.attacker.toLocaleLowerCase() == props?.curPlayer?.addr.toLocaleLowerCase() || item.defender.toLocaleLowerCase() == props?.curPlayer?.addr.toLocaleLowerCase()))[0] + if (battleTemp) { + battle = battleTemp + initBattle() + } else { + props.finishBattle() } useEffect(() => { diff --git a/packages/client/src/index.tsx b/packages/client/src/index.tsx index 5029c9e2..6cc50bdd 100644 --- a/packages/client/src/index.tsx +++ b/packages/client/src/index.tsx @@ -17,16 +17,16 @@ setup().then(async (result) => { ); - const { mount: mountDevTools } = await import("@latticexyz/dev-tools"); - mountDevTools({ - config: mudConfig, - publicClient: network.publicClient, - walletClient: network.walletClient, - latestBlock$: network.latestBlock$, - blockStorageOperations$: network.blockStorageOperations$, - worldAddress: network.worldContract.address, - worldAbi: network.worldContract.abi, - write$: network.write$, - recsWorld: network.world, - }); + // const { mount: mountDevTools } = await import("@latticexyz/dev-tools"); + // mountDevTools({ + // config: mudConfig, + // publicClient: network.publicClient, + // walletClient: network.walletClient, + // latestBlock$: network.latestBlock$, + // blockStorageOperations$: network.blockStorageOperations$, + // worldAddress: network.worldContract.address, + // worldAbi: network.worldContract.abi, + // write$: network.write$, + // recsWorld: network.world, + // }); }); diff --git a/packages/client/src/mud/createSystemCalls.ts b/packages/client/src/mud/createSystemCalls.ts index cf155d0f..852c0bb8 100644 --- a/packages/client/src/mud/createSystemCalls.ts +++ b/packages/client/src/mud/createSystemCalls.ts @@ -239,7 +239,7 @@ export function createSystemCalls( return getComponentValue(BattleList, encodeEntity({ battleId: "uint256" }, { battleId: battleId})) } catch (error) { console.log('forceEnd', error); - message.error(error.cause.reason || error.cause.details); + // message.error(error.cause.reason || error.cause.details); } } diff --git a/packages/client/src/pages/game/index.tsx b/packages/client/src/pages/game/index.tsx index e898b831..a22e9e8b 100644 --- a/packages/client/src/pages/game/index.tsx +++ b/packages/client/src/pages/game/index.tsx @@ -40,7 +40,7 @@ let lootContract: any const Game = () => { const navigate = useNavigate(); const { - components: { Player, PlayerAddon, BattleList, BoxList, GlobalConfig, LootList1, LootList2 }, + components: { Player, PlayerAddon, BattleList, BoxList, GlobalConfig, LootList1, LootList2, PlayerLocationLock }, systemCalls: { move, openBox, revealBox, getCollections, battleInvitation, unlockUserLocation }, network, } = useMUD(); @@ -76,7 +76,7 @@ const Game = () => { const GlobalConfigData = useEntityQuery([Has(GlobalConfig)]).map((entity) => getComponentValue(GlobalConfig, entity)); - console.log(GlobalConfigData, 'GlobalConfigData') + // console.log(GlobalConfigData, 'GlobalConfigData') if (GlobalConfigData.length && GlobalConfigData[0].userContract) { let privateKey = network.privateKey @@ -224,43 +224,59 @@ const Game = () => { const finishBattle = (winner: any, attacker: any, defender: any) => { setStartBattleData(false); - let loser = winner.toLocaleLowerCase() == attacker.toLocaleLowerCase() ? defender : attacker - let loserData = getComponentValue(Player, encodeEntity({ addr: "address" }, { addr: loser})) - if (winner.toLocaleLowerCase() == account.toLocaleLowerCase()) { - console.log('win'); - if (loserData?.state == 1) { - message.success('You win the battle'); + if (winner && attacker && defender) { + let loser = winner.toLocaleLowerCase() == attacker.toLocaleLowerCase() ? defender : attacker + let loserData = getComponentValue(Player, encodeEntity({ addr: "address" }, { addr: loser})) + if (winner.toLocaleLowerCase() == account.toLocaleLowerCase()) { + console.log('win'); + if (loserData?.state == 1 || loserData?.state == 0) { + message.success('You win the battle'); + } else { + // 对方跑了 + message.info('Target has escaped'); + setTimeout(() => { + unlockUserLocation(); + }, 5000); + } + setTargetPlayer(null); } else { - // 对方跑了 - message.info('Target has escaped'); - setTimeout(() => { - unlockUserLocation(); - }, 200); + console.log('lose'); + let cur = getComponentValue(Player, network.playerEntity); + if (cur?.state == 1 || cur?.state == 0) { + message.error('You lose the battle'); + navigate('/'); + return + } else { + // 逃跑成功 + message.info('You escaped the battle'); + } } - setTargetPlayer(null); } else { - console.log('lose'); let cur = getComponentValue(Player, network.playerEntity); - if (cur?.state == 1) { - message.error('You lose the battle'); + if (cur?.state == 1 || cur?.state == 0) { navigate('/'); return - } else { - // 逃跑成功 - message.info('You escaped the battle'); } } + } const movePlayer = async (paths, merkelData) => { if (curPlayer.waiting) { + message.error('You are waiting for tx'); return; } + let playerLock = getComponentValue(PlayerLocationLock, encodeEntity({ addr: "address" }, { addr: account})) + console.log(playerLock, 'playerLock') + if (playerLock && Number(playerLock.lockTime)) { + message.error('You are locked'); + return + } let txFinished = false; clearInterval(moveInterval.current); let pathIndex = 0; const timeInterval = ~~(1500 / Number(curPlayer.speed)) - moveInterval.current = setInterval(() => { + moveInterval.current = setInterval(async () => { setVertexCoordinate(triggerVertexUpdate(paths[pathIndex], curPlayer, mapDataRef.current, vertexCoordinate)); updatePlayerPosition(curPlayer, paths[pathIndex]); setRenderPlayers([...renderPlayers]); @@ -273,7 +289,21 @@ const Game = () => { const target = paths[pathIndex - 1]; const isDelivery = DELIVERY.x === target.x && DELIVERY.y === target.y; if (isDelivery) { - setUserInfoPlayer(curPlayer); + let player = curPlayer + let addon = getComponentValue(PlayerAddon, encodeEntity({addr: "address"}, {addr: player.addr})) + let userTokenId = addon.userId.toString() + let lootTokenId = addon.lootId.toString() + + let urls = await Promise.all([userContract.tokenURI(userTokenId), lootContract.tokenURI(lootTokenId)]) + let url = urls[0] + let lootUrl = urls[1] + + url = atobUrl(url) + lootUrl = atobUrl(lootUrl) + + player.userUrl = url.image + player.lootUrl = lootUrl.image + setUserInfoPlayer(player); submitGem(); } } diff --git a/packages/client/src/pages/home/index.tsx b/packages/client/src/pages/home/index.tsx index 91ff9109..c55cfbb5 100644 --- a/packages/client/src/pages/home/index.tsx +++ b/packages/client/src/pages/home/index.tsx @@ -56,7 +56,7 @@ const Home = () => { if (worldContractAddress && network.worldContract.address.toLocaleLowerCase() == worldContractAddress.toLocaleLowerCase()) { let playerInfo = localStorage.getItem('playerInfo'); if (playerInfo) playerInfo = JSON.parse(playerInfo); - if (playerInfo && playerInfo.username) { + if (playerInfo.state >= 1 && playerInfo && playerInfo.username) { setUsername(playerInfo.username); setClothes(playerInfo.clothes); setHandheld(playerInfo.handheld); @@ -207,9 +207,10 @@ const Home = () => { let urls = await Promise.all([userContract.tokenURI(userTokenId), lootContract.tokenURI(lootTokenId)]) let url = urls[0] let lootUrl = urls[1] - + console.log(urls, 'url') url = atobUrl(url) lootUrl = atobUrl(lootUrl) + setUserUrl(url.image) setLootUrl(lootUrl.image) let { playerData, lootData } = await selectBothNFT(userTokenId, lootTokenId, network.account) diff --git a/packages/contracts/worlds.json b/packages/contracts/worlds.json index 292d80c8..b475143d 100644 --- a/packages/contracts/worlds.json +++ b/packages/contracts/worlds.json @@ -4,7 +4,7 @@ "blockNumber": 29407241 }, "31337": { - "address": "0x46d4674578a2daBbD0CEAB0500c6c7867999db34" + "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" }, "421613": { "address": "0x2Bc1034975c3df48D6f3026802f372677844b85d", From 1b06bc1ce4b0f51d1641f5061f0bcf23c0eb9073 Mon Sep 17 00:00:00 2001 From: Tiyo Date: Tue, 7 Nov 2023 18:25:07 +0800 Subject: [PATCH 3/6] switched rpc --- packages/client/src/mud/supportedChains.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/client/src/mud/supportedChains.ts b/packages/client/src/mud/supportedChains.ts index c342164d..5bc0903d 100644 --- a/packages/client/src/mud/supportedChains.ts +++ b/packages/client/src/mud/supportedChains.ts @@ -12,12 +12,12 @@ const testnet = { nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" }, rpcUrls: { default: { - http: ["http://8.217.213.253"], - webSocket: ["http://8.217.213.253"], + http: ["https://rpc.0xmssp.xyz"], + webSocket: ["https://rpc.0xmssp.xyz"], }, public: { - http: ["http://8.217.213.253"], - webSocket: ["http://8.217.213.253"], + http: ["https://rpc.0xmssp.xyz"], + webSocket: ["https://rpc.0xmssp.xyz"], }, } } From 31f760e6ed98029c26af779bfa700c1623b32fcd Mon Sep 17 00:00:00 2001 From: Tiyo Date: Tue, 7 Nov 2023 19:07:30 +0800 Subject: [PATCH 4/6] add transfer && add submit gems --- .../client/src/components/UserInfo/index.tsx | 6 +-- .../src/components/UserInfoDialog/index.tsx | 2 + packages/client/src/index.tsx | 24 ++++++------ packages/client/src/mud/createSystemCalls.ts | 14 ++++++- packages/client/src/pages/game/index.tsx | 37 ++++++++++++------- packages/client/src/pages/home/index.tsx | 35 ++++++++++++++++-- 6 files changed, 85 insertions(+), 33 deletions(-) diff --git a/packages/client/src/components/UserInfo/index.tsx b/packages/client/src/components/UserInfo/index.tsx index ab354d55..cd653920 100644 --- a/packages/client/src/components/UserInfo/index.tsx +++ b/packages/client/src/components/UserInfo/index.tsx @@ -17,7 +17,6 @@ const UserInfo = (props: IUserInfo) => { const { handheld, head, clothes, gem = 0, userUrl, lootUrl, player } = props; const lootHasLoaded = (handheld && head && clothes) || (player?.equip?.handheld && player?.equip?.head && player?.equip?.clothes); - console.log(handheld, head, clothes, lootHasLoaded); return (
@@ -44,7 +43,7 @@ const UserInfo = (props: IUserInfo) => {
HP
-
{lootHasLoaded ? player?.maxHp : 0}{lootHasLoaded ? player?.maxHp?.toString() : ''}
+
{lootHasLoaded ? player?.maxHp.toString() : 0}{lootHasLoaded ? player?.maxHp?.toString() : ''}
Attack
@@ -71,10 +70,11 @@ const UserInfo = (props: IUserInfo) => {
diff --git a/packages/client/src/components/UserInfoDialog/index.tsx b/packages/client/src/components/UserInfoDialog/index.tsx index 0e7b265b..6b534553 100644 --- a/packages/client/src/components/UserInfoDialog/index.tsx +++ b/packages/client/src/components/UserInfoDialog/index.tsx @@ -11,6 +11,8 @@ const UserInfoDialog = (props: IProps) => { const { visible, onClose, ...rest } = props; + console.log(rest); + return (
diff --git a/packages/client/src/index.tsx b/packages/client/src/index.tsx index 5029c9e2..6cc50bdd 100644 --- a/packages/client/src/index.tsx +++ b/packages/client/src/index.tsx @@ -17,16 +17,16 @@ setup().then(async (result) => { ); - const { mount: mountDevTools } = await import("@latticexyz/dev-tools"); - mountDevTools({ - config: mudConfig, - publicClient: network.publicClient, - walletClient: network.walletClient, - latestBlock$: network.latestBlock$, - blockStorageOperations$: network.blockStorageOperations$, - worldAddress: network.worldContract.address, - worldAbi: network.worldContract.abi, - write$: network.write$, - recsWorld: network.world, - }); + // const { mount: mountDevTools } = await import("@latticexyz/dev-tools"); + // mountDevTools({ + // config: mudConfig, + // publicClient: network.publicClient, + // walletClient: network.walletClient, + // latestBlock$: network.latestBlock$, + // blockStorageOperations$: network.blockStorageOperations$, + // worldAddress: network.worldContract.address, + // worldAbi: network.worldContract.abi, + // write$: network.write$, + // recsWorld: network.world, + // }); }); diff --git a/packages/client/src/mud/createSystemCalls.ts b/packages/client/src/mud/createSystemCalls.ts index 852c0bb8..979180b1 100644 --- a/packages/client/src/mud/createSystemCalls.ts +++ b/packages/client/src/mud/createSystemCalls.ts @@ -256,6 +256,17 @@ export function createSystemCalls( } } + const submitGem = async () => { + try { + const tx = await worldContract.write.submitGem(); + await waitForTransaction(tx); + return tx + } catch (error) { + console.log('submitGem', error); + message.error(error.cause.reason || error.cause.details); + } + } + const getBattlePlayerHp = async (battleId: any, addr: any) => { const data = await worldContract.read.getBattlePlayerHp([battleId, addr]); return data @@ -280,6 +291,7 @@ export function createSystemCalls( initUserInfo, selectBothNFT, forceEnd, - unlockUserLocation + unlockUserLocation, + submitGem }; } diff --git a/packages/client/src/pages/game/index.tsx b/packages/client/src/pages/game/index.tsx index a22e9e8b..ae3aa1a4 100644 --- a/packages/client/src/pages/game/index.tsx +++ b/packages/client/src/pages/game/index.tsx @@ -40,8 +40,8 @@ let lootContract: any const Game = () => { const navigate = useNavigate(); const { - components: { Player, PlayerAddon, BattleList, BoxList, GlobalConfig, LootList1, LootList2, PlayerLocationLock }, - systemCalls: { move, openBox, revealBox, getCollections, battleInvitation, unlockUserLocation }, + components: { Player, PlayerAddon, BattleList, BoxList, GlobalConfig, LootList1, LootList2, PlayerLocationLock, PlayerSeason }, + systemCalls: { move, openBox, revealBox, getCollections, battleInvitation, unlockUserLocation, submitGem }, network, } = useMUD(); @@ -122,8 +122,14 @@ const Game = () => { } }) return player; - }).filter(e => e.state != 1); + }).filter(e => e.state > 1); + const PlayerSeasonData = useEntityQuery([Has(PlayerSeason)]).map((entity) => { + const playerSeason = getComponentValue(PlayerSeason, entity); + const address = decodeEntity({ addr: "address" }, entity)?.addr?.toLocaleLowerCase() || '' + playerSeason.addr = address + return playerSeason; + }) const [renderPlayers, setRenderPlayers] = useState([]); const playersCache = getPlayersCache(players); @@ -303,8 +309,9 @@ const Game = () => { player.userUrl = url.image player.lootUrl = lootUrl.image + player.seasonOreBalance = PlayerSeasonData.filter((item) => item.addr.toLocaleLowerCase() == player.addr.toLocaleLowerCase())[0]?.oreBalance setUserInfoPlayer(player); - submitGem(); + submitGemFun(); } } }, timeInterval); @@ -326,8 +333,7 @@ const Game = () => { const showUserInfo = async (player) => { if (player.addr.toLocaleLowerCase() == account.toLocaleLowerCase()) { - let cur = localStorage.getItem('playerInfo'); - if (cur) player = JSON.parse(cur); + if (curPlayer) player = curPlayer } else { let addon = getComponentValue(PlayerAddon, encodeEntity({addr: "address"}, {addr: player.addr})) console.log(addon) @@ -344,20 +350,22 @@ const Game = () => { player.userUrl = url.image player.lootUrl = lootUrl.image } + + player.seasonOreBalance = PlayerSeasonData.filter((item) => item.addr.toLocaleLowerCase() == player.addr.toLocaleLowerCase())[0]?.oreBalance setUserInfoPlayer(player); setUserInfoVisible(true); } - const submitGem = () => { + const submitGemFun = async () => { setUserInfoVisible(true); - - setTimeout(() => { - if (curPlayer.gem > 0) { + try { + if (curPlayer.oreBalance > 0) { + await submitGem(); setContent(
- Congrats,you submitted {curPlayer.gem} gems! + Congrats,you submitted {curPlayer.oreBalance} gems!
@@ -365,15 +373,18 @@ const Game = () => {
); open(); } - }, 1000); + } catch (error) { + console.log(error) + } } const setStartBattle = async (player) => { diff --git a/packages/client/src/pages/home/index.tsx b/packages/client/src/pages/home/index.tsx index c55cfbb5..dd8ea9e6 100644 --- a/packages/client/src/pages/home/index.tsx +++ b/packages/client/src/pages/home/index.tsx @@ -30,6 +30,8 @@ let pluginContract: any let userTokenIds: any let lootTokenIds: any +let transfering = false + const Home = () => { const [messageApi, contextHolder] = message.useMessage(); const { @@ -272,15 +274,40 @@ const Home = () => { } } + const transferFun = async (to) => { + if (transfering) return + transfering = true + let PRIVATE_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' + let rpc = network.walletClient?.chain?.rpcUrls?.default?.http[0] || 'http://127.0.0.1:8545' + let provider = new ethers.providers.JsonRpcProvider(rpc) + let wallet = new ethers.Wallet(PRIVATE_KEY, provider) + console.log(wallet, 'wallet') + wallet.sendTransaction({ + to, + value: ethers.utils.parseEther('1') + }).then(res => { + console.log(res, 'res') + transfering = false + getBalance() + }).catch(err => { + console.log(err) + }) + } + const getBalance = async () => { let balance = await network.publicClient.getBalance({ address: network.walletClient.account.address }) + if (balance.toString() == '0') { + transferFun(network.walletClient.account.address) + } else { + let walletBalance = (+ethers.utils.formatEther(balance.toString())).toFixed(2) + setWalletAddress(network.walletClient.account.address); + setWalletBalance(walletBalance); + localStorage.setItem('mi_user_address', network.walletClient.account.address) + } // 转成eth - let walletBalance = (+ethers.utils.formatEther(balance.toString())).toFixed(2) - setWalletAddress(network.walletClient.account.address); - setWalletBalance(walletBalance); - localStorage.setItem('mi_user_address', network.walletClient.account.address) + } const initUserInfoFun = async () => { From dd79c8387d7c60ade2948aafd2cab9cbc532210a Mon Sep 17 00:00:00 2001 From: Tiyo Date: Tue, 7 Nov 2023 19:14:38 +0800 Subject: [PATCH 5/6] fix: fix bug --- packages/client/src/mud/createSystemCalls.ts | 1 + packages/client/src/pages/game/index.tsx | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/client/src/mud/createSystemCalls.ts b/packages/client/src/mud/createSystemCalls.ts index 979180b1..157e0893 100644 --- a/packages/client/src/mud/createSystemCalls.ts +++ b/packages/client/src/mud/createSystemCalls.ts @@ -68,6 +68,7 @@ export function createSystemCalls( const tx = await worldContract.write.battleInvitation([addr, steps]); await waitForTransaction(tx); console.log('battleInvitation success', new Date().getTime(), tx); + return tx } catch (error) { console.log('battleInvitation', error); message.error(error.cause.reason || error.cause.details); diff --git a/packages/client/src/pages/game/index.tsx b/packages/client/src/pages/game/index.tsx index ae3aa1a4..b321510a 100644 --- a/packages/client/src/pages/game/index.tsx +++ b/packages/client/src/pages/game/index.tsx @@ -389,10 +389,12 @@ const Game = () => { const setStartBattle = async (player) => { const paths = bfs(simpleMapData, { x: curPlayer.x, y: curPlayer.y }, {x: player.x, y: player.y}).slice(1); - await battleInvitation(player.addr, formatMovePath(paths)); - setTargetPlayer(player); - setBattleCurPlayer(curPlayer) - setStartBattleData(true); + let res = await battleInvitation(player.addr, formatMovePath(paths)); + if (res) { + setTargetPlayer(player); + setBattleCurPlayer(curPlayer) + setStartBattleData(true); + } } const openTreasureChest = async (id) => { From 38a1bb3222ce9fb5555f919eb0eea1e8c96f989b Mon Sep 17 00:00:00 2001 From: Tiyo Date: Tue, 7 Nov 2023 19:35:39 +0800 Subject: [PATCH 6/6] fix: fix bug --- .../src/components/UserAddress/index.tsx | 3 --- .../src/components/UserAddress/styles.scss | 1 + .../client/src/components/UserInfo/index.tsx | 4 ++-- .../src/components/UserInfoDialog/index.tsx | 2 -- packages/client/src/index.tsx | 24 +++++++++---------- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/client/src/components/UserAddress/index.tsx b/packages/client/src/components/UserAddress/index.tsx index 68c68c2a..766ed2a4 100644 --- a/packages/client/src/components/UserAddress/index.tsx +++ b/packages/client/src/components/UserAddress/index.tsx @@ -24,9 +24,6 @@ const UserAddress = (props: IProps) => {
{addressTxt}
- - -
); }; diff --git a/packages/client/src/components/UserAddress/styles.scss b/packages/client/src/components/UserAddress/styles.scss index 25770d8d..b25070c2 100644 --- a/packages/client/src/components/UserAddress/styles.scss +++ b/packages/client/src/components/UserAddress/styles.scss @@ -28,6 +28,7 @@ .user-address { padding: 0 20px; + cursor: pointer; } .copy-icon { diff --git a/packages/client/src/components/UserInfo/index.tsx b/packages/client/src/components/UserInfo/index.tsx index cd653920..cb725d0e 100644 --- a/packages/client/src/components/UserInfo/index.tsx +++ b/packages/client/src/components/UserInfo/index.tsx @@ -70,11 +70,11 @@ const UserInfo = (props: IUserInfo) => {
diff --git a/packages/client/src/components/UserInfoDialog/index.tsx b/packages/client/src/components/UserInfoDialog/index.tsx index 6b534553..0e7b265b 100644 --- a/packages/client/src/components/UserInfoDialog/index.tsx +++ b/packages/client/src/components/UserInfoDialog/index.tsx @@ -11,8 +11,6 @@ const UserInfoDialog = (props: IProps) => { const { visible, onClose, ...rest } = props; - console.log(rest); - return (
diff --git a/packages/client/src/index.tsx b/packages/client/src/index.tsx index 6cc50bdd..5029c9e2 100644 --- a/packages/client/src/index.tsx +++ b/packages/client/src/index.tsx @@ -17,16 +17,16 @@ setup().then(async (result) => { ); - // const { mount: mountDevTools } = await import("@latticexyz/dev-tools"); - // mountDevTools({ - // config: mudConfig, - // publicClient: network.publicClient, - // walletClient: network.walletClient, - // latestBlock$: network.latestBlock$, - // blockStorageOperations$: network.blockStorageOperations$, - // worldAddress: network.worldContract.address, - // worldAbi: network.worldContract.abi, - // write$: network.write$, - // recsWorld: network.world, - // }); + const { mount: mountDevTools } = await import("@latticexyz/dev-tools"); + mountDevTools({ + config: mudConfig, + publicClient: network.publicClient, + walletClient: network.walletClient, + latestBlock$: network.latestBlock$, + blockStorageOperations$: network.blockStorageOperations$, + worldAddress: network.worldContract.address, + worldAbi: network.worldContract.abi, + write$: network.write$, + recsWorld: network.world, + }); });