Skip to content

Commit

Permalink
/issues/5114 - Disabled poll creation in build settings and removed t…
Browse files Browse the repository at this point in the history
…he custom title bar view modifier.
  • Loading branch information
stefanceriu committed Nov 11, 2021
1 parent 17686e5 commit 9a662d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ final class BuildSettings: NSObject {
return false
}

return true
return false
}

/// Allow split view detail view stacking
Expand Down
4 changes: 4 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ abstract_target 'RiotPods' do
import_SwiftUI_pods
end

target "RiotSwiftUITests" do
import_SwiftUI_pods
end

target "SiriIntents" do
import_MatrixKit
end
Expand Down
39 changes: 13 additions & 26 deletions RiotSwiftUI/Modules/Room/PollEditForm/View/PollEditForm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,19 @@ struct PollEditForm: View {
.animation(.easeInOut(duration: 0.2))
.padding()
.frame(minHeight: proxy.size.height) // Make the VStack fill the ScrollView's parent
.modifier(NavigationTitleBar(titleColor: theme.colors.primaryContent) {
viewModel.send(viewAction: .cancel)
})
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button(VectorL10n.cancel, action: {
viewModel.send(viewAction: .cancel)
})
}
ToolbarItem(placement: .principal) {
Text(VectorL10n.pollEditFormCreatePoll)
.font(.headline)
.foregroundColor(theme.colors.primaryContent)
}
}
.navigationBarTitleDisplayMode(.inline)
}
}
}
Expand Down Expand Up @@ -125,29 +135,6 @@ private struct AnswerOptionGroup: View {
}
}

@available(iOS 14.0, *)
private struct NavigationTitleBar: ViewModifier {
let titleColor: Color
let cancelCallback: () -> Void

func body(content: Content) -> some View {
return content
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button(VectorL10n.cancel, action: {
cancelCallback()
})
}
ToolbarItem(placement: .principal) {
Text(VectorL10n.pollEditFormCreatePoll)
.font(.headline)
.foregroundColor(titleColor)
}
}
.navigationBarTitleDisplayMode(.inline)
}
}

// MARK: - Previews

@available(iOS 14.0, *)
Expand Down

0 comments on commit 9a662d9

Please sign in to comment.