-
Notifications
You must be signed in to change notification settings - Fork 477
Fix/swap pro add sell for select OK-48285 OK-48318 #9529
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
Conversation
Signed-off-by: ezailWang <jelly@onekey.so>
Signed-off-by: ezailWang <jelly@onekey.so>
WalkthroughChanges refactor the Swap Pro Mode limit trading interface to support multi-token selection for the sell side. The action button now renders two-line text, and sell token selection becomes configurable via props. Extensive translation keys are added for DeFi, PIN reset, and market features. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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: 2
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (19)
packages/shared/src/locale/json/bn.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/de.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/en_US.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/es.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/fr_FR.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/hi_IN.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/id.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/it_IT.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/ja_JP.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/ko_KR.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/pt.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/pt_BR.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/ru.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/th_TH.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/uk_UA.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/vi.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/zh_CN.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/zh_HK.jsonis excluded by!packages/shared/src/locale/json/*.jsonpackages/shared/src/locale/json/zh_TW.jsonis excluded by!packages/shared/src/locale/json/*.json
📒 Files selected for processing (4)
packages/kit/src/views/Swap/pages/components/SwapProActionButton.tsxpackages/kit/src/views/Swap/pages/components/SwapProTradeInfoGroup.tsxpackages/kit/src/views/Swap/pages/components/SwapProTradingPanel.tsxpackages/shared/src/locale/enum/translations.ts
🧰 Additional context used
🧬 Code graph analysis (1)
packages/kit/src/views/Swap/pages/components/SwapProActionButton.tsx (1)
packages/components/src/primitives/SizeableText/index.tsx (1)
SizableText(7-9)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: unittest (20.x)
- GitHub Check: lint (20.x)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (4)
packages/kit/src/views/Swap/pages/components/SwapProActionButton.tsx (1)
264-281: Two-line button label wiring looks consistent
actionButtonTextnow always returns{ resValue, subValue }, and the YStack renders those two lines cleanly, withsubValueomitted when empty. Character-limit logic and the disabled states stay intact. No issues spotted here.Also applies to: 321-331, 360-377
packages/shared/src/locale/enum/translations.ts (1)
460-517: New translation keys align with existing naming patternsThe added enum members (DeFi set,
global_apy,global_wallet_balance, pin/reset keys,market_3m, andpromode_limit_sell_for) fit the current naming scheme and don’t conflict with existing entries. From this file alone, the additions look safe.Also applies to: 1225-1226, 1246-1247, 1876-1877, 2017-2017, 2117-2117, 2232-2234, 2663-2664, 2850-2850, 3122-3130
packages/kit/src/views/Swap/pages/components/SwapProTradingPanel.tsx (1)
33-45: Trade-type switch clearing and prop wiring look soundCalling
cleanInputAmount()beforesetSwapProTradeTypeprevents stale amounts when toggling MARKET/LIMIT, and passingcleanInputAmount,defaultTokens, anddefaultLimitTokensdown to bothSwapProInputContainerandSwapProTradeInfoGroupkeeps the data flow consistent. No functional issues here.Also applies to: 47-59, 90-97, 127-133, 135-142
packages/kit/src/views/Swap/pages/components/SwapProTradeInfoGroup.tsx (1)
41-55: Default token selection by trade type is reasonableUsing
defaultTokensfor MARKET anddefaultLimitTokensfor LIMIT viadefaultTokensFromTypekeeps the sell-target list aligned with the current mode. The extended props surface onSwapProTradeInfoGroupmatches howSwapProTradingPanelpasses config down. No issues here.Also applies to: 66-77
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.