Skip to content

Commit

Permalink
Merge pull request openedx#363 from edx/discussions-ui-fixes
Browse files Browse the repository at this point in the history
Discussions UI fixes
  • Loading branch information
rnr authored Mar 25, 2024
2 parents 6f1ec1b + d21a3bd commit 2bc8c4f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
10 changes: 9 additions & 1 deletion Core/Core/Extensions/UIApplicationExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,20 @@ extension UINavigationController {
.font: Theme.UIFonts.titleMedium()
]

UISegmentedControl.appearance().setTitleTextAttributes(
[
.foregroundColor: Theme.Colors.textPrimary.uiColor(),
.font: Theme.UIFonts.labelLarge()
],
for: .normal
)
UISegmentedControl.appearance().setTitleTextAttributes(
[
.foregroundColor: Theme.Colors.primaryButtonTextColor.uiColor(),
.font: Theme.UIFonts.labelLarge()
],
for: .normal)
for: .selected
)
UISegmentedControl.appearance().selectedSegmentTintColor = UIColor(Theme.Colors.accentXColor)

UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = Theme.UIColors.accentXColor
Expand Down
4 changes: 1 addition & 3 deletions Core/Core/View/Base/ProgressBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ public struct ProgressBar: View {
.animation(animation, value: isAnimating)
}
.onAppear {
withAnimation {
isAnimating = true
}
isAnimating = true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public struct CreateNewThreadView: View {
self.onPostCreated = onPostCreated
self.courseID = courseID
viewModel.selectedTopic = selectedTopic
Task {
await viewModel.getTopics(courseID: courseID)
}
}

public var body: some View {
Expand Down Expand Up @@ -198,6 +195,9 @@ public struct CreateNewThreadView: View {
Theme.Colors.background
.ignoresSafeArea()
)
.task {
await viewModel.getTopics(courseID: courseID)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class CreateNewThreadViewModel: ObservableObject {

@MainActor
public func getTopics(courseID: String) async {
guard allTopics.isEmpty else { return }
isShowProgress = true
do {
topics = try await interactor.getTopics(courseID: courseID)
Expand Down
1 change: 0 additions & 1 deletion Discussion/Discussion/Presentation/Posts/PostsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Theme
public struct PostsView: View {

@ObservedObject private var viewModel: PostsViewModel
@State private var isShowProgress: Bool = true
@State private var showingAlert = false
private let router: DiscussionRouter
private let title: String
Expand Down

0 comments on commit 2bc8c4f

Please sign in to comment.