commit 2341b12cc128eb618655deeffa94aa9965b1f510 parent e934c2bb1140ee8b60288ce85a36cfccd980d5a5 Author: Sujeet Poudel <spoudel2@carnival.com> Date: Wed, 19 Apr 2023 22:02:01 -0400 Adjust attachment images placement when posting Changelog-Changed: Adjust attachment images placement when posting Closes: #979 Diffstat:
M | damus/Views/PostView.swift | | | 11 | +++++++---- |
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/damus/Views/PostView.swift b/damus/Views/PostView.swift @@ -271,11 +271,14 @@ struct PostView: View { } } - var has_artifacts: Bool { + var multiply_factor: CGFloat { 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 { @@ -285,7 +288,7 @@ struct PostView: View { TextEntry } - .frame(height: has_artifacts ? deviceSize.size.height*0.4 : deviceSize.size.height) + .frame(height: deviceSize.size.height * multiply_factor) .id("post") PVImageCarouselView(media: $uploadedMedias, deviceWidth: deviceSize.size.width)