-
Notifications
You must be signed in to change notification settings - Fork 58
Update error state views to use dynamic titles #1632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,8 +34,7 @@ public struct ChartStateView: View { | |||||||
| ChartView(model: model) | ||||||||
| case .error(let error): | ||||||||
| StateEmptyView( | ||||||||
| title: Localized.Errors.errorOccured, | ||||||||
| description: error.networkOrNoDataDescription, | ||||||||
| title: error.networkOrNoDataDescription, | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the change in
Suggested change
|
||||||||
| image: Images.ErrorConent.error | ||||||||
| ) | ||||||||
| } | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While moving
error.networkOrNoDataDescriptionto thetitleparameter makes the title dynamic, it's generally better practice to use a concise, generic title for error states (e.g., 'An error occurred!') and provide the specific details in thedescriptionparameter. This improves readability and user experience, especially ifnetworkOrNoDataDescriptioncan be verbose. TheStateEmptyViewis designed to accommodate both a title and a description.