fix: profile edit UX issue. ticket: #2875LSG

This commit is contained in:
CMK 2021-07-07 15:39:57 +08:00
parent 13a1194a59
commit a90dac248a
3 changed files with 9 additions and 3 deletions

View File

@ -39,7 +39,7 @@ extension ProfileFieldSection {
.sink { [weak cell] name, emojiDict in
guard let cell = cell else { return }
cell.fieldView.titleActiveLabel.configure(field: name, emojiDict: emojiDict)
cell.fieldView.titleTextField.text = name
// only bind label. The text field should only set once
}
.store(in: &cell.disposeBag)
@ -55,7 +55,7 @@ extension ProfileFieldSection {
.sink { [weak cell] value, emojiDict in
guard let cell = cell else { return }
cell.fieldView.valueActiveLabel.configure(field: value, emojiDict: emojiDict)
cell.fieldView.valueTextField.text = value
// only bind label. The text field should only set once
}
.store(in: &cell.disposeBag)

View File

@ -209,7 +209,12 @@ extension ProfileHeaderViewController {
.sink { [weak self] isEditing, note, editingNote in
guard let self = self else { return }
self.profileHeaderView.bioActiveLabel.configure(note: note ?? "", emojiDict: [:]) // FIXME: custom emoji
self.profileHeaderView.bioTextEditorView.text = editingNote ?? ""
// prevent duplicate set
let editingNote = editingNote ?? ""
if self.profileHeaderView.bioTextEditorView.text != editingNote {
self.profileHeaderView.bioTextEditorView.text = editingNote
}
}
.store(in: &disposeBag)

View File

@ -37,6 +37,7 @@ final class ProfileFieldView: UIView {
let valueActiveLabel: ActiveLabel = {
let label = ActiveLabel(style: .profileFieldValue)
label.configure(content: "value", emojiDict: [:])
label.textAlignment = .right
return label
}()