Skip to content

Commit

Permalink
Merge pull request #254 from Planetable/fixes-share-sheet-scrolling-2
Browse files Browse the repository at this point in the history
Center preview image for single-attachment-post.
  • Loading branch information
livid authored Jul 20, 2023
2 parents fb04524 + 110aad1 commit d419018
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 d419018

Please sign in to comment.