Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
devmehmetates committed Feb 21, 2024
1 parent 7c9d042 commit a1309db
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Sources/ErrorableView/Abstract/ErrorableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ fileprivate extension ErrorableView {
}

public extension ErrorableViewP {
var body: some View {
ZStack {
@ViewBuilder var body: some View {
Group {
switch errorPresentType {
case .onPage:
onPageConfiguration()
Expand Down Expand Up @@ -151,11 +151,12 @@ public extension ErrorableViewP {
fileprivate extension ErrorableViewP {
@ViewBuilder func onPageConfiguration() -> some View {
Group {
if presenter.pageState == .loading {
switch presenter.pageState {
case .loading:
loadingContent
} else if presenter.pageState == .failure {
case .failure:
errorContent
} else {
case .successful:
content
}
}
Expand Down

0 comments on commit a1309db

Please sign in to comment.