mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 18:21:00 +00:00
Some UI Fixes
This commit is contained in:
parent
ca9ce92053
commit
dcccc459c2
3 changed files with 35 additions and 22 deletions
|
@ -90,12 +90,14 @@ struct StatusEditorMediaView: View {
|
|||
|
||||
@ViewBuilder
|
||||
private func makeImageMenu(container: StatusEditorViewModel.ImageContainer) -> some View {
|
||||
Button {
|
||||
editingContainer = container
|
||||
} label: {
|
||||
Label(container.mediaAttachement?.description?.isEmpty == false ?
|
||||
"Edit description" : "Add description",
|
||||
systemImage: "pencil.line")
|
||||
if !viewModel.mode.isEditing {
|
||||
Button {
|
||||
editingContainer = container
|
||||
} label: {
|
||||
Label(container.mediaAttachement?.description?.isEmpty == false ?
|
||||
"Edit description" : "Add description",
|
||||
systemImage: "pencil.line")
|
||||
}
|
||||
}
|
||||
Button(role: .destructive) {
|
||||
withAnimation {
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -251,24 +251,26 @@ public struct StatusRowView: View {
|
|||
}
|
||||
|
||||
if account.account?.id == viewModel.status.account.id {
|
||||
Button {
|
||||
Task {
|
||||
if viewModel.isPinned {
|
||||
await viewModel.unPin()
|
||||
} else {
|
||||
await viewModel.pin()
|
||||
Section("Your post") {
|
||||
Button {
|
||||
Task {
|
||||
if viewModel.isPinned {
|
||||
await viewModel.unPin()
|
||||
} else {
|
||||
await viewModel.pin()
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Label(viewModel.isPinned ? "Unpin": "Pin", systemImage: viewModel.isPinned ? "pin.fill" : "pin")
|
||||
}
|
||||
Button {
|
||||
routeurPath.presentedSheet = .editStatusEditor(status: viewModel.status)
|
||||
} label: {
|
||||
Label("Edit", systemImage: "pencil")
|
||||
}
|
||||
Button(role: .destructive) { Task { await viewModel.delete() } } label: {
|
||||
Label("Delete", systemImage: "trash")
|
||||
}
|
||||
} label: {
|
||||
Label(viewModel.isPinned ? "Unpin": "Pin", systemImage: viewModel.isPinned ? "pin.fill" : "pin")
|
||||
}
|
||||
Button {
|
||||
routeurPath.presentedSheet = .editStatusEditor(status: viewModel.status)
|
||||
} label: {
|
||||
Label("Edit", systemImage: "pencil")
|
||||
}
|
||||
Button(role: .destructive) { Task { await viewModel.delete() } } label: {
|
||||
Label("Delete", systemImage: "trash")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue