special thanks and why bg mode will expand to show explanation when tapped
This commit is contained in:
@@ -15,6 +15,9 @@ struct SettingsView: View {
|
||||
|
||||
@State private var showOnboarding = false
|
||||
|
||||
@State private var showSpecialThanks = false
|
||||
@State private var showWhyBGMode = false
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
Color(UIColor.secondarySystemBackground)
|
||||
@@ -22,15 +25,16 @@ struct SettingsView: View {
|
||||
VStack {
|
||||
closeButtonView
|
||||
.padding()
|
||||
randomShitCell
|
||||
addTestDataCell
|
||||
clearDB
|
||||
whyBackgroundMode
|
||||
changeIcon
|
||||
showOnboardingButton
|
||||
whyBackgroundMode
|
||||
specialThanksCell
|
||||
Spacer()
|
||||
}
|
||||
.padding()
|
||||
|
||||
}.sheet(isPresented: $showOnboarding) {
|
||||
OnboardingMain(onboardingData: UserDefaultsStore.getOnboarding(),
|
||||
updateBoardingDataClosure: { onboardingData in
|
||||
@@ -38,6 +42,7 @@ struct SettingsView: View {
|
||||
showOnboarding = false
|
||||
})
|
||||
}
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
|
||||
private var closeButtonView: some View {
|
||||
@@ -53,16 +58,23 @@ struct SettingsView: View {
|
||||
}
|
||||
}
|
||||
|
||||
private var randomShitCell: some View {
|
||||
private var specialThanksCell: some View {
|
||||
ZStack {
|
||||
Color(UIColor.systemBackground)
|
||||
VStack {
|
||||
Button(action: {
|
||||
|
||||
withAnimation{
|
||||
showSpecialThanks.toggle()
|
||||
}
|
||||
}, label: {
|
||||
Text(String(localized: "settings_view_special_thanks_to"))
|
||||
Text(String(localized: "settings_view_special_thanks_to_title"))
|
||||
})
|
||||
.padding()
|
||||
|
||||
if showSpecialThanks {
|
||||
Text(String(localized: "settings_view_special_thanks_to_body"))
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
@@ -102,8 +114,20 @@ struct SettingsView: View {
|
||||
private var whyBackgroundMode: some View {
|
||||
ZStack {
|
||||
Color(UIColor.systemBackground)
|
||||
Text(String(localized: "settings_view_why_bg_mode"))
|
||||
.padding()
|
||||
VStack {
|
||||
Button(action: {
|
||||
withAnimation{
|
||||
showWhyBGMode.toggle()
|
||||
}
|
||||
}, label: {
|
||||
Text(String(localized: "settings_view_why_bg_mode_title"))
|
||||
})
|
||||
.padding()
|
||||
if showWhyBGMode {
|
||||
Text(String(localized: "settings_view_why_bg_mode_body"))
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
|
||||
|
||||
@@ -44,8 +44,10 @@
|
||||
"filter_view_end_date" = "End Date";
|
||||
|
||||
"settings_view_exit" = "Exit";
|
||||
"settings_view_special_thanks_to" = "Special thanks to";
|
||||
"settings_view_why_bg_mode" = "we do bg mode b/c we can";
|
||||
"settings_view_special_thanks_to_title" = "Special thanks";
|
||||
"settings_view_special_thanks_to_body" = "Special body";
|
||||
"settings_view_why_bg_mode_title" = "What do we use background task for?";
|
||||
"settings_view_why_bg_mode_body" = "We use it to update the database for any missing day. For example: if you rate Monday and Wednesday you'll see that Tuesday will show on the view as missing, and by tapping that row you can then rate the day that is missing. We need a time to search for and add missing days, we do this nightly and while your device is not being used. It's a quick process and doesn't impact battery life.";
|
||||
"settings_view_change_icon" = "Change Icon";
|
||||
"settings_view_show_onboarding" = "Show onboarding";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user