Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: evm method chip #1118

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- [#1118](https://github.com/alleslabs/celatone-frontend/pull/1118) Implement base evm method chip
- [#1117](https://github.com/alleslabs/celatone-frontend/pull/1117) Add JSON RPC request and get block data from JSON RPC
- [#1105](https://github.com/alleslabs/celatone-frontend/pull/1105) Add base minievm branch with its sign mode and pubkey type
- [#1102](https://github.com/alleslabs/celatone-frontend/pull/1102) Support add local development chain lite version
Expand Down
18 changes: 18 additions & 0 deletions src/lib/components/EvmMethodChip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Tag } from "@chakra-ui/react";
import type { TagProps } from "@chakra-ui/react";

const mapMethod = (txInput: string) => {
if (txInput === "0x") return "transfer";
return txInput.slice(0, 10);
};

interface EvmMethodChipProps {
txInput: string;
width: TagProps["width"];
}

export const EvmMethodChip = ({ txInput, width }: EvmMethodChipProps) => (
<Tag width={width} height="17px" bgColor="gray.700">
{mapMethod(txInput)}
</Tag>
);