-
Notifications
You must be signed in to change notification settings - Fork 6
refactor: remove Discord link from QuestionSection for streamlined co… #166
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
WalkthroughAdded react-toastify and a ToasterContainer; mounted the toaster in RootLayout; enhanced lend hook to show token-aware toast errors and fetch token decimals; changed liquidity hook to propagate errors; removed an FAQ block and DISCORD_LINK from the landing question component. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User/UI
participant H as useLendIncrease hook
participant S as send(deposit) operation
participant T as react-toastify API
participant C as ToasterContainer (mounted)
U->>H: submit deposit
H->>S: call send(deposit)
alt success
S-->>H: success
H-->>U: existing success flow
else error
S-->>H: throws error (may include numeric balance)
H->>H: parse numeric balance using token decimals
H->>T: toast.error("Insufficient balance: X tokens")
T-->>C: enqueue toast
C-->>U: display toast (bottom-right)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ 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)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/landing/src/widgets/landing/components/question-section/question-section.tsx(1 hunks)
⏰ 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). (2)
- GitHub Check: test-build-image (landing)
- GitHub Check: test-build-image (app)
🔇 Additional comments (1)
packages/landing/src/widgets/landing/components/question-section/question-section.tsx (1)
5-5: LGTM! Import cleanup is correct.The removal of
DISCORD_LINKis consistent with the content changes, andNOTION_LINKis retained and properly used in the component.
packages/landing/src/widgets/landing/components/question-section/question-section.tsx
Show resolved
Hide resolved
…d ToasterContainer component
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: 4
🧹 Nitpick comments (1)
packages/app/src/features/liquidity-flow/hooks/use-lend-increase.tsx (1)
36-38: Consider lazy-loading token decimals.Fetching decimals for all three tokens unconditionally may be inefficient if only one token is used in the deposit operation.
Consider fetching decimals only when needed within the error handler:
- const usdcDecimals = useTokenInfo('usdc').decimals; - const xlmDecimals = useTokenInfo('xlm').decimals; - const xrpDecimals = useTokenInfo('xrp').decimals; - const depositSumUsd = useDepositUsd(position?.deposits);Then in the error handler, fetch the specific token's decimals:
const tokenName = Object.keys(sendValue)[0] as SupportedTokenName; const decimals = useTokenInfo(tokenName).decimals;Note: This would require refactoring to avoid calling hooks conditionally. Alternatively, create a helper function outside the component that accepts decimals as parameters.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (5)
packages/app/package.json(1 hunks)packages/app/src/app/layout.tsx(2 hunks)packages/app/src/features/liquidity-flow/hooks/use-lend-increase.tsx(4 hunks)packages/app/src/features/liquidity-flow/hooks/use-liquidity.ts(1 hunks)packages/app/src/global/providers/toaster-container.tsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
packages/app/src/app/layout.tsx (1)
packages/app/src/global/providers/toaster-container.tsx (1)
ToasterContainer(6-21)
packages/app/src/features/liquidity-flow/hooks/use-lend-increase.tsx (2)
packages/app/src/features/liquidity-flow/hooks/use-token-info.ts (1)
useTokenInfo(8-42)packages/app/src/features/liquidity-flow/soroban/get-cell-by-position-update.tsx (1)
getCellByPositionUpdate(5-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: test-build-image (landing)
- GitHub Check: test-build-image (app)
- GitHub Check: test-build-image (landing)
- GitHub Check: test-build-image (app)
🔇 Additional comments (1)
packages/app/src/global/providers/toaster-container.tsx (1)
6-21: LGTM! Toast configuration is well-structured.The ToastContainer configuration is appropriate with sensible defaults:
- Bottom-right positioning is conventional
- 5-second auto-close provides good UX
- Draggable with horizontal direction enables user control
- Close button gives explicit dismissal option
…orrow amounts in MarketCard component
…ntent
Summary by CodeRabbit
New Features
Bug Fixes / UX
Chores
Changes