fix: change delete to Delete, set deleteAction attributes: [.destructive]

This commit is contained in:
sunxiaojian 2021-04-26 20:36:59 +08:00
parent 272f1c459e
commit dcb1bb7053
6 changed files with 7 additions and 5 deletions

View File

@ -146,7 +146,7 @@
"title": "Tell us about you.",
"input": {
"avatar": {
"delete": "delete"
"delete": "Delete"
},
"username": {
"placeholder": "username",

View File

@ -502,7 +502,7 @@ internal enum L10n {
}
internal enum Input {
internal enum Avatar {
/// delete
/// Delete
internal static let delete = L10n.tr("Localizable", "Scene.Register.Input.Avatar.Delete")
}
internal enum DisplayName {

View File

@ -162,7 +162,7 @@ tap the link to confirm your account.";
"Scene.Register.Error.Special.PasswordTooShort" = "Password is too short (must be at least 8 characters)";
"Scene.Register.Error.Special.UsernameInvalid" = "Username must only contain alphanumeric characters and underscores";
"Scene.Register.Error.Special.UsernameTooLong" = "Username is too long (can't be longer than 30 characters)";
"Scene.Register.Input.Avatar.Delete" = "delete";
"Scene.Register.Input.Avatar.Delete" = "Delete";
"Scene.Register.Input.DisplayName.Placeholder" = "display name";
"Scene.Register.Input.Email.Placeholder" = "email";
"Scene.Register.Input.Invite.RegistrationUserInviteRequest" = "Why do you want to join?";

View File

@ -0,0 +1,2 @@
"NSCameraUsageDescription" = "Used to take photo for post status";
"NSPhotoLibraryAddUsageDescription" = "Used to save photo into the Photo Library";

View File

@ -32,7 +32,7 @@ extension MastodonRegisterViewController {
}
children.append(browseAction)
if self.viewModel.avatarImage.value != nil {
let deleteAction = UIAction(title: L10n.Scene.Register.Input.Avatar.delete, image: UIImage(systemName: "delete.left"), identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off) { [weak self] _ in
let deleteAction = UIAction(title: L10n.Scene.Register.Input.Avatar.delete, image: UIImage(systemName: "delete.left"), identifier: nil, discoverabilityTitle: nil, attributes: [.destructive], state: .off) { [weak self] _ in
guard let self = self else { return }
self.viewModel.avatarImage.value = nil
}

View File

@ -58,6 +58,7 @@ final class MastodonServerRulesViewController: UIViewController, NeedsDependency
textView.textColor = .label
textView.isSelectable = true
textView.isEditable = false
textView.isScrollEnabled = false
textView.backgroundColor = Asset.Colors.Background.systemGroupedBackground.color
return textView
}()
@ -120,7 +121,6 @@ extension MastodonServerRulesViewController {
bottomPromptTextView.frameLayoutGuide.topAnchor.constraint(equalTo: bottomContainerView.topAnchor, constant: 20),
bottomPromptTextView.frameLayoutGuide.leadingAnchor.constraint(equalTo: bottomContainerView.readableContentGuide.leadingAnchor),
bottomPromptTextView.frameLayoutGuide.trailingAnchor.constraint(equalTo: bottomContainerView.readableContentGuide.trailingAnchor),
bottomPromptTextView.frameLayoutGuide.heightAnchor.constraint(equalToConstant: 50),
confirmButton.topAnchor.constraint(equalTo: bottomPromptTextView.frameLayoutGuide.bottomAnchor, constant: 20),
])