1
0
mirror of git://jb55.com/damus synced 2024-10-06 11:43:21 +00:00

Adjust attachment images placement when posting

Changelog-Changed: Adjust attachment images placement when posting
Closes: #979
This commit is contained in:
Swift 2023-04-19 22:02:01 -04:00 committed by William Casarin
parent e934c2bb11
commit 07f8ad75dc

View File

@ -271,11 +271,14 @@ struct PostView: View {
} }
} }
var has_artifacts: Bool { var multiply_factor: CGFloat {
if case .quoting = action { if case .quoting = action {
return true return 0.4
} else if !uploadedMedias.isEmpty {
return 0.2
} else {
return 1.0
} }
return !uploadedMedias.isEmpty
} }
func Editor(deviceSize: GeometryProxy) -> some View { func Editor(deviceSize: GeometryProxy) -> some View {
@ -285,7 +288,7 @@ struct PostView: View {
TextEntry TextEntry
} }
.frame(height: has_artifacts ? deviceSize.size.height*0.4 : deviceSize.size.height) .frame(height: deviceSize.size.height * multiply_factor)
.id("post") .id("post")
PVImageCarouselView(media: $uploadedMedias, deviceWidth: deviceSize.size.width) PVImageCarouselView(media: $uploadedMedias, deviceWidth: deviceSize.size.width)