From 02cff6ffd25a1fcfbf2bca0e6ab7f1494ff66b7e Mon Sep 17 00:00:00 2001 From: Ashutosh Kumar Date: Thu, 7 Nov 2024 01:34:57 +0530 Subject: [PATCH] Navigate to Deployer without Login --- .../creator/token/etherlink/steps/Ownership.tsx | 6 ++---- .../creator/token/etherlink/steps/Summary.tsx | 17 ++++++++++++----- .../explorer/pages/ProposalDetails/index.tsx | 2 ++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/modules/creator/token/etherlink/steps/Ownership.tsx b/src/modules/creator/token/etherlink/steps/Ownership.tsx index d811c052..dad7275c 100644 --- a/src/modules/creator/token/etherlink/steps/Ownership.tsx +++ b/src/modules/creator/token/etherlink/steps/Ownership.tsx @@ -66,10 +66,8 @@ export const Ownership: React.FC = () => { { - if (etherlink.isConnected) { - 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/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)