2023-05-23 22:24:53 +05:30
|
|
|
import Defaults
|
2023-02-25 21:12:18 +05:30
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct HideShortsButtons: View {
|
2023-05-23 22:24:53 +05:30
|
|
|
@Default(.hideShorts) private var hideShorts
|
2023-02-25 21:12:18 +05:30
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
Button {
|
2023-05-23 22:24:53 +05:30
|
|
|
hideShorts.toggle()
|
2023-02-25 21:12:18 +05:30
|
|
|
} label: {
|
|
|
|
Group {
|
2023-05-23 22:24:53 +05:30
|
|
|
if hideShorts {
|
2023-02-25 21:12:18 +05:30
|
|
|
Label("Short videos: hidden", systemImage: "bolt.slash.fill")
|
|
|
|
.help("Short videos: hidden")
|
|
|
|
} else {
|
|
|
|
Label("Short videos: visible", systemImage: "bolt.fill")
|
|
|
|
.help("Short videos: visible")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if os(tvOS)
|
2023-04-23 00:37:30 +05:30
|
|
|
.font(.caption)
|
2023-02-25 21:12:18 +05:30
|
|
|
.imageScale(.small)
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct HideShortsButtons_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
VStack {
|
2023-05-23 22:24:53 +05:30
|
|
|
HideShortsButtons()
|
2023-02-25 21:12:18 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|