-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Labels
Description
Issue: Use UserStore in ProfileCard Component
📋 Description
Replace hardcoded user data in ProfileCard component with dynamic data from the userStore to display real user information.
🎯 Objective
- Display real user data instead of hardcoded values
- Integrate ProfileCard with existing userStore
- Improve data consistency across the application
- Follow best practices for state management
📍 File location
src/features/buyer/profile/components/ProfileCard.tsx
🔄 Current state
The ProfileCard currently uses hardcoded data:
- Name: "Matias Aguilar"
- Email: "[email protected]"
🔧 Required changes
- Import userStore hook
- Replace hardcoded name with dynamic user name
- Replace hardcoded email with dynamic user email
- Add fallback values for empty data
- Ensure proper TypeScript types
📝 Implementation details
Import statement:
import { useUser } from '@/shared/stores/userStore';Hook usage:
const { name, email } = useUser();Data replacement:
// Instead of:
<p>Matias Aguilar</p>
<p>xaguilar@gmail.com</p>
// Use:
<p>{name || 'User Name'}</p>
<p>{email || '[email protected]'}</p>✅ Acceptance criteria
- ProfileCard displays real user name from store
- ProfileCard displays real user email from store
- Fallback values shown when data is empty
- No TypeScript errors
- Component updates when user data changes
- Maintains existing styling and layout
🛠️ Technical considerations
- Use existing userStore from
@/shared/stores/userStore - Ensure proper error handling for missing data
- Maintain responsive design
- Follow existing component patterns
📝 Additional notes
- The userStore already has the necessary hooks:
useUser() - Store includes:
name,email,walletAddress,role - Component should be reactive to store changes
- Consider adding loading states if needed
🏷️ Labels
bugbuyerprofilestate-managementrefactor