-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fix(pages): EVM verify external docs link and EVM contract details mobile #1238
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
WalkthroughThis pull request introduces several enhancements across multiple components. In the Changes
Sequence Diagram(s)sequenceDiagram
participant U as UserDocsLink
participant H as handleLink
participant L as Link Component
U->>H: Pass href, isExternal, isDevTool
H-->>U: Return computed URL
U->>L: Render Link with URL
sequenceDiagram
participant C as InteractComponent
participant S as SelectedType
participant M as Mobile Flag
C->>C: Evaluate condition (SelectedType starts with "read" OR isMobile true)
alt Condition met
C-->>C: Set interactType = Read
else Condition not met
C-->>C: Set interactType = SelectedType
end
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/lib/components/UserDocsLink.tsx (2)
42-42
: Consider memoizing the link value.Since
handleLink
is called on every render, consider memoizing its result usinguseMemo
to optimize performance, especially if the component re-renders frequently.- const link = handleLink(href, isExternal, isDevTool); + const link = useMemo( + () => handleLink(href, isExternal, isDevTool), + [href, isExternal, isDevTool] + );
47-49
: Track website after stopPropagation.The event propagation is stopped after tracking, which could prevent tracking if
stopPropagation
throws an error.- trackWebsite(link); - e.stopPropagation(); + e.stopPropagation(); + trackWebsite(link);src/lib/pages/evm-contract-details/components/interact-evm-contract/index.tsx (1)
41-44
: Verify if mobile write access restriction is intentional.The current implementation forces read-only mode on mobile devices. While this might be intentional for security or UX reasons, consider adding a configuration option to allow write access on mobile when necessary.
Consider adding a prop to override mobile read-only restriction:
interface InteractEvmContractProps { contractAddress: HexAddr20; contractAbi: JsonFragment[]; selectedType: InteractTabsIndex; selectedFn?: string; proxyTargetEvmVerifyInfo: Option<EvmVerifyInfo>; + allowMobileWrite?: boolean; } export const InteractEvmContract = ({ contractAddress, contractAbi, selectedType, selectedFn, proxyTargetEvmVerifyInfo, + allowMobileWrite = false, }: InteractEvmContractProps) => { const isMobile = useMobile(); const navigate = useInternalNavigate(); const interactType = - isMobile || selectedType.startsWith("read") + (!allowMobileWrite && isMobile) || selectedType.startsWith("read") ? InteractType.Read : InteractType.Write;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/lib/components/UserDocsLink.tsx
(5 hunks)src/lib/pages/evm-contract-details/components/EvmContractDetailsTop.tsx
(3 hunks)src/lib/pages/evm-contract-details/components/evm-contract-details-overview/OverviewVerifiedCmds.tsx
(1 hunks)src/lib/pages/evm-contract-details/components/interact-evm-contract/index.tsx
(1 hunks)src/lib/pages/evm-contract-verify/components/ContractLicenseInfoAccordion.tsx
(1 hunks)
🔇 Additional comments (6)
src/lib/pages/evm-contract-verify/components/ContractLicenseInfoAccordion.tsx (1)
48-48
: LGTM!The addition of
isExternal
prop is appropriate for the GitHub documentation link.src/lib/components/UserDocsLink.tsx (1)
10-19
: LGTM! Well-structured URL handling logic.The
handleLink
function effectively centralizes URL determination logic, making it easier to maintain and test.src/lib/pages/evm-contract-details/components/evm-contract-details-overview/OverviewVerifiedCmds.tsx (2)
41-48
: LGTM! Improved responsive layout.The responsive flexDirection provides a better mobile experience while maintaining desktop layout.
54-58
: LGTM! Consistent command availability.Removing the mobile check for write commands ensures consistent functionality across devices.
src/lib/pages/evm-contract-details/components/EvmContractDetailsTop.tsx (2)
64-66
: LGTM! Enhanced button styling and usability.The changes improve the UI by:
- Using consistent outline-primary variant
- Adding descriptive icons for better recognition
Also applies to: 80-82
92-92
: LGTM! Improved Write button visibility.Making the Write button visible on medium and larger screens aligns with the PR objectives for mobile improvements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CHANGELOG.md (1)
91-96
: Clarify the Changelog Entries for EVM FixesThe new bug fix entry
- [#1238](https://github.com/alleslabs/celatone-frontend/pull/1238) Fix EVM verify external docs link and EVM contract details mobile
directly addresses the PR objectives and clearly communicates the enhanced external docs link and improved mobile handling for the EVM contract details page.However, note that the previous entry
- [#1237](https://github.com/alleslabs/celatone-frontend/pull/1237) Fix EVM contract details UI layout and mobile
is still present immediately after. This might create potential confusion if the intent was to replace or consolidate the fixes into a single entry. Please confirm whether both entries should remain or if the [#1237] entry is now obsolete given the updated fix in [#1238].
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
CHANGELOG.md
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
Summary by CodeRabbit
New Features
Bug Fixes
Style