Repository navigation
Conversation
…e to TopUpModal Add +7 Days, +30 Days, and +90 Days quick-fill preset pill buttons to TopUpModal that compute the required token deposit from ratePerSecond (ratePerSecond * 86400 * days) and display the new projected end date below the input when a valid top-up amount is entered. Fixes LabsCrypt#1635
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds quick runway preset pill buttons (
+7 Days,+30 Days,+90 Days) and a projected end date preview toTopUpModal(frontend/src/components/stream-creation/TopUpModal.tsx).Type of Change
Related Issues
Closes #1635
Fixes #1635
/claim #1635
Changes Made
calculateRunwayPresetAmount,calculateProjectedEndDate, andformatProjectedEndDateinfrontend/src/components/stream-creation/TopUpModal.tsx.+7 Days,+30 Days, and+90 Daysquick-fill preset buttons (role="group",aria-label="Quick runway presets") that calculateratePerSecond * 86400 * days(capped to 7 Stellar decimals) and populate the top-up amount field.data-testid="projected-end-date") in the preview section when a valid top-up amount and stream rate are present, and passedratePerSecond={modal.stream.ratePerSecond}fromfrontend/src/components/dashboard/dashboard-view.tsx.frontend/src/components/stream-creation/__tests__/TopUpModal.test.tsxverifying preset button clicks (+7 Days,+30 Days,+90 Days), projected end date rendering, and helper edge cases.Testing
Test Coverage
Test Steps
npx vitest run src/components/stream-creation/__tests__/TopUpModal.test.tsx src/__tests__/a11y.test.tsx src/components/dashboard/dashboard-view.test.tsxinfrontend/(18/18 tests pass).npx tsc --noEmitinfrontend/(0 errors).npx eslint src/components/stream-creation/TopUpModal.tsx src/components/stream-creation/__tests__/TopUpModal.test.tsxinfrontend/(0 errors, 0 warnings).Checklist
Additional Notes
Payout Details
0x9a51790aC01c54184bcFa067bC38f7F0E7C6F6B6