-
Notifications
You must be signed in to change notification settings - Fork 128
Fixes #4848 - Header Without text labels #4940
Fixes #4848 - Header Without text labels #4940
Conversation
At narrow widths, the buttons are above the shot title, which is not matching #4848 (comment) Am I confused about what this PR supposed to implement? |
@chenba Sorry for confusion, PR is WIP for narrow widths thats why 'Hold' in title. I created the PR to show how header is going to look with buttons without text and gather feedback if it's good to go ahead with this change. |
|
af93a5f
to
8db6018
Compare
072ddb7
to
cfbd159
Compare
@@ -21,7 +21,7 @@ exports.Header = function Header(props) { | |||
|
|||
exports.Header.propTypes = { | |||
hasLogo: PropTypes.bool, | |||
children: PropTypes.node.isRequired, | |||
children: PropTypes.node, |
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.
This addresses server warning in logs when Header doesn't have children
@@ -161,7 +157,7 @@ class EditableTitle extends React.Component { | |||
<input ref={(input) => this.textInput = input} | |||
className="shot-title-input" | |||
style={{minWidth: this.state.minWidth}} | |||
type="text" defaultValue={this.props.title} autoFocus="true" | |||
type="text" defaultValue={this.props.title} autoFocus={true} |
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.
Fixes warning in logs due to boolean value passed as string
padding-bottom: 8px; | ||
} | ||
@media (min-width: 1260px) { | ||
max-width: 500px; |
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.
Added explicit check to increase title width when window size is more than 1260. Without this check header layout for title width 500px, wraps around when window size is 1000px
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.
Use inline images instead of background images.
@include respond-to("large") { | ||
font-size: 32px; | ||
line-height: 39px; | ||
max-width: 250px; |
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.
@youwenliang As per spec, for large widths (~1000px) with 96px x 96px 7 buttons in header, leaves about 250px space for title with 28px padding on the right for edit icon shown on hover.
Title width changes to 500px as window size increase to > 1260px to show longer text title, will that work?
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.
sounds good to me.
static/css/frame.scss
Outdated
line-height: 20px; | ||
padding-bottom: 4px; | ||
@include respond-to("medium") { | ||
max-width: 200px; |
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.
Since we are wrapping our header, we can change this to 500px, will update
@punamdahiya Also I updated the toolbar icons here, use these instead: Not sure if the svg's color should be context-fill though since chenba brought up the high contrast mode issue. |
@chenba Our background-images not showing in high contast mode is an existing issue, the experience is better than what's in the PR as we are showing a border around the buttons, I will update PR to bring border back. Thanks |
Since we are making changes to the buttons, I think it's a good time to fix it. What's the problem with using inline images? |
Not a big fan of listing image file paths in js and would like to keep it in css as much as possible. If there are other options to make it high contrast mode accessible Iike updating svg file I would prefer that |
@youwenliang Toolbar icons are updated, please find screenshot of latest shot page |
@punamdahiya |
cfbd159
to
af9d1b8
Compare
thanks for sharing Mark, sadly these media queries are only supported in IE and edge , for Firefox on WHCM for now fallback seems to to use |
0320a45
to
44dc381
Compare
Sure, I can take a look. |
Thanks! will resolve conflicts and update. |
44dc381
to
035eec9
Compare
Done |
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.
Looking good overall 👍, couple minor things, see inline comments. Feel free to self-merge once you've addressed them.
UX feedback (this might belong in a separate bug):
The promo card looks a little bit cramped, when compared to the spacious elements in the rest of the shot page.
I don't understand why we're aggressively truncating the title and hiding expiry info below 1260px:
Slightly above 1260px:
Slightly below 1260px:
The full-width, centered toolbar palette looks sort of empty to me. What if we just leave the buttons right-aligned in the header, but shrink them to this size?
@@ -17,20 +17,20 @@ exports.HomePageHeader = class HomePageHeader extends React.Component { | |||
renderFxASignIn() { | |||
return ( | |||
this.props.isFirefox && this.props.isOwner ? | |||
<SignInButton isAuthenticated={this.props.hasFxa} initialPage="" /> : null | |||
<SignInButton isAuthenticated={this.props.hasFxa} initialPage="" | |||
staticLink={this.props.staticLink}/> : null |
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.
I've gotten used to seeing attributes vertically aligned if they have to wrap onto a second line, like:
<SignInButton isAuthenticated={this.props.hasFxa} initialPage=""
staticLink={this.props.staticLink}/>
I like how this approach differentiates indentation for child elements (2 spaces) versus attributes within an element. What do you think? If this sounds good to you, I think it'd be good to apply it to this patch.
Looks like the eslint react plugin has a rule for this: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
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.
makes sense, updated patch to align attribute with the first prop
</Localized>; | ||
<a className="nav-button icon-shots" title="My Shots" href="/shots" | ||
onClick={ this.onClickMyShots.bind(this) } tabIndex="0"> | ||
<img src={this.props.staticLink("/static/img/icon-shots.svg")} /> |
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.
Should these images have alt text? I'm not sure
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.
Not sure either, in share-button we have similar tags where img is embedded inside link and have omitted img alt in favor of title attribute on link. https://github.com/mozilla-services/screenshots/blob/master/server/src/share-buttons.js#L129
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.
Cool, we can leave it for now, and see if it triggers the a11y linter later
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.
We should add alt text to all of our images for a11y.
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.
Filed #4976 to take it up in Q4 with a11y bugs
@@ -107,4 +103,5 @@ exports.DeleteShotButton.propTypes = { | |||
confirmDeleteHandler: PropTypes.func, | |||
cancelDeleteHandler: PropTypes.func, | |||
isIcon: PropTypes.bool, | |||
staticLink: PropTypes.func, |
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.
Maybe staticLink should be defined in the base header, instead of being passed around, since it seems to be used in all the headers
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.
Slightly confused by above comment, by base header you mean inside header.js, am I missing something here?
static/css/frame.scss
Outdated
@include respond-to("large") { | ||
display: none; | ||
} | ||
@media (min-width: 1260px) { |
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.
Let's stick with the respond-to($size)
pattern, instead of using a media query directly. You can call this "extra-large".
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.
Done
static/css/frame.scss
Outdated
order: 0; | ||
} | ||
background-color: $white; | ||
border-bottom: 1px solid rgba(#000, 0.1); |
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.
Use $black, not #000
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.
Done
static/css/frame.scss
Outdated
max-width: 250px; | ||
padding-bottom: 8px; | ||
} | ||
@media (min-width: 1260px) { |
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.
Again, respond-to
, not @media
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.
Done
|
||
if (this.props.isOwner) { | ||
const highlight = this.state.highlightEditButton | ||
? <div className="edit-highlight" |
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.
Maybe we should replace this svg highlight with a separate highlighted-pen image (fine to do this in a followup bug)
@flodolo for localization changes are removal of strings, please review. Thanks |
035eec9
to
10d0c99
Compare
Updated promo card to align below header button bottom border. It’s hard to accommodate seven 96px sizes button for header width around 1000px, thats why have to hide expire-info for header width between 960px and 1260px which are the breakpoints for large and extra-large widths. |
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.
(removals are always fine)
10d0c99
to
b4abe49
Compare
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.
LGTM
No description provided.