diff --git a/src/status_im/chat/screen.cljs b/src/status_im/chat/screen.cljs index b99a1e5fec..554aa3f998 100644 --- a/src/status_im/chat/screen.cljs +++ b/src/status_im/chat/screen.cljs @@ -90,7 +90,8 @@ (fn [] (let [show-actions @show-actions] [touchable-highlight - {:on-press #(dispatch [:set-chat-ui-props {:show-actions? (not show-actions)}])} + {:on-press #(dispatch [:set-chat-ui-props {:show-actions? (not show-actions)}]) + :accessibility-label :chat-menu} [view st/action (if show-actions [vi/icon :icons/dropdown-up] diff --git a/src/status_im/chat/views/actions.cljs b/src/status_im/chat/views/actions.cljs index 5f837062d2..39f4b702b5 100644 --- a/src/status_im/chat/views/actions.cljs +++ b/src/status_im/chat/views/actions.cljs @@ -30,7 +30,7 @@ :subtitle (members-text members) :icon :menu_group :icon-opts {:width 25 - :height 19} + :height 19} ;; TODO not implemented: action Members :handler nil}) @@ -90,26 +90,29 @@ custom-icon handler title - subtitle] + subtitle + accessibility-label] + :or {accessibility-label :action} icon-name :icon}] [touchable-highlight {:on-press (fn [] (dispatch [:set-chat-ui-props {:show-actions? false}]) (when handler (handler)))} - [view st/action-icon-row + [view {:accessibility-label accessibility-label + :style st/action-icon-row} [view st/action-icon-view (or custom-icon - [icon icon-name icon-style])] - [view st/action-view - [text {:style st/action-title - :number-of-lines 1 - :font :medium} - title] - (when-let [subtitle subtitle] - [text {:style st/action-subtitle - :number-of-lines 1 - :font :default} - subtitle])]]]) + [icon icon-name icon-style]) + [view st/action-view + [text {:style st/action-title + :number-of-lines 1 + :font :medium} + title] + (when-let [subtitle subtitle] + [text {:style st/action-subtitle + :number-of-lines 1 + :font :default} + subtitle])]]]]) (defview actions-list-view [] (letsubs [group-chat [:chat :group-chat] @@ -121,8 +124,8 @@ (group-chat-items members public?) (user-chat-items chat-id))] [view (merge - (st/actions-wrapper status-bar-height) - (get-in platform-specific [:component-styles :actions-list-view])) + (st/actions-wrapper status-bar-height) + (get-in platform-specific [:component-styles :actions-list-view])) [view st/actions-separator] [view st/actions-view (for [action actions] diff --git a/src/status_im/chat/views/input/input.cljs b/src/status_im/chat/views/input/input.cljs index 2510e95de6..401367764a 100644 --- a/src/status_im/chat/views/input/input.cljs +++ b/src/status_im/chat/views/input/input.cljs @@ -154,23 +154,24 @@ (fn [{:keys [command-width container-width]}] (when (get-in @command [:command :sequential-params]) (let [{:keys [placeholder hidden type]} (get-in @command [:command :params @arg-pos])] - [text-input (merge {:ref #(dispatch [:set-chat-ui-props {:seq-input-ref %}]) - :style (style/seq-input-text command-width container-width) - :default-value (or @seq-arg-input-text "") - :on-change-text #(do (dispatch [:set-chat-seq-arg-input-text %]) - (dispatch [:load-chat-parameter-box (:command @command)]) - (dispatch [:set-chat-ui-props {:validation-messages nil}])) - :placeholder placeholder - :blur-on-submit false - :editable (not @sending-in-progress?) - :on-focus #(dispatch [:set-chat-ui-props {:show-emoji? false}]) - :on-submit-editing (fn [] - (when-not (or (str/blank? @seq-arg-input-text) - (get-in @command [:command :hide-send-button])) - (dispatch [:send-seq-argument])) - (js/setTimeout - #(dispatch [:chat-input-focus :seq-input-ref]) - 100))} + [text-input (merge {:ref #(dispatch [:set-chat-ui-props {:seq-input-ref %}]) + :style (style/seq-input-text command-width container-width) + :default-value (or @seq-arg-input-text "") + :on-change-text #(do (dispatch [:set-chat-seq-arg-input-text %]) + (dispatch [:load-chat-parameter-box (:command @command)]) + (dispatch [:set-chat-ui-props {:validation-messages nil}])) + :placeholder placeholder + :accessibility-label :chat-request-input + :blur-on-submit false + :editable (not @sending-in-progress?) + :on-focus #(dispatch [:set-chat-ui-props {:show-emoji? false}]) + :on-submit-editing (fn [] + (when-not (or (str/blank? @seq-arg-input-text) + (get-in @command [:command :hide-send-button])) + (dispatch [:send-seq-argument])) + (js/setTimeout + #(dispatch [:chat-input-focus :seq-input-ref]) + 100))} (get-options type))]))))) (defn input-view [_] diff --git a/src/status_im/components/contact/contact.cljs b/src/status_im/components/contact/contact.cljs index 3f479591ed..47b1afcad6 100644 --- a/src/status_im/components/contact/contact.cljs +++ b/src/status_im/components/contact/contact.cljs @@ -36,7 +36,7 @@ (when (and extended? (not (empty? extend-options))) [view st/more-btn-container [context-menu - [vi/icon :icons/options] + [vi/icon :icons/options {:accessibility-label :options}] extend-options nil st/more-btn]])]]]) @@ -50,4 +50,4 @@ (when checked {:style st/selected-contact}))] [view (st/icon-check-container checked) (when checked - [vi/icon :icons/ok {:style st/check-icon}])]]]]) \ No newline at end of file + [vi/icon :icons/ok {:style st/check-icon}])]]]]) diff --git a/src/status_im/components/icons/vector_icons.cljs b/src/status_im/components/icons/vector_icons.cljs index 89ef7c4cb7..6c7226e388 100644 --- a/src/status_im/components/icons/vector_icons.cljs +++ b/src/status_im/components/icons/vector_icons.cljs @@ -75,25 +75,27 @@ (defn icon ([name] (icon name nil)) - ([name {:keys [color container-style style]}] - [react/view {:style container-style} + ([name {:keys [color container-style style accessibility-label] + :or {accessibility-label :icon}}] + [react/view {:style container-style + :accessibility-label accessibility-label} (if-let [icon-fn (get icons (normalize-property-name name))] (into [] (concat - [svg (merge default-viewbox style)] - (icon-fn - (cond - (keyword? color) - (case color - :dark styles/icon-dark-color - :gray styles/icon-gray-color - :blue styles/color-light-blue - :active styles/color-blue4 - :white styles/color-white - :red styles/icon-red-color - styles/icon-dark-color) - (string? color) - color - :else - styles/icon-dark-color)))) - (throw (js/Error. (str "Unknown icon: " name))))])) \ No newline at end of file + [svg (merge default-viewbox style)] + (icon-fn + (cond + (keyword? color) + (case color + :dark styles/icon-dark-color + :gray styles/icon-gray-color + :blue styles/color-light-blue + :active styles/color-blue4 + :white styles/color-white + :red styles/icon-red-color + styles/icon-dark-color) + (string? color) + color + :else + styles/icon-dark-color)))) + (throw (js/Error. (str "Unknown icon: " name))))])) diff --git a/src/status_im/ui/screens/chats_list/views.cljs b/src/status_im/ui/screens/chats_list/views.cljs index 0ebfd955c4..b734cec252 100644 --- a/src/status_im/ui/screens/chats_list/views.cljs +++ b/src/status_im/ui/screens/chats_list/views.cljs @@ -61,12 +61,13 @@ :search-placeholder (i18n/label :t/search-for)}])) (defn chats-action-button [] - [native-action-button {:button-color color-blue - :offset-x 16 - :offset-y 40 - :spacing 13 - :hide-shadow true - :on-press #(re-frame/dispatch [:navigate-to :new-chat])}]) + [native-action-button {:button-color color-blue + :offset-x 16 + :offset-y 40 + :spacing 13 + :hide-shadow true + :accessibility-label :plus-button + :on-press #(re-frame/dispatch [:navigate-to :new-chat])}]) (defn chat-list-item [[chat-id chat] edit?] [react/touchable-highlight {:on-press #(re-frame/dispatch [:navigate-to :chat chat-id])} diff --git a/src/status_im/ui/screens/contacts/views.cljs b/src/status_im/ui/screens/contacts/views.cljs index 7379dae0e4..95663a9ba0 100644 --- a/src/status_im/ui/screens/contacts/views.cljs +++ b/src/status_im/ui/screens/contacts/views.cljs @@ -109,9 +109,10 @@ :hide-shadow true :spacing 13} [native-action-button-item - {:title (label :t/new-contact) - :buttonColor :#9b59b6 - :onPress #(dispatch [:navigate-to :new-contact])} + {:title (label :t/new-contact) + :accessibility-label :new-contact + :buttonColor :#9b59b6 + :onPress #(dispatch [:navigate-to :new-contact])} [ion-icon {:name :md-create :style create-icon}]]]) diff --git a/src/status_im/ui/screens/group/edit_contacts/views.cljs b/src/status_im/ui/screens/group/edit_contacts/views.cljs index af6159d089..c62f83b238 100644 --- a/src/status_im/ui/screens/group/edit_contacts/views.cljs +++ b/src/status_im/ui/screens/group/edit_contacts/views.cljs @@ -42,10 +42,11 @@ (defn contact-extended-options [group-id] (fn [item] - [{:value #(dispatch [:remove-contact-from-group - (:whisper-identity item) - group-id]) - :text (label :t/remove-from-group)}])) + [{:value #(dispatch [:remove-contact-from-group + (:whisper-identity item) + group-id]) + :accessibility-label :remove-button + :text (label :t/remove-from-group)}])) (defview edit-chat-group-contact-list [] (letsubs [chat-name [:chat :name] @@ -69,9 +70,8 @@ (contact-extended-options group-id)])) (defview edit-contact-group-contact-list [] - (letsubs [group [:get-contact-group] - type [:get-group-type]] + (letsubs [group [:get-contact-group]] [view styles/group-container [status-bar] [contact-list-toolbar (:name group)] - [contacts-list-view (:group-id group)]])) \ No newline at end of file + [contacts-list-view (:group-id group)]]))