diff --git a/src/syng_im/android/core.cljs b/src/syng_im/android/core.cljs index 329d9081e8..c2d44af2a6 100644 --- a/src/syng_im/android/core.cljs +++ b/src/syng_im/android/core.cljs @@ -11,7 +11,7 @@ [syng-im.chat.screen :refer [chat]] [syng-im.components.chats.chats-list :refer [chats-list]] [syng-im.components.chats.new-group :refer [new-group]] - [syng-im.participants.views.new :refer [new-participants]] + [syng-im.participants.views.create :refer [new-participants]] [syng-im.participants.views.remove :refer [remove-participants]] [syng-im.utils.logging :as log] [syng-im.utils.utils :refer [toast]] diff --git a/src/syng_im/components/chat/input/input_styles.cljs b/src/syng_im/chat/styles/input_styles.cljs similarity index 98% rename from src/syng_im/components/chat/input/input_styles.cljs rename to src/syng_im/chat/styles/input_styles.cljs index c5debbcafd..f282ad1fc5 100644 --- a/src/syng_im/components/chat/input/input_styles.cljs +++ b/src/syng_im/chat/styles/input_styles.cljs @@ -1,4 +1,4 @@ -(ns syng-im.components.chat.input.input-styles +(ns syng-im.chat.styles.input (:require [syng-im.components.styles :refer [font color-white color-blue diff --git a/src/syng_im/components/chat/plain_message_input_styles.cljs b/src/syng_im/chat/styles/plain_input.cljs similarity index 94% rename from src/syng_im/components/chat/plain_message_input_styles.cljs rename to src/syng_im/chat/styles/plain_input.cljs index 01b90f2bf8..944d9f0c63 100644 --- a/src/syng_im/components/chat/plain_message_input_styles.cljs +++ b/src/syng_im/chat/styles/plain_input.cljs @@ -1,4 +1,4 @@ -(ns syng-im.components.chat.plain-message-input-styles +(ns syng-im.chat.styles.plain-input (:require [syng-im.components.styles :refer [font text2-color color-white diff --git a/src/syng_im/components/chat/suggestions_styles.cljs b/src/syng_im/chat/styles/suggestions.cljs similarity index 95% rename from src/syng_im/components/chat/suggestions_styles.cljs rename to src/syng_im/chat/styles/suggestions.cljs index 80ae964e68..c6a7f959b2 100644 --- a/src/syng_im/components/chat/suggestions_styles.cljs +++ b/src/syng_im/chat/styles/suggestions.cljs @@ -1,4 +1,4 @@ -(ns syng-im.components.chat.suggestions-styles +(ns syng-im.chat.styles.suggestions (:require [syng-im.components.styles :refer [font color-white]])) (def suggestion-item-container diff --git a/src/syng_im/components/chat/input/simple_command.cljs b/src/syng_im/chat/views/command.cljs similarity index 93% rename from src/syng_im/components/chat/input/simple_command.cljs rename to src/syng_im/chat/views/command.cljs index 53982f762a..c77ef93de8 100644 --- a/src/syng_im/components/chat/input/simple_command.cljs +++ b/src/syng_im/chat/views/command.cljs @@ -1,4 +1,4 @@ -(ns syng-im.components.chat.input.simple-command +(ns syng-im.chat.views.command (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] [syng-im.components.react :refer [view image @@ -7,7 +7,7 @@ text-input touchable-highlight]] [syng-im.resources :as res] - [syng-im.components.chat.input.input-styles :as st])) + [syng-im.chat.styles.input :as st])) (defn cancel-command-input [] (dispatch [:cancel-command])) diff --git a/src/syng_im/chat/views/confirmation_code.cljs b/src/syng_im/chat/views/confirmation_code.cljs new file mode 100644 index 0000000000..9e98fb9c46 --- /dev/null +++ b/src/syng_im/chat/views/confirmation_code.cljs @@ -0,0 +1,6 @@ +(ns syng-im.chat.views.confirmation-code + (:require + [syng-im.chat.views.command :refer [simple-command-input-view]])) + +(defn confirmation-code-input-view [command] + [simple-command-input-view command {:keyboardType :numeric}]) diff --git a/src/syng_im/chat/views/money.cljs b/src/syng_im/chat/views/money.cljs new file mode 100644 index 0000000000..7166476cf0 --- /dev/null +++ b/src/syng_im/chat/views/money.cljs @@ -0,0 +1,9 @@ +(ns syng-im.chat.views.money + (:require + [syng-im.chat.views.command :refer [simple-command-input-view]] + [syng-im.chat.styles.input :as st])) + +(defn money-input-view [command] + [simple-command-input-view command + {:keyboardType :numeric + :style st/money-input}]) diff --git a/src/syng_im/chat/views/new_message.cljs b/src/syng_im/chat/views/new_message.cljs index 75c28662e0..988e0de9d6 100644 --- a/src/syng_im/chat/views/new_message.cljs +++ b/src/syng_im/chat/views/new_message.cljs @@ -2,13 +2,13 @@ (:require [re-frame.core :refer [subscribe]] [syng-im.components.react :refer [view]] - [syng-im.components.chat.plain-message-input :refer [plain-message-input-view]] - [syng-im.components.chat.input.simple-command :refer [simple-command-input-view]] - [syng-im.components.chat.input.phone :refer [phone-input-view]] - [syng-im.components.chat.input.password :refer [password-input-view]] - [syng-im.components.chat.input.confirmation-code :refer [confirmation-code-input-view]] - [syng-im.components.chat.input.money :refer [money-input-view]] - [syng-im.components.chat.input.simple-command-staged :refer [simple-command-staged-view]] + [syng-im.chat.views.plain-input :refer [plain-message-input-view]] + [syng-im.chat.views.command :refer [simple-command-input-view]] + [syng-im.chat.views.phone :refer [phone-input-view]] + [syng-im.chat.views.password :refer [password-input-view]] + [syng-im.chat.views.confirmation-code :refer [confirmation-code-input-view]] + [syng-im.chat.views.money :refer [money-input-view]] + [syng-im.chat.views.staged-command :refer [simple-command-staged-view]] [syng-im.chat.styles.message :as st])) (defn staged-command-view [stage-command] diff --git a/src/syng_im/components/chat/input/password.cljs b/src/syng_im/chat/views/password.cljs similarity index 62% rename from src/syng_im/components/chat/input/password.cljs rename to src/syng_im/chat/views/password.cljs index 8385fa2c1c..253464ce0c 100644 --- a/src/syng_im/components/chat/input/password.cljs +++ b/src/syng_im/chat/views/password.cljs @@ -1,6 +1,6 @@ -(ns syng-im.components.chat.input.password +(ns syng-im.chat.views.password (:require - [syng-im.components.chat.input.simple-command + [syng-im.chat.views.command :refer [simple-command-input-view]])) (defn password-input-view [command] diff --git a/src/syng_im/components/chat/input/phone.cljs b/src/syng_im/chat/views/phone.cljs similarity index 63% rename from src/syng_im/components/chat/input/phone.cljs rename to src/syng_im/chat/views/phone.cljs index 267178e382..20b7c756ac 100644 --- a/src/syng_im/components/chat/input/phone.cljs +++ b/src/syng_im/chat/views/phone.cljs @@ -1,6 +1,6 @@ -(ns syng-im.components.chat.input.phone +(ns syng-im.chat.views.phone (:require - [syng-im.components.chat.input.simple-command + [syng-im.chat.views.command :refer [simple-command-input-view]])) (defn phone-input-view [command] diff --git a/src/syng_im/components/chat/plain_message_input.cljs b/src/syng_im/chat/views/plain_input.cljs similarity index 89% rename from src/syng_im/components/chat/plain_message_input.cljs rename to src/syng_im/chat/views/plain_input.cljs index f90fa057cc..ec8a88672b 100644 --- a/src/syng_im/components/chat/plain_message_input.cljs +++ b/src/syng_im/chat/views/plain_input.cljs @@ -1,11 +1,11 @@ -(ns syng-im.components.chat.plain-message-input +(ns syng-im.chat.views.plain-input (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] [syng-im.components.react :refer [view icon touchable-highlight text-input]] - [syng-im.components.chat.suggestions :refer [suggestions-view]] - [syng-im.components.chat.plain-message-input-styles :as st])) + [syng-im.chat.views.suggestions :refer [suggestions-view]] + [syng-im.chat.styles.plain-input :as st])) (defn set-input-message [message] (dispatch [:set-chat-input-text message])) diff --git a/src/syng_im/components/chat/input/simple_command_staged.cljs b/src/syng_im/chat/views/staged_command.cljs similarity index 90% rename from src/syng_im/components/chat/input/simple_command_staged.cljs rename to src/syng_im/chat/views/staged_command.cljs index a2e0b571ee..c7a0b50568 100644 --- a/src/syng_im/components/chat/input/simple_command_staged.cljs +++ b/src/syng_im/chat/views/staged_command.cljs @@ -1,11 +1,11 @@ -(ns syng-im.components.chat.input.simple-command-staged +(ns syng-im.chat.views.staged-command (:require [re-frame.core :refer [subscribe dispatch]] [syng-im.components.react :refer [view image text touchable-highlight]] [syng-im.resources :as res] - [syng-im.components.chat.input.input-styles :as st])) + [syng-im.chat.styles.input :as st])) (defn cancel-command-input [staged-command] (dispatch [:unstage-command staged-command])) diff --git a/src/syng_im/components/chat/suggestions.cljs b/src/syng_im/chat/views/suggestions.cljs similarity index 62% rename from src/syng_im/components/chat/suggestions.cljs rename to src/syng_im/chat/views/suggestions.cljs index b1bbd0d75e..97461c2741 100644 --- a/src/syng_im/components/chat/suggestions.cljs +++ b/src/syng_im/chat/views/suggestions.cljs @@ -1,6 +1,6 @@ -(ns syng-im.components.chat.suggestions +(ns syng-im.chat.views.suggestions (:require-macros - [natal-shell.core :refer [with-error-view]]) + [natal-shell.core :refer [with-error-view]]) (:require [re-frame.core :refer [subscribe dispatch]] [syng-im.components.react :refer [view text @@ -8,20 +8,21 @@ list-view list-item]] [syng-im.utils.listview :refer [to-datasource]] - [syng-im.components.chat.suggestions-styles :as st])) + [syng-im.chat.styles.suggestions :as st])) (defn set-command-input [command] (dispatch [:set-chat-command command])) -(defn suggestion-list-item [suggestion] +(defn suggestion-list-item + [{:keys [description command] + label :text + :as suggestion}] [touchable-highlight - {:onPress #(set-command-input (keyword (:command suggestion)))} + {:onPress #(set-command-input (keyword command))} [view st/suggestion-item-container [view (st/suggestion-background suggestion) - [text {:style st/suggestion-text} - (:text suggestion)]] - [text {:style st/suggestion-description} - (:description suggestion)]]]) + [text {:style st/suggestion-text} label]] + [text {:style st/suggestion-description} description]]]) (defn render-row [row _ _] (list-item [suggestion-list-item (js->clj row :keywordize-keys true)])) @@ -32,7 +33,7 @@ (let [suggestions @suggestions-atom] (when (seq suggestions) [view (st/suggestions-container suggestions) - [list-view {:dataSource (to-datasource suggestions) + [list-view {:dataSource (to-datasource suggestions) :enableEmptySections true - :renderRow render-row - :style {}}]]))))) + :renderRow render-row + :style {}}]]))))) diff --git a/src/syng_im/components/chat/input/confirmation_code.cljs b/src/syng_im/components/chat/input/confirmation_code.cljs deleted file mode 100644 index 7ba41043d6..0000000000 --- a/src/syng_im/components/chat/input/confirmation_code.cljs +++ /dev/null @@ -1,7 +0,0 @@ -(ns syng-im.components.chat.input.confirmation-code - (:require - [syng-im.components.chat.input.simple-command - :refer [simple-command-input-view]])) - -(defn confirmation-code-input-view [command] - [simple-command-input-view command {:keyboardType :numeric}]) diff --git a/src/syng_im/components/chat/input/money.cljs b/src/syng_im/components/chat/input/money.cljs deleted file mode 100644 index be53c5dbc2..0000000000 --- a/src/syng_im/components/chat/input/money.cljs +++ /dev/null @@ -1,10 +0,0 @@ -(ns syng-im.components.chat.input.money - (:require - [syng-im.components.chat.input.simple-command - :refer [simple-command-input-view]] - [syng-im.components.chat.input.input-styles :as st])) - -(defn money-input-view [command] - [simple-command-input-view command - {:keyboardType :numeric - :style st/money-input}]) diff --git a/src/syng_im/participants/views/new.cljs b/src/syng_im/participants/views/create.cljs similarity index 97% rename from src/syng_im/participants/views/new.cljs rename to src/syng_im/participants/views/create.cljs index f5073a7879..38729add4b 100644 --- a/src/syng_im/participants/views/new.cljs +++ b/src/syng_im/participants/views/create.cljs @@ -1,4 +1,4 @@ -(ns syng-im.participants.views.new +(ns syng-im.participants.views.create (:require [re-frame.core :refer [subscribe dispatch]] [syng-im.resources :as res] [syng-im.components.react :refer [view]]