Style changes

This commit is contained in:
Justin Mazzocchi 2020-12-03 14:32:15 -08:00
parent dc296fc8ae
commit 4d7a3d690b
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
6 changed files with 10 additions and 10 deletions

View file

@ -30,7 +30,7 @@ public final class EditFilterViewModel: ObservableObject {
public extension EditFilterViewModel {
var isNew: Bool { filter.id == Filter.newFilterId }
var isSaveDisabled: Bool { filter.phrase == "" || filter.context.isEmpty }
var isSaveDisabled: Bool { filter.phrase.isEmpty || filter.context.isEmpty }
func toggleSelection(context: Filter.Context) {
if filter.context.contains(context) {

View file

@ -29,13 +29,13 @@ public final class StatusViewModel: CollectionItemViewModel, ObservableObject {
self.identification = identification
content = statusService.status.displayStatus.content.attributed
contentEmoji = statusService.status.displayStatus.emojis
displayName = statusService.status.displayStatus.account.displayName == ""
displayName = statusService.status.displayStatus.account.displayName.isEmpty
? statusService.status.displayStatus.account.username
: statusService.status.displayStatus.account.displayName
displayNameEmoji = statusService.status.displayStatus.account.emojis
spoilerText = statusService.status.displayStatus.spoilerText
isReblog = statusService.status.reblog != nil
rebloggedByDisplayName = statusService.status.account.displayName == ""
rebloggedByDisplayName = statusService.status.account.displayName.isEmpty
? statusService.status.account.username
: statusService.status.account.displayName
rebloggedByDisplayNameEmoji = statusService.status.account.emojis

View file

@ -98,7 +98,7 @@ private extension AccountView {
func applyAccountConfiguration() {
avatarImageView.kf.setImage(with: accountConfiguration.viewModel.avatarURL(profile: false))
if accountConfiguration.viewModel.displayName == "" {
if accountConfiguration.viewModel.displayName.isEmpty {
displayNameLabel.isHidden = true
} else {
let mutableDisplayName = NSMutableAttributedString(string: accountConfiguration.viewModel.displayName)

View file

@ -22,7 +22,7 @@ struct ListsView: View {
} label: {
Label("add", systemImage: "plus.circle")
}
.disabled(newListTitle == "")
.disabled(newListTitle.isEmpty)
}
}
Section {

View file

@ -30,7 +30,7 @@ final class StatusBodyView: UIView {
mutableContent.insert(emoji: viewModel.contentEmoji, view: contentTextView)
mutableContent.resizeAttachments(toLineHeight: contentFont.lineHeight)
contentTextView.attributedText = mutableContent
contentTextView.isHidden = contentTextView.text == ""
contentTextView.isHidden = contentTextView.text.isEmpty
mutableSpoilerText.insert(emoji: viewModel.contentEmoji, view: spoilerTextLabel)
mutableSpoilerText.resizeAttachments(toLineHeight: spoilerTextLabel.font.lineHeight)
@ -42,14 +42,14 @@ final class StatusBodyView: UIView {
? NSLocalizedString("status.show-less", comment: "")
: NSLocalizedString("status.show-more", comment: ""),
for: .normal)
toggleShowContentButton.isHidden = viewModel.spoilerText == ""
toggleShowContentButton.isHidden = viewModel.spoilerText.isEmpty
contentTextView.isHidden = !viewModel.shouldShowContent
attachmentsView.isHidden = viewModel.attachmentViewModels.count == 0
attachmentsView.isHidden = viewModel.attachmentViewModels.isEmpty
attachmentsView.viewModel = viewModel
pollView.isHidden = viewModel.pollOptions.count == 0
pollView.isHidden = viewModel.pollOptions.isEmpty
pollView.viewModel = viewModel
cardView.viewModel = viewModel.cardViewModel

View file

@ -66,7 +66,7 @@ final class TouchFallthroughTextView: UITextView {
}
override var intrinsicContentSize: CGSize {
return text == "" ? .zero : super.intrinsicContentSize
return text.isEmpty ? .zero : super.intrinsicContentSize
}
func urlAndRect(at point: CGPoint) -> (URL, CGRect)? {