Style changes
This commit is contained in:
parent
dc296fc8ae
commit
4d7a3d690b
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -22,7 +22,7 @@ struct ListsView: View {
|
|||
} label: {
|
||||
Label("add", systemImage: "plus.circle")
|
||||
}
|
||||
.disabled(newListTitle == "")
|
||||
.disabled(newListTitle.isEmpty)
|
||||
}
|
||||
}
|
||||
Section {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)? {
|
||||
|
|
Loading…
Reference in New Issue