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

Enhance footer with Facebook and Twitter buttons #666

Merged
merged 9 commits into from
May 18, 2018

Conversation

endiliey
Copy link
Contributor

@endiliey endiliey commented May 16, 2018

Motivation

This feature/enhancement was requested in #218 .

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

cd website
npm run start

Test 4 cases by tweaking siteConfig.js:

  1. With facebook & twitter (facebookAppId & twitterId exist)

footer-all

  1. No facebook & twitter (facebookAppId & twitterId does not exist)

footer-no-fb-no-twitter

  1. No facebook (facebookAppId does not exist & twitterId exist)

footer-no-fb

4.. No twitter (facebookAppId exist & twitterId does not exist)
footer-no-twitter

Check updated docs for api siteconfig

  1. Remove docs from .npmignore
  2. Run the website
cd website
npm run start
  1. Latest doc at http://localhost:3000/docs/en/next/site-config.html

twitterid

twitterid-ex

Run test in root folder

npm test

test

Related Issues

#625 Facebook share dialog won't work if app is not set to public

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 16, 2018
@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented May 16, 2018

Deploy preview for docusaurus-preview ready!

Built with commit ac315a9

https://deploy-preview-666--docusaurus-preview.netlify.com

@yangshun yangshun changed the title enhance footer with facebook & twitter buttons Enhance footer with facebook and twitter buttons May 16, 2018
Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

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

Very nice work! There are a couple of minor issues which I have commented on. Could you have a look at them first?

@@ -154,6 +154,8 @@ h1 {

`twitter` - Set this to `true` if you want a Twitter social button to appear at the bottom of your blog posts.

`twitterId` - If you want a Twitter follow button in the footer, provide a twitter id to follow. For example: `docusaurus`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you change this to twitterUsername instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

The check for whether to load the Twitter buttons script in Site.js currently only looks at config.twitter. It should be changed to config.twitter || config.twitterUsername because some people might want the follow button but not the blog post Tweet button.

{props.config.projectName}
</a>
</div>
{props.config.twitterId ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

Use && for conditional rendering -

{props.config.twitterUsername && <div> ... </div>}

@yangshun yangshun changed the title Enhance footer with facebook and twitter buttons Enhance footer with Facebook and Twitter buttons May 16, 2018
@endiliey
Copy link
Contributor Author

endiliey commented May 16, 2018

@yangshun Thank you for the blazingly fast reply & suggestions. Changes added

Test plan:

  1. Remove docs from .npmignore
cd website
npm run start

siteConfig docs

1

2

If twitter is set to false, twitter footer still works
no-twitter-test

Edit: Update facebookAppId description
fbappid

Copy link
Contributor

@JoelMarcey JoelMarcey left a comment

Choose a reason for hiding this comment

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

This looks good. Thanks!

I had one comment.

const SocialFooter = props => (
<div>
<div>
<h5>GitHub</h5>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't need the headings. The social buttons are pretty self-describing in my opinion. I think it looks cleaner without them.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JoelMarcey
I am not really sure. I'll let you decide 😄
Here are some A-B testing (more like A-B-C) for you

No heading
no-heading

No heading with 5px top-bottom padding
no-header-5px

With heading
with-heading

Copy link
Contributor

Choose a reason for hiding this comment

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

I kinda like one of the first two better 😄

But, I am going to let a real UI person decide - what do you think @yangshun ?

Copy link
Contributor

Choose a reason for hiding this comment

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

The second one looks best to me! I do agree that the titles are kinda redundant, so the third is my least favorite. How do they look like on mobile?

Copy link
Contributor Author

@endiliey endiliey May 17, 2018

Choose a reason for hiding this comment

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

Simulated iphone X using the 2nd one

iphone x

Copy link
Contributor

Choose a reason for hiding this comment

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

That looks good to me. #2, then?

Copy link
Contributor Author

@endiliey endiliey May 17, 2018

Choose a reason for hiding this comment

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

PR commit updated using #2.
Extra thing to note is that the share dialog button won't work because the facebook app not being set to public.

App Not Setup: This app is still in development mode, and you don't have access to it.

Issue related is #625 . But after that issue is fixed, this will work as well.

I think we also need to update the doc on facebookAppId so that user will make sure to set their app to public (not development mode)

Copy link
Contributor

@JoelMarcey JoelMarcey left a comment

Choose a reason for hiding this comment

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

This looks good.

@yangshun Our app id in siteConfig.js isn't working, you say?

I will let you stamp this too.

Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

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

Woohoo! This looks great 😄

@yangshun yangshun merged commit f8521c2 into facebook:master May 18, 2018
@endiliey endiliey deleted the social-footer branch May 18, 2018 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants