-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
Task: Implement Save Profile Integration Using User Management Hook
Description
Extend the existing onboarding flow to allow users to save their profile through the user_management smart contract. When the “Build Profile” button is pressed on the welcome page, the frontend should call the contract using the existing useUserManagement hook to persist user information on the Stellar testnet.
Prerequisites
- The
useUserManagementhook must already be implemented and functional withcreateUser,updateUser, andgetUsermethods.
- The wallet provider must supply the connected address and signer context.
- The
user_managementcontract binding should be available insrc/contract_connections/user_management_binding.
Requirements
-
UI Update in Welcome Page
-
File:
src/app/welcome/page.tsx -
Add or update the “Build Profile” button handler to:
- Retrieve the wallet address from context.
- Collect user profile data from form inputs or static defaults.
- Call the
createUserfunction from the hook. - Display feedback (success or error) to the user.
-
-
Contract Interaction
-
Import the
useUserManagementhook. -
Initialize the hook by passing required parameters (e.g.,
contractId,server, etc.). -
Call:
await createUser(address, profileData);
-
After a successful transaction, redirect to
/dashboard.
-
-
Error & UX Handling
- Show loading state while the transaction is pending.
- Catch and display any contract errors clearly.
- Disable the button during contract execution.
-
Testing
- Verify that a new user profile is created on testnet.
- Confirm redirection to
/dashboardafter success. - Validate error and loading feedback.
Deliverables
- Updated
src/app/welcome/page.tsxwith integratedcreateUserlogic. - Functional “Build Profile” button that triggers contract interaction.
- User redirection to
/dashboardafter successful profile save.
Acceptance Criteria
- Pressing “Build Profile” successfully triggers the contract call through the hook.
- The hook receives wallet and contract parameters externally (no context inside the hook).
- User profile creation works on Stellar testnet.
- UX provides proper feedback for success, errors, and loading state.
- Code follows clean and modular TypeScript standards.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels