Make the Show/Hide Spoiler button less prominant. (#387)

This commit is contained in:
Gareth Simpson 2023-01-26 08:04:35 +00:00 committed by GitHub
parent 7abe792e20
commit 36a9eefe21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,18 +221,34 @@ public struct StatusRowView: View {
private func makeStatusContentView(status: AnyStatus) -> some View {
Group {
if !status.spoilerText.asRawText.isEmpty {
HStack(alignment: .top) {
Text("⚠︎")
.font(.system(.subheadline , weight:.bold))
.foregroundColor(.secondary)
EmojiTextApp(status.spoilerText, emojis: status.emojis, language: status.language)
.font(.scaledBody)
.font(.system(.subheadline , weight:.bold))
.foregroundColor(.secondary)
.multilineTextAlignment(.leading)
Spacer()
Button {
withAnimation {
viewModel.displaySpoiler.toggle()
}
} label: {
Text(viewModel.displaySpoiler ? "status.show-more" : "status.show-less")
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()
}
}
}
if !viewModel.displaySpoiler {
HStack {