From 36a9eefe212be44283c0316960c05f86f176a8f1 Mon Sep 17 00:00:00 2001 From: Gareth Simpson Date: Thu, 26 Jan 2023 08:04:35 +0000 Subject: [PATCH] Make the Show/Hide Spoiler button less prominant. (#387) --- .../Sources/Status/Row/StatusRowView.swift | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/Packages/Status/Sources/Status/Row/StatusRowView.swift b/Packages/Status/Sources/Status/Row/StatusRowView.swift index f7cd2d1d..5992974c 100644 --- a/Packages/Status/Sources/Status/Row/StatusRowView.swift +++ b/Packages/Status/Sources/Status/Row/StatusRowView.swift @@ -221,17 +221,33 @@ public struct StatusRowView: View { private func makeStatusContentView(status: AnyStatus) -> some View { Group { if !status.spoilerText.asRawText.isEmpty { - EmojiTextApp(status.spoilerText, emojis: status.emojis, language: status.language) - .font(.scaledBody) - Button { + + HStack(alignment: .top) { + Text("⚠︎") + .font(.system(.subheadline , weight:.bold)) + .foregroundColor(.secondary) + EmojiTextApp(status.spoilerText, emojis: status.emojis, language: status.language) + .font(.system(.subheadline , weight:.bold)) + .foregroundColor(.secondary) + .multilineTextAlignment(.leading) + Spacer() + Button { + withAnimation { + viewModel.displaySpoiler.toggle() + } + } label: { + Image(systemName: "chevron.down") + .rotationEffect(Angle(degrees: viewModel.displaySpoiler ? 0 : 180)) + } + .buttonStyle(.bordered) + .accessibility(label: viewModel.displaySpoiler ? Text("status.show-more") : Text("status.show-less")) + .accessibilityHidden(true) + } + .onTapGesture { // make whole row tapable to make up for smaller button size withAnimation { viewModel.displaySpoiler.toggle() } - } label: { - Text(viewModel.displaySpoiler ? "status.show-more" : "status.show-less") } - .buttonStyle(.bordered) - .accessibilityHidden(true) } if !viewModel.displaySpoiler {