Merge pull request #250 from status-im/bug/#231

Fix styles for validation messages in chat
This commit is contained in:
Roman Volosovskyi 2016-09-20 17:17:12 +03:00 committed by GitHub
commit c0fae5b4b7
3 changed files with 23 additions and 18 deletions

View File

@ -97,17 +97,19 @@ function webView(url) {
function validationMessage(titleText, descriptionText) {
var titleStyle = {
color: "white",
fontSize: 12,
fontFamily: "sans-serif"
style: {
color: "white",
fontSize: 12
}
};
var title = status.components.text(titleStyle, titleText);
var descriptionStyle = {
color: "white",
fontSize: 12,
fontFamily: "sans-serif",
opacity: 0.9
style: {
color: "white",
fontSize: 12,
opacity: 0.9
}
};
var description = status.components.text(descriptionStyle, descriptionText);

View File

@ -39,18 +39,21 @@
[{:keys [current-chat-id] :as db}]
(let [path [:chats current-chat-id :command-input :command :type]
type (get-in db path)
command? (= :command type)
response? (not command?)
errors (get-in db [:validation-errors current-chat-id])
validation-errors? (seq errors)
suggestion? (get-in db [:has-suggestions? current-chat-id])
custom-errors (get-in db [:custom-validation-errors current-chat-id])
validation-height (if (or (seq errors) (seq custom-errors))
request-info-height
0)]
(+ validation-height
(if (= :response type)
minimum-suggestion-height
(if-not suggestion?
input-height
(+ input-height suggestions-header-height))))))
custom-errors? (seq custom-errors)
validation-errors? (or validation-errors? custom-errors?)]
(cond-> 0
validation-errors? (+ request-info-height)
response? (+ minimum-suggestion-height)
command? (+ input-height)
(and suggestion? command?) (+ suggestions-header-height)
custom-errors? (+ suggestions-header-height)
(and command? validation-errors?) (+ suggestions-header-height))))
(register-handler :animate-show-response
;[(after #(dispatch [:command-edit-mode]))]

View File

@ -7,8 +7,8 @@
(defn message [{:keys [title description]}]
(c/list-item
[c/view
[c/text st/title title]
[c/text st/description description]]))
[c/text {:style st/title} title]
[c/text {:style st/description} description]]))
(defn messages-list [errors]
[c/list-view {:renderRow message