mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-09-03 00:23:49 +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
|
@ViewBuilder
|
||||||
private func makeImageMenu(container: StatusEditorViewModel.ImageContainer) -> some View {
|
private func makeImageMenu(container: StatusEditorViewModel.ImageContainer) -> some View {
|
||||||
Button {
|
if !viewModel.mode.isEditing {
|
||||||
editingContainer = container
|
Button {
|
||||||
} label: {
|
editingContainer = container
|
||||||
Label(container.mediaAttachement?.description?.isEmpty == false ?
|
} label: {
|
||||||
"Edit description" : "Add description",
|
Label(container.mediaAttachement?.description?.isEmpty == false ?
|
||||||
systemImage: "pencil.line")
|
"Edit description" : "Add description",
|
||||||
|
systemImage: "pencil.line")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Button(role: .destructive) {
|
Button(role: .destructive) {
|
||||||
withAnimation {
|
withAnimation {
|
||||||
|
|
|
@ -7,6 +7,15 @@ extension StatusEditorViewModel {
|
||||||
case edit(status: Status)
|
case edit(status: Status)
|
||||||
case quote(status: Status)
|
case quote(status: Status)
|
||||||
|
|
||||||
|
var isEditing: Bool {
|
||||||
|
switch self {
|
||||||
|
case .edit:
|
||||||
|
return true
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var replyToStatus: Status? {
|
var replyToStatus: Status? {
|
||||||
switch self {
|
switch self {
|
||||||
case let .replyTo(status):
|
case let .replyTo(status):
|
||||||
|
|
|
@ -251,24 +251,26 @@ public struct StatusRowView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
if account.account?.id == viewModel.status.account.id {
|
if account.account?.id == viewModel.status.account.id {
|
||||||
Button {
|
Section("Your post") {
|
||||||
Task {
|
Button {
|
||||||
if viewModel.isPinned {
|
Task {
|
||||||
await viewModel.unPin()
|
if viewModel.isPinned {
|
||||||
} else {
|
await viewModel.unPin()
|
||||||
await viewModel.pin()
|
} 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