Skip to content

Commit

Permalink
Center preview image for single-attachment-post.
Browse files Browse the repository at this point in the history
  • Loading branch information
kailuo committed Jul 19, 2023
1 parent fb04524 commit 110aad1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Planet/Quick Share/PlanetQuickShareView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ struct PlanetQuickShareView: View {
Text("Or drag and drop images here.")
.foregroundColor(.secondary)
}
} else if viewModel.fileURLs.count == 1, let url = viewModel.fileURLs.first, let img = NSImage(contentsOf: url) {
HStack {
Image(nsImage: img)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 180, height: 180)
}
} else {
ScrollView(.horizontal) {
LazyHStack(alignment: .center) {
Expand Down Expand Up @@ -104,13 +111,6 @@ struct PlanetQuickShareView: View {
.cornerRadius(6)
.padding(1)
.shadow(color: .secondary.opacity(0.75), radius: 0.5, x: 0, y: 0.5)
/*
HStack {
TextField("Optional Link", text: $viewModel.externalLink)
.textFieldStyle(.roundedBorder)
Spacer(minLength: 1)
}.padding(.bottom, 8)
*/
}
}

Expand Down

0 comments on commit 110aad1

Please sign in to comment.