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

On mobile, hide title if logo exists #629

Merged
merged 6 commits into from
May 3, 2018

Conversation

amyrlam
Copy link
Contributor

@amyrlam amyrlam commented May 3, 2018

Motivation

Resolves: #613

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

IS with this PR:

Mobile:
image

Tablet (no change):
image

Desktop (no change):
image


WAS:

Mobile:
image

Tablet (no change):
image

Desktop (no change):
image

Related PRs

It didn't seem like a docs update was necessary?

cc @yangshun @JoelMarcey

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

docusaurus-bot commented May 3, 2018

Deploy preview for docusaurus-preview ready!

Built with commit 8ce5f23

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

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.

Great work! The approach is sound. Please have a look at the comments and fix accordingly.

The test plan doesn't seem to match up with the PR and issue. Did you mix up the screenshots?

It would also be great to add screenshots of tablet and desktop resolutions to ensure that there are no regressions.

Lastly, tests are failing because of the formatting. Run Prettier first 😄

.headerTitle {
font-size: 17px;
}
.headerTitleHidden {
display: none !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is !important needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

headerTitleHidden is not a good name because it's only hidden on smaller widths. How about headerTitleWithLogo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, !important is needed here.

Renamed to headerTitleWithLogo.

@@ -218,6 +218,12 @@ class HeaderNav extends React.Component {
(env.translation.enabled
? this.props.language + '/versions.html'
: 'versions.html');
let headerClass;
if (siteConfig.headerIcon) {
headerClass="headerTitleHidden"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not standard JS style. Should use semicolons, single quotes and space around operators.

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider simplifying to:

const headerClass = siteConfig.headerIcon ? 'headerTitleHidden' : 'headerTitle';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I figured out how to use Prettier in VSCode and am now running yarn ci-check to check this before pushing to Circle CI. 📈

Changed to ternary, good suggestion 👍

@amyrlam amyrlam force-pushed the amy/mobile-header branch 2 times, most recently from 437c808 to a700f3f Compare May 3, 2018 17:18
@amyrlam
Copy link
Contributor Author

amyrlam commented May 3, 2018

The test plan doesn't seem to match up with the PR and issue. Did you mix up the screenshots?

Hey, I'm not sure what you mean. The screenshots aren't mixed up...but before the logo class had a display:none on mobile.

I added screenshots for tablet and desktop above in the PR summary.

It would be cool to add snapshot testing down the road, maybe with the task where I add some Jest tests? I'm familiar with Percy.io and it seems like Jest has the same capability.

@yangshun
Copy link
Contributor

yangshun commented May 3, 2018

I think I mixed up IS and WAS. My bad 😓. I usually write before and after, with before coming first. It's easier to read IMO.

@amyrlam
Copy link
Contributor Author

amyrlam commented May 3, 2018

That's a good point, I'll do WAS/IS next time.

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.

4 participants