-
Notifications
You must be signed in to change notification settings - Fork 985
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
Share contact code #4908
Share contact code #4908
Conversation
09cefcf
to
d0c80bc
Compare
|
||
(def qr-code-copy-text | ||
{:font-size 16 | ||
:color colors/white}) |
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.
indentation
@@ -25,6 +29,34 @@ | |||
:ellipsizeMode :middle} | |||
value]]]]) | |||
|
|||
(views/defview qr-code [] | |||
(views/letsubs [current-account [:get-current-account]] |
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.
{:keys [public-key]} [:get-current-account]
[react/text {:style styles/qr-code-title} | ||
(string/replace (i18n/label :qr-code-public-key-hint) "\n" "")] | ||
[react/view {:style styles/qr-code} | ||
[qr-code-viewer/qr-code {:value public-key :size 130} #_{:style styles/qr-code}]] |
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.
could you remove commented part or add TODO
[qr-code-viewer/qr-code {:value public-key :size 130} #_{:style styles/qr-code}]] | ||
[react/text {:style styles/qr-code-text} | ||
public-key] | ||
[react/touchable-highlight {:on-press #(react/copy-to-clipboard 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.
better to move react/copy-to-clipboard
to effect, dispatch event and use custom fx in event
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.
views should be pure
@@ -38,7 +70,8 @@ | |||
[profile-badge current-account]] | |||
[react/view {:style {:height 1 :background-color "#e8ebec" :margin-horizontal 16}}] | |||
[react/view | |||
[my-profile-info current-account]] | |||
[share-contact-code] | |||
#_[my-profile-info current-account]] |
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 remove or add TODO
Thank you for review @flexsurfer ! I've made the requested changes, and moved the clipboard copy functionality to the custom fx handler. |
[react/view {:style styles/qr-code-copy} | ||
[react/text {:style styles/qr-code-copy-text} | ||
(i18n/label :copy-qr)]]]]]))) | ||
(views/letsubs [{:keys [public-key] :as current-account} [:get-current-account]] |
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.
but you don't use current-account
why do you need it? just wondering
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.
sorry, you're right, fixed it, thought it was referred to in the body of fn.
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 workaround for the modal issue vitaliy!
does desktop have any current working implementation that you've seen for this type of component, or are we all the way down to the popup?
|
||
(re-frame/reg-fx | ||
:copy-to-clipboard | ||
(fn [value] |
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.
is there any interceptor, etc, that causes the value to be the first parameter here instead of the event name?
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.
it's effect, not event https://github.com/Day8/re-frame/blob/master/docs/Effects.md#extensible-side-effects
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 I see. completely new effect being introduced. thanks for the link.
I cannot find how to see this in the latest builds, should I download a special one? Or click on something? 🤔 |
@EugeOrtiz you should check Jenkins build status for it (Click on |
185cfc6
to
66091be
Compare
ed5a55f
to
5631f7e
Compare
Screen (all issues are marked):
|
1 - Weird, cannot reproduce. |
Qr code copy window Copy code on-press handler Add profile styles Alignments, obsolete style removed Add qr code close icon Fix typo Add copy-to-clipboard event handler and fx Remove obsolete current-account binding Formatting Remove unneeded horizontal lines Center qr code text Center 'Share my contact code' button Add green 'Copied to clipboard' tooltip view
f692f1e
to
4fd1c24
Compare
Fix #4438 , #4992
This fix implements "Share contact code" window. Temporarily not in a modal, but in a right sidebar pane (due to status-im/react-native-desktop-qt#258)