feat: implement reusable EmptyState component with contextual hooks a…#515
Conversation
|
@iamTissan 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! 🚀 |
|
45947a2 to
4317bf1
Compare
PR #515 (Issue #66 — Empty States) The previous snag was caused by localized layout spacing anomalies across the modified list screen layouts. I have executed Prettier directly on the targeted files to enforce strict style-guide rules. I also explicitly re-verified the type integrity of our new additions (EmptyState.tsx, SubscriptionList.tsx, and InvoiceListScreen.tsx) using targeted compilation checks, and they pass with 0 errors. The codebase changes are fully type-safe, accessible, and ready for your review/merge! |
Summary
Closes #66
This PR introduces a centralized, production-grade, and highly accessible
EmptyStateUI component to prevent blank layouts when list views contain zero active items. It contextually implements this fallback system across core application features (Subscriptions and Invoices) while guaranteeing adherence to design tokens and strict strict global accessibility guidelines.Changes Made
src/components/common/EmptyState.tsx: Created a reusable, stateless fallback interface component supporting contextual illustrations (emojis), text descriptions, and conditional Call-To-Action (CTA) action buttons. Implemented accessibility parameters (accessible={true}, explicitaccessibilityRole, andimportantForAccessibility="no"to prevent screen readers from stuttering over presentation-only elements).src/components/home/SubscriptionList.tsx: Refactored the dashboard collection list view. Replaced manual, ad-hoc empty labels with the unified<EmptyState />component. Introduced a dual-context view split:hasSubscriptions === falseand prompts the user with an "Add Subscription" CTA button handler.🔍 No matches found).src/screens/InvoiceListScreen.tsx: Replaced standard list breaking breaks with the contextual empty state block (🧾 No invoices yet), equipping it with an action handler that routes back to the dashboard.src/screens/HomeScreen.tsx: Cleaned up the parameter mapping layout to feed props smoothly down into the underlying collection lists.Verification & Testing Notes
ERR_PACKAGE_PATH_NOT_EXPORTEDcaused by modern system Node.js v17+ subpath encapsulation rules colliding with legacy internal scripts inside the project's pinned Metro bundle) prevented compiling a simulator rendering. Verification has been performed through property coverage checking, and code changes are isolated to visual rendering layers.Pull Request Checklist
Quality Gates (All must pass before merge)
Additional Requirements
EmptyStatePropsinterface mapping incoming visual parameters)