Skip to content
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

Merged
merged 6 commits into from
Jul 9, 2018
Merged

Share contact code #4908

merged 6 commits into from
Jul 9, 2018

Conversation

vitvly
Copy link
Contributor

@vitvly vitvly commented Jun 22, 2018

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)

@vitvly vitvly added the desktop label Jun 22, 2018
@vitvly vitvly changed the base branch from develop to desktop June 22, 2018 11:08
@vitvly vitvly force-pushed the fix/4438-share-contact-code branch from 09cefcf to d0c80bc Compare June 25, 2018 13:54

(def qr-code-copy-text
{:font-size 16
:color colors/white})
Copy link
Member

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]]
Copy link
Member

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}]]
Copy link
Member

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)}
Copy link
Member

@flexsurfer flexsurfer Jun 26, 2018

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

Copy link
Member

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]]
Copy link
Member

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

@vitvly
Copy link
Contributor Author

vitvly commented Jun 26, 2018

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]]
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor

@rcullito rcullito left a 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]
Copy link
Contributor

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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.

@EugeOrtiz
Copy link

I cannot find how to see this in the latest builds, should I download a special one? Or click on something? 🤔

@maxhora
Copy link
Contributor

maxhora commented Jun 27, 2018

@EugeOrtiz you should check Jenkins build status for it (Click on Details for Jenkins check in the bottom of PR page), but since it's in failed state the build for this PR is not available yet.

@vitvly vitvly force-pushed the fix/4438-share-contact-code branch from 185cfc6 to 66091be Compare June 28, 2018 09:04
@vitvly vitvly force-pushed the fix/4438-share-contact-code branch from ed5a55f to 5631f7e Compare June 28, 2018 17:41
@churik
Copy link
Member

churik commented Jun 29, 2018

Screen (all issues are marked):
shareqr

  • (1) No QR is displayed
  • (2) After copying contact code no message "Copied to clipboard" (according to zpl.io/VxY83em )
  • (3) Text is not centered
  • (4, 5) Grey lines are displayed on top and bottom button edges; "Share my contact code" button is not centered.
  • (6) "Close" button is not working (is it not Modal component issues react-native-desktop-qt#258 ?)

@vitvly
Copy link
Contributor Author

vitvly commented Jun 29, 2018

1 - Weird, cannot reproduce.
3, 4, 5 - fixed
6 - yes, close button there is not functional because there is nothing to close (there is no modal)

@EugeOrtiz
Copy link

@churik some of your indications are also here #4986

@EugeOrtiz
Copy link

EugeOrtiz commented Jun 29, 2018

Adding:

  • "Share my contact code" button should be aligned in the center of the left panel:

captura de pantalla 2018-06-28 a la s 4 12 31 p m

  • Close icon ("X") shouldn't be displayed if it doesn't work.
  • Right panel should disappear (if it cannot be closed) when I navigate to "Home" tab.

Vitaliy Vlasov added 3 commits July 5, 2018 15:44
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
@vitvly vitvly force-pushed the fix/4438-share-contact-code branch from f692f1e to 4fd1c24 Compare July 5, 2018 17:05
@vitvly
Copy link
Contributor Author

vitvly commented Jul 6, 2018

#2 - added a tooltip that fades away after a couple of seconds
Removed close button.
Also changed profile view in order to address #4992 .
Right panel disappears when user navigates to a different tab.

@churik churik mentioned this pull request Jul 9, 2018
3 tasks
@churik
Copy link
Member

churik commented Jul 9, 2018

Created #5098, #5099

@vitvly vitvly merged commit 94df17e into desktop Jul 9, 2018
@rasom rasom deleted the fix/4438-share-contact-code branch September 3, 2018 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants