popup for nsfw content
This commit is contained in:
@@ -19,8 +19,11 @@ struct CustomizeView: View {
|
||||
@AppStorage(UserDefaultsStore.Keys.customMoodTintUpdateNumber.rawValue, store: GroupUserDefaults.groupDefaults) private var customMoodTintUpdateNumber: Int = 0
|
||||
|
||||
@AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = .black
|
||||
|
||||
|
||||
@AppStorage(UserDefaultsStore.Keys.showNSFW.rawValue, store: GroupUserDefaults.groupDefaults) private var showNSFW: Bool = false
|
||||
|
||||
@State private var sampleListEntry = PersistenceController.shared.randomEntries(count: 1).first!
|
||||
@State private var showOver18Alert = false
|
||||
|
||||
@StateObject private var customMoodTint = UserDefaultsStore.getCustomMoodTint()
|
||||
|
||||
@@ -213,7 +216,6 @@ struct CustomizeView: View {
|
||||
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
||||
.fill(imagePack == images ? theme.currentTheme.bgColor : .clear)
|
||||
.padding([.top, .bottom], -3)
|
||||
|
||||
)
|
||||
.onTapGesture {
|
||||
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
|
||||
@@ -403,10 +405,27 @@ struct CustomizeView: View {
|
||||
.padding(5)
|
||||
)
|
||||
.onTapGesture {
|
||||
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
|
||||
impactMed.impactOccurred()
|
||||
personalityPack = aPack
|
||||
LocalNotification.rescheduleNotifiations()
|
||||
if aPack.rawValue == PersonalityPack.Rude.rawValue && !showNSFW {
|
||||
showOver18Alert = true
|
||||
} else {
|
||||
let impactMed = UIImpactFeedbackGenerator(style: .heavy)
|
||||
impactMed.impactOccurred()
|
||||
personalityPack = aPack
|
||||
LocalNotification.rescheduleNotifiations()
|
||||
}
|
||||
}
|
||||
.blur(radius: aPack.rawValue == PersonalityPack.Rude.rawValue && !showNSFW ? 5 : 0)
|
||||
.alert(isPresented: $showOver18Alert) {
|
||||
let primaryButton = Alert.Button.default(Text(String(localized: "customize_view_over18alert_ok"))) {
|
||||
showNSFW = true
|
||||
}
|
||||
let secondaryButton = Alert.Button.cancel(Text(String(localized: "customize_view_over18alert_no"))) {
|
||||
showNSFW = false
|
||||
}
|
||||
return Alert(title: Text(String(localized: "customize_view_over18alert_title")),
|
||||
message: Text(String(localized: "customize_view_over18alert_body")),
|
||||
primaryButton: primaryButton,
|
||||
secondaryButton: secondaryButton)
|
||||
}
|
||||
if aPack.rawValue != (PersonalityPack.allCases.sorted(by: { $0.rawValue > $1.rawValue }).first?.rawValue) ?? 0 {
|
||||
Divider()
|
||||
|
||||
Reference in New Issue
Block a user