Some UI Fixes

This commit is contained in:
Thomas Ricouard 2023-01-03 20:36:57 +01:00
parent ca9ce92053
commit dcccc459c2
3 changed files with 35 additions and 22 deletions

View file

@ -90,6 +90,7 @@ struct StatusEditorMediaView: View {
@ViewBuilder
private func makeImageMenu(container: StatusEditorViewModel.ImageContainer) -> some View {
if !viewModel.mode.isEditing {
Button {
editingContainer = container
} label: {
@ -97,6 +98,7 @@ struct StatusEditorMediaView: View {
"Edit description" : "Add description",
systemImage: "pencil.line")
}
}
Button(role: .destructive) {
withAnimation {
viewModel.mediasImages.removeAll(where: { $0.id == container.id })

View file

@ -7,6 +7,15 @@ extension StatusEditorViewModel {
case edit(status: Status)
case quote(status: Status)
var isEditing: Bool {
switch self {
case .edit:
return true
default:
return false
}
}
var replyToStatus: Status? {
switch self {
case let .replyTo(status):

View file

@ -251,6 +251,7 @@ public struct StatusRowView: View {
}
if account.account?.id == viewModel.status.account.id {
Section("Your post") {
Button {
Task {
if viewModel.isPinned {
@ -272,4 +273,5 @@ public struct StatusRowView: View {
}
}
}
}
}