Skip to content

Commit

Permalink
add newModerationFlow toggle to settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
pelumy committed Sep 11, 2024
1 parent c92b930 commit 2785e7c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Nos/Views/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,24 @@ extension SettingsView {
set: { featureFlags.setEnabled(.newMediaDisplay, enabled: $0) }
)
}

/// A toggle for the new media display that allows the user to turn the feature on or off.
private var newMediaFeatureToggle: some View {
NosToggle(isOn: isNewMediaDisplayEnabled, labelText: .localizable.enableNewMediaDisplay)
}

/// Whether the new moderation flow is enabled.
private var isNewModerationFlowEnabled: Binding<Bool> {
Binding<Bool>(
get: { featureFlags.isEnabled(.newModerationFlow) },
set: { featureFlags.setEnabled(.newModerationFlow, enabled: $0) }
)
}

/// A toggle for the new moderation flow that allows the user to turn the feature on or off.
private var newModerationFlowToggle: some View {
NosToggle(isOn: isNewModerationFlowEnabled, labelText: .localizable.enableNewModerationFlow)
}
}
#endif

Expand All @@ -283,6 +296,7 @@ extension SettingsView {
/// Controls that will appear when the app is built for STAGING.
@MainActor private var stagingControls: some View {
newMediaFeatureToggle
newModerationFlowToggle
}
}
#endif
Expand All @@ -293,6 +307,7 @@ extension SettingsView {
@MainActor private var debugControls: some View {
Group {
newMediaFeatureToggle
newModerationFlowToggle

Text(.localizable.sampleDataInstructions)
.foregroundColor(.primaryTxt)
Expand Down

0 comments on commit 2785e7c

Please sign in to comment.