Add more toggles in Labs
No changelog is needed because we already have changelog messages for the features added. Changelog-None Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -12,6 +12,10 @@ struct DamusLabsExperiments: View {
|
|||||||
let damus_state: DamusState
|
let damus_state: DamusState
|
||||||
@ObservedObject var settings: UserSettingsStore
|
@ObservedObject var settings: UserSettingsStore
|
||||||
@State var show_live_explainer: Bool = false
|
@State var show_live_explainer: Bool = false
|
||||||
|
@State var show_favorites_explainer: Bool = false
|
||||||
|
|
||||||
|
let live_label = NSLocalizedString("Live", comment: "Label for a toggle that enables an experimental feature")
|
||||||
|
let favorites_label = NSLocalizedString("Favorites", comment: "Label for a toggle that enables an experimental feature")
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
@@ -38,8 +42,8 @@ struct DamusLabsExperiments: View {
|
|||||||
.cornerRadius(15)
|
.cornerRadius(15)
|
||||||
.padding(.top, 10)
|
.padding(.top, 10)
|
||||||
|
|
||||||
LabsToggleView(toggleName: "Live", systemImage: "record.circle", isOn: $settings.live, showInfo: $show_live_explainer)
|
LabsToggleView(toggleName: live_label, systemImage: "record.circle", isOn: $settings.live, showInfo: $show_live_explainer)
|
||||||
|
LabsToggleView(toggleName: favorites_label, systemImage: "heart.fill", isOn: $settings.enable_favourites_feature, showInfo: $show_favorites_explainer)
|
||||||
}
|
}
|
||||||
.padding([.trailing, .leading], 20)
|
.padding([.trailing, .leading], 20)
|
||||||
.padding(.bottom, 50)
|
.padding(.bottom, 50)
|
||||||
@@ -52,11 +56,16 @@ struct DamusLabsExperiments: View {
|
|||||||
.ignoresSafeArea(edges: .bottom)
|
.ignoresSafeArea(edges: .bottom)
|
||||||
.sheet(isPresented: $show_live_explainer) {
|
.sheet(isPresented: $show_live_explainer) {
|
||||||
LabsExplainerView(
|
LabsExplainerView(
|
||||||
labName: "Live",
|
labName: live_label,
|
||||||
systemImage: "record.circle",
|
systemImage: "record.circle",
|
||||||
labDescription: "This will allow you to see all the real-time live streams happening on Nostr! As well as let you view and interact in the Live Chat. Please keep in mind this is still a work in progress and issues are expected. When enabled you will see the Live option in your side menu.")
|
labDescription: "This will allow you to see all the real-time live streams happening on Nostr! As well as let you view and interact in the Live Chat. Please keep in mind this is still a work in progress and issues are expected. When enabled you will see the Live option in your side menu.")
|
||||||
}
|
}
|
||||||
|
.sheet(isPresented: $show_favorites_explainer) {
|
||||||
|
LabsExplainerView(
|
||||||
|
labName: favorites_label,
|
||||||
|
systemImage: "heart.fill",
|
||||||
|
labDescription: "This will allow you to pick users to be part of your favorites list. You can also switch your profile timeline to only see posts from your favorite contacts.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -249,10 +249,6 @@ class UserSettingsStore: ObservableObject {
|
|||||||
@Setting(key: "enable_experimental_load_new_content_button", default_value: false)
|
@Setting(key: "enable_experimental_load_new_content_button", default_value: false)
|
||||||
var enable_experimental_load_new_content_button: Bool
|
var enable_experimental_load_new_content_button: Bool
|
||||||
|
|
||||||
/// Whether the app should show the Favourites feature (Damus Labs)
|
|
||||||
@Setting(key: "enable_favourites_feature", default_value: false)
|
|
||||||
var enable_favourites_feature: Bool
|
|
||||||
|
|
||||||
@StringSetting(key: "purple_environment", default_value: .production)
|
@StringSetting(key: "purple_environment", default_value: .production)
|
||||||
var purple_enviroment: DamusPurpleEnvironment
|
var purple_enviroment: DamusPurpleEnvironment
|
||||||
|
|
||||||
@@ -365,6 +361,9 @@ class UserSettingsStore: ObservableObject {
|
|||||||
@Setting(key: "live", default_value: false)
|
@Setting(key: "live", default_value: false)
|
||||||
var live: Bool
|
var live: Bool
|
||||||
|
|
||||||
|
/// Whether the app should show the Favourites feature (Damus Labs)
|
||||||
|
@Setting(key: "labs_experiment_favorites", default_value: false)
|
||||||
|
var enable_favourites_feature: Bool
|
||||||
|
|
||||||
// MARK: Internal, hidden settings
|
// MARK: Internal, hidden settings
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user