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

feature: ModalSocialShare #1943

Merged
merged 1 commit into from
Sep 13, 2018
Merged

feature: ModalSocialShare #1943

merged 1 commit into from
Sep 13, 2018

Conversation

jessopb
Copy link
Member

@jessopb jessopb commented Sep 7, 2018

Resubmitted after verifying the bug I was worried about was due to redux lacking my MODAL constant.

This was closely modeled after the modalSendTip and walletSendTip components.
It should shares either anonymous and channel-based spee.ch links
Sharing is available only if the content meets shareable criteria.
It uses share urls from http://www.sharelinkgenerator.com/ to share to Facebook, Twitter, and Google Plus.

There are some improvements that could be made:

  • feathericons has no actual google-plus icon, I think
  • it could share a tinyurl version
  • the formatting and spacing could be better
  • the mouseover tooltips could be more responsive: they seem to give up sometimes - ideas?
  • the link could come preselected, rather than wait for a click in the text field
  • the modal could give feedback that the link copy was successful: 'link copied to clipboard'
  • it could close the modal when clicking the background or pressing esc
    Also, the ViewOnWebButton component is apparently no longer in use.

I look forward to more guidance in these areas.

@neb-b
Copy link

neb-b commented Sep 7, 2018

Awesome! I'll give this a test and review the code in a bit. Thanks for the contribution! 🙂

Copy link

@neb-b neb-b left a comment

Choose a reason for hiding this comment

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

This is looking great!

Additional comments:
Clicking off the modal doesn't close it.

  • This should happen by default, maybe look at other modals to see if you are doing anything different.

I think we should create a new component to avoid having duplicate code in two spots.

For the tooltip issue I'm guessing you will need to add something with overflow: visible so it can extend beyond the modal screen.

clipboard.writeText(speechURL);
}}
/>
</FormRow>
Copy link

Choose a reason for hiding this comment

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

Since the above code is pretty much identical to the Address component at component/address/view.jsx we should probably break this into it's own component.

Maybe CopyableInput?

I'm only talking about everything inside of the FormRow. It would just need two props (I think), value and copySuccessMessage (for the snackbar after you copy it)

Copy link
Member Author

@jessopb jessopb Sep 7, 2018

Choose a reason for hiding this comment

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

I originally tried to use <Address /> and it crashed at that point. Using <Address /> now has the odd behavior that it doesn't show the snackbar until after the modal is closed (modal over modal?). I will need to really look into how doNotify on top of doNotify works. Perhaps it's putting the next notification in a queue that doesn't get activated until my modal is closed?

If so, taking doNotify functionality out of Address and making it an optional passed prop might be best?

Copy link

Choose a reason for hiding this comment

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

Ah you are right. I forgot about that. I just created an issue for it.
#1945

I'm fine with passing in a prop for now to disable this (it should default to notify) for now. Just include a link to this issue #1945 in a comment above it.

We should probably rename the Address component if we are going to use it here.

button="alt"
label={__('')}
href={`https://plus.google.com/share?url=${speechURL}`}
/>
Copy link

Choose a reason for hiding this comment

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

I don't think we need google plus, especially since we don't have an icon for it.

/>
</FormRow>
</div>
<div className="card__content">
Copy link

Choose a reason for hiding this comment

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

This should be card__actions. It should give the buttons proper spacing.

@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Sep 7, 2018
@jessopb
Copy link
Member Author

jessopb commented Sep 8, 2018

Ok, I think it's ready to be looked at again.

I'm hesitant to mess too much with <Address>, but I added a temporary noSnackbar bool to it (3 ways until the linter stopped complaining). With my change, The wallet copy button throws the snackbar, but the modal copy button does not. Renaming <Address> I think is a change with its own scope?

Messing with Z-index and overflow (and size) in scss for .tooltip_body didn't do anything to help the tooltip clipping. For now I'd like to center it and figure out how to make tooltips play with modals later.

I made the remaining changes of removing google_plus, making the modal close on esc, and changing the style className for better spacing on the buttons.

modalsharecropped

I hate how many steps it is to change a commit message;
commit message for 434c is supposed to use "bool" not "binary"

@neb-b
Copy link

neb-b commented Sep 8, 2018

I'm ok with the centering of buttons for now. I do they they should be on the bottom though. I'll give this another test/better look tomorrow.

@neb-b
Copy link

neb-b commented Sep 8, 2018

This looks good. I think once the share buttons are moved below the address component this can be merged.

@jessopb
Copy link
Member Author

jessopb commented Sep 8, 2018

ssa
ssb

Which do you like better?

@jessopb
Copy link
Member Author

jessopb commented Sep 8, 2018

Should be set.

@neb-b
Copy link

neb-b commented Sep 10, 2018

@kauffj I like the top one more, it is more consistent with other modals in the app. Also I don't think we need the : in the title

@jessopb
Copy link
Member Author

jessopb commented Sep 11, 2018

This seems to match the sendTip modal best: Green buttons are actions, link buttons are exits.
socialsharee

If you let me know a final opinion on the following, I'll make the changes and push them.

Heading:

  • Share this content
  • other preferred text and capitalization.

Share link buttons:

  • 'primary' (green), 'alt' (white)

Close button:

  • 'primary' (green), 'alt' (white), 'link' (text)
  • justify left, center

@neb-b
Copy link

neb-b commented Sep 12, 2018

Hey @jessopb. Sorry for the late reply.

I've been looking over the existing modals and the general pattern is that the title is left aligned and the buttons are both centered. The main button is normally green, but I think it's ok to keep it as just text since it's the close button.

I also think that the social buttons should be the same color as external links. Every link that opens the browser is that color so I think it makes sense if they were blue too.

@jessopb jessopb force-pushed the modals branch 2 times, most recently from 7092786 to 39d4e0a Compare September 12, 2018 16:44
@jessopb
Copy link
Member Author

jessopb commented Sep 12, 2018

The latest commit looks like this, adding an available blue stroke color to the Icon class.
modalsharelinks

@neb-b
Copy link

neb-b commented Sep 12, 2018

@jessopb This looks great. I will give it a better test later today.

@neb-b neb-b merged commit 1cd95f0 into lbryio:master Sep 13, 2018
@tzarebczan
Copy link
Contributor

Hey @jessopb, thanks again for another successful PR! We appreciate all the contributions, check out https://lbry.io/faq/tips :)

I've added you to our developer mailing list also :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants