Skip to content

Commit

Permalink
fix: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
songwongtp committed Apr 29, 2024
1 parent c29ce4f commit e693da9
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/table/contracts/ContractsTableRowCTA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ export const ContractsTableRowCTA = ({
onClick={(e) => e.stopPropagation()}
>
<AppLink
href={`/interact-contract?selectedType=${ContractInteractionTabs.ExecuteContract}&contract=${contractInfo.contractAddress}`}
href={`/interact-contract?selectedType=${ContractInteractionTabs.Execute}&contract=${contractInfo.contractAddress}`}
>
<Button variant="outline-gray" size="sm">
Execute
</Button>
</AppLink>
<AppLink
href={`/interact-contract?selectedType=${ContractInteractionTabs.QueryContract}&contract=${contractInfo.contractAddress}`}
href={`/interact-contract?selectedType=${ContractInteractionTabs.Query}&contract=${contractInfo.contractAddress}`}
>
<Button variant="outline-gray" size="sm">
Query
Expand Down
2 changes: 1 addition & 1 deletion src/lib/hooks/useRedo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useRedo = () => {
pathname: "/interact-contract",
query: {
chainName,
selectedType: ContractInteractionTabs.ExecuteContract,
selectedType: ContractInteractionTabs.Execute,
contract: msg.contract,
msg: encodeMsg,
},
Expand Down
6 changes: 3 additions & 3 deletions src/lib/pages/contract-details/components/ContractTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const ContractTop = ({
contractLocalInfo?.name || publicInfo?.name || contract.label;
const projectName = projectInfo?.name;

const goToInteractContract = (type: string) => {
const goToInteractContract = (type: ContractInteractionTabs) => {
navigate({
pathname: "/interact-contract",
query: {
Expand Down Expand Up @@ -237,7 +237,7 @@ export const ContractTop = ({
w={{ base: "full", md: "auto" }}
leftIcon={<CustomIcon name="query" />}
onClick={() =>
goToInteractContract(ContractInteractionTabs.QueryContract)
goToInteractContract(ContractInteractionTabs.Query)
}
size={{ base: "sm", md: "md" }}
>
Expand All @@ -248,7 +248,7 @@ export const ContractTop = ({
w={{ base: "full", md: "auto" }}
leftIcon={<CustomIcon name="execute" />}
onClick={() => {
goToInteractContract(ContractInteractionTabs.ExecuteContract);
goToInteractContract(ContractInteractionTabs.Execute);
}}
size={{ base: "sm", md: "md" }}
isDisabled={isMobile}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/pages/instantiate/completed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Completed = ({ txInfo }: CompletedProps) => {
navigate({
pathname: "/interact-contract",
query: {
selectedType: ContractInteractionTabs.ExecuteContract,
selectedType: ContractInteractionTabs.Execute,
contract: txInfo.contractAddress,
},
})
Expand All @@ -94,7 +94,7 @@ const Completed = ({ txInfo }: CompletedProps) => {
navigate({
pathname: "/interact-contract",
query: {
selectedType: ContractInteractionTabs.QueryContract,
selectedType: ContractInteractionTabs.Query,
contract: txInfo.contractAddress,
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,10 @@ export const InteractionWrapper = ({
<Box
sx={{
"& .query": {
display: resolveTabDisplay(
currentTab,
ContractInteractionTabs.QueryContract
),
display: resolveTabDisplay(currentTab, ContractInteractionTabs.Query),
},
"& .execute": {
display: resolveTabDisplay(
currentTab,
ContractInteractionTabs.ExecuteContract
),
display: resolveTabDisplay(currentTab, ContractInteractionTabs.Execute),
},
}}
>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/pages/interact-contract/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const InteractContractBody = ({
// ---------------SIDE EFFECTS---------------//
// ------------------------------------------//
useEffect(() => {
if (isMobile && selectedType === ContractInteractionTabs.ExecuteContract)
if (isMobile && selectedType === ContractInteractionTabs.Execute)
navigate({
pathname: INTERACT_CONTRACT_PATH_NAME,
query: {
Expand Down Expand Up @@ -176,7 +176,7 @@ const InteractContract = () => {
useEffect(() => {
if (router.isReady && validated.success) {
const { selectedType, contract, msg } = validated.data;
if (selectedType === ContractInteractionTabs.QueryContract)
if (selectedType === ContractInteractionTabs.Query)
trackToQuery(!!contract, !!msg);
else trackToExecute(!!contract, !!msg);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/pages/interact-contract/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const zInteractContractQueryParams = z.object({
z
.string()
.optional()
.transform(() => ContractInteractionTabs.QueryContract),
.transform(() => ContractInteractionTabs.Query),
]),
contract: zBechAddr32.default(""),
msg: z.string().default(""),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const PublicProjectContractMobileCard = ({
onClick={(e) => e.stopPropagation()}
>
<AppLink
href={`/interact-contract?selectedType=${ContractInteractionTabs.QueryContract}&contract=${publicInfo.contractAddress}`}
href={`/interact-contract?selectedType=${ContractInteractionTabs.Query}&contract=${publicInfo.contractAddress}`}
>
<Button variant="outline-gray" size="sm">
Query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ export const PublicProjectContractRow = ({
onClick={(e) => e.stopPropagation()}
>
<AppLink
href={`/interact-contract?selectedType=${ContractInteractionTabs.ExecuteContract}contract=${publicContractInfo.publicInfo.contractAddress}`}
href={`/interact-contract?selectedType=${ContractInteractionTabs.Execute}contract=${publicContractInfo.publicInfo.contractAddress}`}
>
<Button variant="outline-gray" size="sm">
Execute
</Button>
</AppLink>
<AppLink
href={`/interact-contract?selectedType=${ContractInteractionTabs.QueryContract}&contract=${publicContractInfo.publicInfo.contractAddress}`}
href={`/interact-contract?selectedType=${ContractInteractionTabs.Query}&contract=${publicContractInfo.publicInfo.contractAddress}`}
>
<Button variant="outline-gray" size="sm">
Query
Expand Down
4 changes: 2 additions & 2 deletions src/lib/types/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ export interface ContractMigrationHistory {
}

export enum ContractInteractionTabs {
QueryContract = "Query",
ExecuteContract = "Execute",
Query = "Query",
Execute = "Execute",
}

0 comments on commit e693da9

Please sign in to comment.