diff --git a/src/modules/creator/token/etherlink/steps/Ownership.tsx b/src/modules/creator/token/etherlink/steps/Ownership.tsx index 53d46855..dad7275c 100644 --- a/src/modules/creator/token/etherlink/steps/Ownership.tsx +++ b/src/modules/creator/token/etherlink/steps/Ownership.tsx @@ -66,12 +66,8 @@ export const Ownership: React.FC = () => { { - if (etherlink.isConnected) { - window.open(`https://www.cookbook.dev/contracts/simple-token`) - } else { - const href = `/creator/deployment` - history.push(href) - } + const href = `/creator/deployment` + history.push(href) }} > diff --git a/src/modules/creator/token/etherlink/steps/Summary.tsx b/src/modules/creator/token/etherlink/steps/Summary.tsx index 1de8ef31..af11d708 100644 --- a/src/modules/creator/token/etherlink/steps/Summary.tsx +++ b/src/modules/creator/token/etherlink/steps/Summary.tsx @@ -21,12 +21,14 @@ import { ThirdContainerRow, ThirdContainerLastRow } from "../../ui" +import { useTezos } from "services/beacon/hooks/useTezos" export const ContractSummary: React.FC = () => { const theme = useTheme() const isMobile = useMediaQuery(theme.breakpoints.down("sm")) const history = useHistory() const match = useRouteMatch() + const { etherlink, connect } = useTezos() const { state, dispatch } = useContext(DeploymentContext) const { tokenDistribution, tokenSettings } = state.data @@ -64,15 +66,20 @@ export const ContractSummary: React.FC = () => { }, next: { handler: () => { - mutate({ - ...state.data - }) - setIsLoading(true) + if (etherlink.isConnected) { + mutate({ + ...state.data + }) + setIsLoading(true) + } else { + connect() + } }, text: isLoading ? "Deploying..." : "Launch" } }) - }, [dispatch, history, match.path, match.url, mutate, state.data, isLoading]) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [dispatch, history, match.path, match.url, mutate, state.data, isLoading, etherlink.isConnected]) return ( <> diff --git a/src/modules/explorer/pages/DAOList/index.tsx b/src/modules/explorer/pages/DAOList/index.tsx index 824b4e96..f007a288 100644 --- a/src/modules/explorer/pages/DAOList/index.tsx +++ b/src/modules/explorer/pages/DAOList/index.tsx @@ -196,6 +196,8 @@ export const DAOList: React.FC = () => { return [] }, [daos, searchText, account]) + console.log({ daos, currentDAOs, myDAOs }) + const filterDAOs = (filter: string) => { setSearchText(filter.trim()) } diff --git a/src/modules/lite/explorer/pages/ProposalDetails/index.tsx b/src/modules/lite/explorer/pages/ProposalDetails/index.tsx index 50cb8eb3..d3e65609 100644 --- a/src/modules/lite/explorer/pages/ProposalDetails/index.tsx +++ b/src/modules/lite/explorer/pages/ProposalDetails/index.tsx @@ -71,6 +71,8 @@ export const ProposalDetails: React.FC<{ id: string }> = ({ id }) => { poll?.referenceBlock ) + console.log({ voteWeight }) + const [votingPower, setVotingPower] = useState(poll?.isXTZ ? voteWeight?.votingXTZWeight : voteWeight?.votingWeight) const choices = usePollChoices(poll, refresh) diff --git a/src/services/beacon/hooks/useTezos.ts b/src/services/beacon/hooks/useTezos.ts index dbe2c113..b632b473 100644 --- a/src/services/beacon/hooks/useTezos.ts +++ b/src/services/beacon/hooks/useTezos.ts @@ -34,7 +34,9 @@ export const useTezos = (): WalletConnectReturn => { isConnected: isEtherlinkConnected, connect: connectWithWagmi, disconnect: disconnectEtherWallet, - network: etherlinkNetwork + network: etherlinkNetwork, + provider: ethProvider, + signer: ethSigner } = useContext(EtherlinkContext) const queryClient = useQueryClient() @@ -209,7 +211,9 @@ export const useTezos = (): WalletConnectReturn => { isEtherlink: network?.startsWith("etherlink"), etherlink: { isConnected: isEtherlinkConnected, - account: ethAccount + account: ethAccount, + provider: ethProvider, + signer: ethSigner } } } diff --git a/src/services/wagmi/context.tsx b/src/services/wagmi/context.tsx index a90571e5..0bc1f890 100644 --- a/src/services/wagmi/context.tsx +++ b/src/services/wagmi/context.tsx @@ -4,6 +4,7 @@ import { disconnect as disconnectEtherlink } from "@wagmi/core" import { config as wagmiConfig } from "services/wagmi/config" import { etherlink, etherlinkTestnet } from "wagmi/chains" import { useSIWE, useModal, SIWESession } from "connectkit" +import { useEthersProvider, useEthersSigner } from "./ethers" interface EtherlinkType { isConnected: boolean @@ -21,6 +22,8 @@ export const EtherlinkContext = createContext(undefined) export const EtherlinkProvider: React.FC<{ children: ReactNode }> = ({ children }) => { const { setOpen } = useModal() + const provider = useEthersProvider() + const signer = useEthersSigner() const { chains, switchChain } = useSwitchChain() // const { data, isReady, isRejected, isLoading, isSignedIn, signOut, signIn, error } = useSIWE({ // onSignIn: (session?: SIWESession) => { @@ -58,6 +61,8 @@ export const EtherlinkProvider: React.FC<{ children: ReactNode }> = ({ children