-
Notifications
You must be signed in to change notification settings - Fork 987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add contact code/topic validation #4752
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tend to keep styling in styles.cljs
files, instead of inlining, but otherwise shared codebase looks ok
(fn [topic] | ||
(when-not (spec/valid? ::db/topic topic) | ||
"Group topic error"))) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra line at the end-of-file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice PR vitaliy! changes look good. in response to your comment about the popups not working, were you trying with the one in status-im.utils.utils
or somewhere else? That one was able to work locally for me but I'm not sure if that would address your needs in this PR.
[cljs.spec.alpha :as spec])) | ||
|
||
(re-frame/reg-sub | ||
:new-topic-error-message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an interesting use of a subscription, to check a schema against the actual data 🤔 cool stuff!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rcullito thanks for the pointer to show-popup
in utils.utils
! Unfortunately this is an alert-based popup, and we'd want to have multi-item clickable popups, more like proper context menus.
(for [c contacts] | ||
^{:key (:whisper-identity c)} | ||
[react/touchable-highlight {:on-press #(do | ||
(re-frame/dispatch [:set :contacts/new-identity (:whisper-identity c)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might this PR also fix #4276? these remind me of the updated handlers that Andrea was mentioning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that's one of the handlers you can use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, thanks
Added separate styles ns. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use our clojure style guide , for example maps values should be aligned , etc, all styles maps should be moved to styles ns, use i18n for labels
:<- [:get :public-group-topic] | ||
(fn [topic] | ||
(when-not (spec/valid? ::db/topic topic) | ||
"Group topic error"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n
@@ -0,0 +1,58 @@ | |||
(ns status-im.ui.screens.desktop.main.add-new.styles) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong file formatting
[react/view {:style {:height 90 :margin-horizontal 16 :margin-bottom 16 :background-color :white :border-radius 12}} | ||
;:box-shadow "0 0.5px 4.5px 0 rgba(0, 0, 0, 0.04)"}} | ||
[react/view {:style {:flex-direction :row :margin-horizontal 16 :margin-top 16}} | ||
contacts [:all-added-people-contacts] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong formatting
^{:key "newcontact"} | ||
[react/view {:style styles/new-contact-title} | ||
[react/text {:style styles/new-contact-title-text} | ||
"New Chat"]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n
@@ -70,4 +75,16 @@ | |||
[react/touchable-highlight {:on-press #(when-not topic-error (re-frame/dispatch [:create-new-public-chat topic]))} | |||
[react/view {:style (merge styles/add-contact-button {:background-color (if topic-error "#eef2f5" "#4360df") })} | |||
|
|||
[react/text {:style (merge styles/add-contact-button-text {:color (if topic-error "#939ba1" :white)})} "Join public chat"]]]]]])) | |||
[react/text {:style (merge styles/add-contact-button-text {:color (if topic-error "#939ba1" :white)})} "Join public chat"]]]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
topic-error
here and above can be passed as an argument to style to make all color decision in styles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, great point, fixed!
|
@siphiuel I can still see the old styles in the latest jenkins bundle https://jenkins.status.im/job/status-react/job/desktop/job/pull-requests/job/PR-4822/11/# |
@EugeOrtiz yes, you should download it from particular PR build, in this case https://jenkins.status.im/job/status-react/job/desktop/job/pull-requests/view/change-requests/job/PR-4752/ |
Used labels from i18n, aligned maps properly. |
@@ -26,7 +27,7 @@ | |||
[react/view {:style tabs.styles/tab-container} | |||
(let [icon (if active? icon-active icon-inactive)] | |||
[react/view | |||
[icons/icon icon {:color (:color (tabs.styles/tab-icon active?))}]]) | |||
[icons/icon icon {:style {:tint-color (if active? "#4360df" "#6e777e")}}]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@siphiuel, probably here we also should use colors namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vkjr I thought you wouldn't notice :) Fixed.
@@ -5,11 +5,12 @@ | |||
[clojure.string :as string])) | |||
|
|||
(defn- validate-pub-key [whisper-identity {:keys [address public-key]}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure about this change, how it affects mobile version
List of UI/UX bug/fixes regarding this issue: GENERAL
NEW 1:1 CHAT
NEW PUBLIC CHAT
|
@Maxris |
OMG, yes! :) Sorry |
0169e29
to
c15cf73
Compare
Issues 1, 5, 8, 9 resolved. |
So, only 2 small things and I'll move it to ready! |
Some styling changes Add topic validation Wrap add-contact screen into scroll-view Improve chat list according to design Add color to tab icons Add color to add-contact icon Missing paren added Add background color to inputs in add-new screen Fix timestamp styling Remove extra empty line Move styles to separate ns Add styles for New Contact screen Add selected topics; improve chat item display Use colors from colors ns; style fns Fix formatting, add styles Use colors ns for tab selection buttons Use setNativeProps to force hash as first symbol in topic name Add :no-messages-yet label Alignment fixes in chat list Add timestamp style, disable 'add chat' buttons if no valid data Use color from chat-item map Formatting Use generic default-public-chats value Use proper last-message timestamp Fix '#' placeholder issues in public chat name field Fix timestamp sizing in chat list Add unviewed messages indicator Use proper chat name Fix double hash in public chat name Fix separator margin
571985e
to
9af908b
Compare
Issues 5 and 14 are related to #5104 |
Item 12 and corresponding issue #5070 fixed |
Fix #4250, #4281, #4434
This PR adds contact code/topic validation, and design changes to add contact screen and chat list. Also add contact and tab selection buttons have been updated to look according to the design.
There are some design issues:
TextInput issues react-native-desktop-qt#255(resolved with TextInput got backgroundColor and fontSize properties react-native-desktop-qt#261) and Text component: ellipsizeMode issue react-native-desktop-qt#264according to https://zpl.io/aBElz8L, we also need to implement on-hover event handler (Implement on-hover events and cursor shapes react-native-desktop-qt#257)(decided to postpone it for now)Design links: zpl.io/2ZgvMKw, https://zpl.io/aRqj4dv