mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-04-27 02:14:45 +00:00
Composer: Normalize error UI for media upload
This commit is contained in:
parent
3f17afa8ac
commit
aad3e27748
1 changed files with 2 additions and 25 deletions
|
@ -65,29 +65,7 @@ struct StatusEditorMediaView: View {
|
||||||
.frame(width: 150, height: 150)
|
.frame(width: 150, height: 150)
|
||||||
.cornerRadius(8)
|
.cornerRadius(8)
|
||||||
if container.error != nil {
|
if container.error != nil {
|
||||||
VStack {
|
Text("status.editor.error.upload")
|
||||||
Text("status.editor.error.upload")
|
|
||||||
Button {
|
|
||||||
withAnimation {
|
|
||||||
viewModel.mediasImages.removeAll(where: { $0.id == container.id })
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
VStack {
|
|
||||||
Text("action.delete")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.buttonStyle(.bordered)
|
|
||||||
Button {
|
|
||||||
Task {
|
|
||||||
await viewModel.upload(container: container)
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
VStack {
|
|
||||||
Text("action.retry")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.buttonStyle(.bordered)
|
|
||||||
}
|
|
||||||
} else if container.mediaAttachment == nil {
|
} else if container.mediaAttachment == nil {
|
||||||
ProgressView()
|
ProgressView()
|
||||||
}
|
}
|
||||||
|
@ -157,8 +135,7 @@ struct StatusEditorMediaView: View {
|
||||||
private func makeErrorView(error: ServerError) -> some View {
|
private func makeErrorView(error: ServerError) -> some View {
|
||||||
ZStack {
|
ZStack {
|
||||||
placeholderView
|
placeholderView
|
||||||
Text("alert.error")
|
Text("status.editor.error.upload")
|
||||||
.foregroundColor(.red)
|
|
||||||
}
|
}
|
||||||
.alert("alert.error", isPresented: $isErrorDisplayed) {
|
.alert("alert.error", isPresented: $isErrorDisplayed) {
|
||||||
Button("Ok", action: {})
|
Button("Ok", action: {})
|
||||||
|
|
Loading…
Reference in a new issue