Improvements.
This commit is contained in:
parent
c400091c4f
commit
7cd6eb2a3b
|
@ -23,6 +23,7 @@ struct ComposeView: View {
|
|||
@State private var commentsDisabled = false
|
||||
@State private var place: Place?
|
||||
|
||||
@State private var photosAreAttached = false
|
||||
@State private var publishDisabled = true
|
||||
@State private var interactiveDismissDisabled = false
|
||||
|
||||
|
@ -131,6 +132,7 @@ struct ComposeView: View {
|
|||
item != photoAttachment
|
||||
})
|
||||
|
||||
self.photosAreAttached = self.photosAttachment.hasUploadedPhotos()
|
||||
self.publishDisabled = self.isPublishButtonDisabled()
|
||||
self.interactiveDismissDisabled = self.isInteractiveDismissDisabled()
|
||||
}
|
||||
|
@ -215,7 +217,7 @@ struct ComposeView: View {
|
|||
self.focusedField = .unknown
|
||||
self.photosPickerVisible = true
|
||||
} label: {
|
||||
Image(systemName: "photo.on.rectangle.angled")
|
||||
Image(systemName: self.photosAreAttached ? "photo.fill.on.rectangle.fill" : "photo.on.rectangle")
|
||||
}
|
||||
|
||||
Button {
|
||||
|
@ -326,6 +328,7 @@ struct ComposeView: View {
|
|||
await self.upload()
|
||||
|
||||
self.photosAreUploading = false
|
||||
self.photosAreAttached = self.photosAttachment.hasUploadedPhotos()
|
||||
self.publishDisabled = self.isPublishButtonDisabled()
|
||||
self.interactiveDismissDisabled = self.isInteractiveDismissDisabled()
|
||||
} catch {
|
||||
|
|
|
@ -148,6 +148,7 @@ struct MainView: View {
|
|||
Text(navBarTitle)
|
||||
.font(.headline)
|
||||
Image(systemName: "chevron.down")
|
||||
.fontWeight(.semibold)
|
||||
.font(.subheadline)
|
||||
}
|
||||
.frame(width: 150)
|
||||
|
@ -211,7 +212,9 @@ struct MainView: View {
|
|||
self.routerPath.presentedSheet = .newStatusEditor
|
||||
} label: {
|
||||
Image(systemName: "square.and.pencil")
|
||||
.tint(.mainTextColor)
|
||||
.symbolRenderingMode(.palette)
|
||||
.foregroundStyle(Color.accentColor, Color.mainTextColor)
|
||||
.fontWeight(.semibold)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ struct PlaceSelectorView: View {
|
|||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
@State private var places: [Place] = []
|
||||
@State private var showLoader = false
|
||||
@State private var query = String.empty()
|
||||
|
||||
@Binding public var place: Place?
|
||||
|
@ -50,12 +51,20 @@ struct PlaceSelectorView: View {
|
|||
}
|
||||
|
||||
Section {
|
||||
if self.showLoader {
|
||||
HStack(alignment: .center) {
|
||||
Spacer()
|
||||
LoadingIndicator(isVisible: Binding.constant(true))
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
|
||||
ForEach(self.places, id: \.id) { place in
|
||||
Button {
|
||||
self.place = place
|
||||
self.dismiss()
|
||||
} label: {
|
||||
HStack {
|
||||
HStack(alignment: .center) {
|
||||
VStack(alignment: .leading) {
|
||||
Text(place.name ?? String.empty())
|
||||
.foregroundColor(.mainTextColor)
|
||||
|
@ -92,6 +101,8 @@ struct PlaceSelectorView: View {
|
|||
}
|
||||
|
||||
private func searchPlaces() async {
|
||||
self.showLoader = true
|
||||
|
||||
do {
|
||||
if let placesFromApi = try await self.client.places?.search(query: self.query) {
|
||||
self.places = placesFromApi
|
||||
|
@ -99,6 +110,8 @@ struct PlaceSelectorView: View {
|
|||
} catch {
|
||||
ErrorService.shared.handle(error, message: "Cannot download places.", showToastr: true)
|
||||
}
|
||||
|
||||
self.showLoader = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue