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

refactor: quick transfer UI, profile tabs rendering, profile transfer modal #502

Merged
merged 11 commits into from
Jan 29, 2025

Conversation

cswni
Copy link
Contributor

@cswni cswni commented Jan 28, 2025

This pull request introduces several new components and enhancements related to the finance section of the application, focusing on improving the user interface and functionality for profile and wallet management, as well as quick transfers.

New components and enhancements:

Modifications to existing components:

Other changes:

cswni added 8 commits January 27, 2025 14:20
- In `user-profile-view.tsx`:
  - Changed tabs alignment to `flex-start` for better layout consistency.
  - Adjusted scroll button visibility: hide for disabled states and conditionally based on `currentTab`.
  - Enhanced responsiveness by aligning tabs differently for `xs` and `sm` viewports.
- **src/sections/finance/index.tsx**: Updated the title in `FinanceQuickTransfer` component to "Quick transfer to" for better clarity.
- **src/sections/finance/components/finance-display-name.tsx**: Added a new component to display the currently selected profile's name and address.
- **src/sections/finance/components/finance-no-followings-quick-transfer.tsx**: Added a new component to guide users when no followings are available for transfers.
- **src/sections/finance/components/finance-quick-transfer.tsx**: Integrated the new components, replacing the wallet input with a display name or fallback guidance for no followings.

Improves user experience during the quick transfer process by adding profile context and fallback handling.
- Extract `handleAmountConstraints` to a utility in `format-number.ts` for better reusability and modularity.
- Update calls to `handleAmountConstraints` in `finance-quick-transfer.tsx` to use the new utility function with the updated parameters.
- Replace `FinanceDisplayName` with `FinanceDisplayProfileInfo` and refine its rendering logic to support multiple modes (`profile` and `wallet`).
- Adjust `CardHeader` styling with additional padding for consistency.
- Rename button text from "Transfer Now" to "Quick transfer" for improved clarity.
- Renamed `FinanceDisplayName` to `FinanceDisplayProfileInfo` for clarity.
- Added a new `mode` prop to toggle between displaying profile name or wallet address.
- Updated rendering logic to conditionally display content based on the mode selection.
- `finance-quick-transfer-modal.tsx`:
  - Add dynamic input support for transfer amount when "amount" is zero.
  - Introduce `MAX_AMOUNT` and `MAX_POOL` constraints for input validation.
  - Add callbacks `handleChangeInput` and `handleBlur` to manage input changes with constraints.
  - Update UI to display input field dynamically based on "amount" value.
  - Disable confirm button if the input amount violates constraints or is invalid.
- Introduced `ProfileTransfer` component in `src/sections/user/profile-transfer.tsx`.
- Utilizes `FinanceQuickTransferModal` for transferring profiles with a maximum limit of 500.
- Implements `useBoolean` hook to manage modal state efficiently.
- **src/sections/user/profile-header.tsx**: Added `ProfileTransfer` component to the profile header, making it available for user-to-user interactions.
- **src/sections/finance/index.tsx**: Removed redundant `title` prop from `FinanceQuickTransfer` component to simplify its usage and improve consistency.
- **profile-header.tsx**: Add authentication check before rendering `ProfileTransfer` to ensure availability only for authenticated users.
- **profile-transfer.tsx**: Update transfer button with new styling: defined min-width, background color, and changed button variant to `outlined` for consistency.
@cswni cswni added the Refactor label Jan 28, 2025
@cswni cswni requested review from geolffreym and Jadapema January 28, 2025 00:15
@cswni cswni self-assigned this Jan 28, 2025
- Removed the unused `renderWalletInput` component from `finance-quick-transfer.tsx`.
- Updated logic to directly handle the rendering condition for the carousel and the no-followings fallback.
- Simplified conditional rendering by removing commented-out code and refining checks.
cswni added 2 commits January 27, 2025 18:55
- Removed `toggleRainbow` import and related logic from `finance-quick-transfer.tsx` as it was no longer used.
- Eliminated `addressError` state and associated `handleInputChange` function.
- Cleaned up unused `TextField` import to streamline the component.
@geolffreym geolffreym merged commit 7b518e7 into next Jan 29, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
2 participants