mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-23 00:40:59 +00:00
Make the Show/Hide Spoiler button less prominant. (#387)
This commit is contained in:
parent
7abe792e20
commit
36a9eefe21
1 changed files with 23 additions and 7 deletions
|
@ -221,17 +221,33 @@ public struct StatusRowView: View {
|
||||||
private func makeStatusContentView(status: AnyStatus) -> some View {
|
private func makeStatusContentView(status: AnyStatus) -> some View {
|
||||||
Group {
|
Group {
|
||||||
if !status.spoilerText.asRawText.isEmpty {
|
if !status.spoilerText.asRawText.isEmpty {
|
||||||
EmojiTextApp(status.spoilerText, emojis: status.emojis, language: status.language)
|
|
||||||
.font(.scaledBody)
|
HStack(alignment: .top) {
|
||||||
Button {
|
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 {
|
withAnimation {
|
||||||
viewModel.displaySpoiler.toggle()
|
viewModel.displaySpoiler.toggle()
|
||||||
}
|
}
|
||||||
} label: {
|
|
||||||
Text(viewModel.displaySpoiler ? "status.show-more" : "status.show-less")
|
|
||||||
}
|
}
|
||||||
.buttonStyle(.bordered)
|
|
||||||
.accessibilityHidden(true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !viewModel.displaySpoiler {
|
if !viewModel.displaySpoiler {
|
||||||
|
|
Loading…
Reference in a new issue