feat: refactor Home component and add mock data for initial messages …#70
Merged
soomtochukwu merged 6 commits intoDXmakers:mainfrom Apr 29, 2026
Merged
feat: refactor Home component and add mock data for initial messages …#70soomtochukwu merged 6 commits intoDXmakers:mainfrom
soomtochukwu merged 6 commits intoDXmakers:mainfrom
Conversation
…and allocations Co-authored-by: Copilot <[email protected]>
|
@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! 🚀 |
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.
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