-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1190 from alleslabs/fix/verify-publish-contract
Fix(pages): EVM Verification
- Loading branch information
Showing
9 changed files
with
81 additions
and
98 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
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
59 changes: 13 additions & 46 deletions
59
src/lib/pages/evm-contract-details/components/EvmContractDetailsBytecode.tsx
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,58 +1,25 @@ | ||
import { | ||
chakra, | ||
Heading, | ||
Stack, | ||
TabList, | ||
TabPanel, | ||
TabPanels, | ||
Tabs, | ||
} from "@chakra-ui/react"; | ||
|
||
import { useMobile } from "lib/app-provider"; | ||
import { CustomTab } from "lib/components/CustomTab"; | ||
import { Heading, Stack } from "@chakra-ui/react"; | ||
import { NotVerifiedDetails } from "lib/components/evm-verify-section"; | ||
import { TextReadOnly } from "lib/components/json/TextReadOnly"; | ||
|
||
const StyledCustomTab = chakra(CustomTab, { | ||
baseStyle: { | ||
border: "unset", | ||
borderRadius: "4px", | ||
_selected: { bgColor: "gray.800", color: "white" }, | ||
width: "256px", | ||
}, | ||
}); | ||
import { HexAddr20 } from "lib/types"; | ||
|
||
interface EvmContractDetailsBytecodeProps { | ||
code: string; | ||
contractAddress: HexAddr20; | ||
} | ||
|
||
export const EvmContractDetailsBytecode = ({ | ||
code, | ||
}: EvmContractDetailsBytecodeProps) => { | ||
const isMobile = useMobile(); | ||
|
||
return isMobile ? ( | ||
contractAddress, | ||
}: EvmContractDetailsBytecodeProps) => ( | ||
<Stack gap={8}> | ||
{/* // TODO: Support all status */} | ||
<NotVerifiedDetails contractAddress={contractAddress} /> | ||
<Stack gap={4}> | ||
<Heading as="h6" variant="h6"> | ||
Bytecode | ||
<Heading as="h6" variant="h7"> | ||
ByteCode | ||
</Heading> | ||
<TextReadOnly text={code} canCopy /> | ||
</Stack> | ||
) : ( | ||
<Tabs | ||
variant="unstyled" | ||
orientation="vertical" | ||
index={0} | ||
isLazy | ||
lazyBehavior="keepMounted" | ||
> | ||
<TabList id="1"> | ||
<StyledCustomTab>Bytecode</StyledCustomTab> | ||
</TabList> | ||
<TabPanels> | ||
<TabPanel p={0} pl={6}> | ||
<TextReadOnly text={code} canCopy /> | ||
</TabPanel> | ||
</TabPanels> | ||
</Tabs> | ||
); | ||
}; | ||
</Stack> | ||
); |
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