Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussions UI fixes #363

Merged
merged 4 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading