Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d7ba5f
commit 22320bb
Showing
10 changed files
with
43 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
import { useEffect, useState } from 'react' | ||
import { useMemo } from 'react' | ||
import { useLocation } from 'react-router-dom' | ||
import { getPostPayload } from '../helpers/getPostPayload.js' | ||
|
||
// Custom hook to execute getPostPayload when location changes | ||
export function usePostPayload() { | ||
const location = useLocation() | ||
const [payload, setPayload] = useState(getPostPayload) | ||
|
||
useEffect(() => { | ||
setPayload(getPostPayload()) | ||
}, [location]) | ||
|
||
// Return the getPostPayload function itself (if needed) | ||
return payload | ||
return useMemo(getPostPayload, [location]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { NetworkPluginID } from '@masknet/shared-base' | ||
import { ChainId } from '@masknet/web3-shared-evm' | ||
|
||
export const TRADER_WEB3_CONFIG = { | ||
[NetworkPluginID.PLUGIN_EVM]: { | ||
supportedChainIds: [ | ||
ChainId.Mainnet, | ||
ChainId.BSC, | ||
ChainId.Matic, | ||
ChainId.Arbitrum, | ||
ChainId.xDai, | ||
ChainId.Aurora, | ||
ChainId.Avalanche, | ||
ChainId.Fantom, | ||
ChainId.Astar, | ||
ChainId.Optimism, | ||
], | ||
}, | ||
[NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] }, | ||
[NetworkPluginID.PLUGIN_SOLANA]: { supportedChainIds: [] }, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters