Refactor iOS and Android code to follow single responsibility principle
- iOS: Extracted views and helpers into separate files
- Created Documents/Helpers/DocumentHelpers.swift for type/category helpers
- Created Documents/Components/ with individual view files:
- ImageViewerSheet.swift
- WarrantyCard.swift
- DocumentCard.swift
- EmptyStateView.swift
- WarrantiesTabContent.swift
- DocumentsTabContent.swift
- Cleaned up DocumentDetailView.swift and DocumentsWarrantiesView.swift
- Android: Extracted composables into organized component structure
- Created ui/components/documents/ package with:
- DocumentCard.kt (WarrantyCardContent, RegularDocumentCardContent, formatFileSize)
- DocumentStates.kt (EmptyState, ErrorState)
- DocumentsTabContent.kt
- Reduced DocumentsScreen.kt from 506 lines to 211 lines
- Added missing imports to DocumentDetailScreen.kt and EditDocumentScreen.kt
Net result: +770 insertions, -716 deletions across 15 files
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
34
iosApp/iosApp/Documents/Helpers/DocumentHelpers.swift
Normal file
34
iosApp/iosApp/Documents/Helpers/DocumentHelpers.swift
Normal file
@@ -0,0 +1,34 @@
|
||||
import Foundation
|
||||
|
||||
struct DocumentTypeHelper {
|
||||
static func displayName(for value: String) -> String {
|
||||
switch value {
|
||||
case "warranty": return "Warranty"
|
||||
case "manual": return "User Manual"
|
||||
case "receipt": return "Receipt/Invoice"
|
||||
case "inspection": return "Inspection Report"
|
||||
case "permit": return "Permit"
|
||||
case "deed": return "Deed/Title"
|
||||
case "insurance": return "Insurance"
|
||||
case "contract": return "Contract"
|
||||
case "photo": return "Photo"
|
||||
default: return "Other"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct DocumentCategoryHelper {
|
||||
static func displayName(for value: String) -> String {
|
||||
switch value {
|
||||
case "appliance": return "Appliance"
|
||||
case "hvac": return "HVAC"
|
||||
case "plumbing": return "Plumbing"
|
||||
case "electrical": return "Electrical"
|
||||
case "roofing": return "Roofing"
|
||||
case "structural": return "Structural"
|
||||
case "landscaping": return "Landscaping"
|
||||
case "general": return "General"
|
||||
default: return "Other"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user