Skip to content

feat: refactor Home component and add mock data for initial messages …#70

Merged
soomtochukwu merged 6 commits intoDXmakers:mainfrom
Benedict315:main
Apr 29, 2026
Merged

feat: refactor Home component and add mock data for initial messages …#70
soomtochukwu merged 6 commits intoDXmakers:mainfrom
Benedict315:main

Conversation

@Benedict315
Copy link
Copy Markdown
Contributor

PR Description: Centralize Mock Data
Summary
This PR centralizes hardcoded mock data from React components into a dedicated configuration file to prevent unnecessary re-renders and improve maintainability.

Changes Made
Moved mock data to src/config/mockData.ts: Consolidated goalData, initialMessages, and defaultAllocations into a single export file
Updated src/app/page.tsx: Removed inline goalData definition and added imports for goalData and initialMessages from the centralized file
Updated src/utils/allocationParser.ts: Modified getDefaultAllocations() to return the imported defaultAllocations array instead of defining it locally
Why This Change
Performance: Prevents recreation of mock objects on every component render
Maintainability: All mock data is now in one place for easy updates
Code Quality: Eliminates static mock objects within React component bodies
Acceptance Criteria ✅
No static mock objects are defined within React components
Application functions exactly as before with data imported from centralized file
All imports are correct and functional
Testing
Verified no compilation errors in modified files
Confirmed no remaining hardcoded mock data in components
Changes are minimal and non-breaking
Files Changed
mockData.ts (existing file, now used for imports)
page.tsx
allocationParser.ts
closes #43

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 26, 2026

@Benedict315 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@soomtochukwu soomtochukwu merged commit 19b06e7 into DXmakers:main Apr 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centralize Mock Data

2 participants