Skip to content
Snippets Groups Projects
Commit 5a2dbbe2 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Fixed empty state for ud username search

parent cc201056
No related branches found
No related tags found
2 merge requests!54Releasing 1.1.4,!50Search UI 2.0
......@@ -80,6 +80,8 @@ final class SearchUsernameController: UIViewController {
.receive(on: DispatchQueue.main)
.sink { [unowned self] in
screenView.placeholderView.isHidden = true
screenView.emptyView.isHidden = $0.numberOfItems != 0
dataSource.apply($0, animatingDifferences: false)
}.store(in: &cancellables)
......
......@@ -4,6 +4,26 @@ import Shared
final class SearchUsernameView: UIView {
let tableView = UITableView()
let inputField = SearchComponent()
let emptyView: UIView = {
let view = UIView()
let label = UILabel()
label.numberOfLines = 0
label.textAlignment = .center
label.font = Fonts.Mulish.regular.font(size: 15.0)
label.text = Localized.Ud.Search.Username.Empty.title
label.textColor = Asset.neutralSecondaryAlternative.color
view.addSubview(label)
label.snp.makeConstraints {
$0.center.equalToSuperview()
$0.left.equalToSuperview().offset(20)
$0.right.equalToSuperview().offset(-20)
}
return view
}()
let placeholderView = SearchUsernamePlaceholderView()
init() {
......@@ -14,8 +34,11 @@ final class SearchUsernameView: UIView {
imageAtRight: nil
)
emptyView.isHidden = true
addSubview(tableView)
addSubview(inputField)
addSubview(emptyView)
addSubview(placeholderView)
setupConstraints()
......@@ -37,6 +60,13 @@ final class SearchUsernameView: UIView {
$0.bottom.equalToSuperview()
}
emptyView.snp.makeConstraints {
$0.top.equalTo(inputField.snp.bottom).offset(20)
$0.left.equalToSuperview()
$0.right.equalToSuperview()
$0.bottom.equalToSuperview()
}
placeholderView.snp.makeConstraints {
$0.top.equalTo(inputField.snp.bottom)
$0.left.equalToSuperview().offset(32.5)
......
......@@ -218,7 +218,7 @@ public enum Localized {
public static let login = Localized.tr("Localizable", "accountRestore.sftp.login")
/// Password
public static let password = Localized.tr("Localizable", "accountRestore.sftp.password")
/// Login to your server. Your credentials will be automatically and securley saved locally on your device.
/// Login to your server. Your credentials will be automatically and securely saved locally on your device.
public static let subtitle = Localized.tr("Localizable", "accountRestore.sftp.subtitle")
/// Login to your SFTP
public static let title = Localized.tr("Localizable", "accountRestore.sftp.title")
......@@ -1249,6 +1249,10 @@ public enum Localized {
public enum Username {
/// Search by username
public static let input = Localized.tr("Localizable", "ud.search.username.input")
public enum Empty {
/// There are no users with that username
public static let title = Localized.tr("Localizable", "ud.search.username.empty.title")
}
public enum Placeholder {
/// Your searches are anonymous. Search information is never linked to your account or personally identifiable.
public static let subtitle = Localized.tr("Localizable", "ud.search.username.placeholder.subtitle")
......
......@@ -989,6 +989,9 @@
"ud.search.phone.input"
= "Search by phone number";
"ud.search.username.empty.title"
= "There are no users with that username";
"ud.search.username.placeholder.title"
= "Search for #friends# anonymously, add them to your #connections# to start a completely private messaging channel.";
"ud.search.username.placeholder.subtitle"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment