-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Signup: Fix Themes step horizontal scroll #11299
Signup: Fix Themes step horizontal scroll #11299
Conversation
FWIW, to activate the
|
'theme-selection__themes-wrapper': true, | ||
'is-hidden': this.state.showPressable, | ||
} ); | ||
let headerText = translate( 'Choose a theme.' ); |
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 think we'd prefer to avoid the use of let
in favor of const
if possible.
In this case:
const headerText = this.state.showPressable ? "...?" : "...!";
// etc.
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 did it with the shorthand if
syntax and const
, but didn't look very nice and wasn't very obvious what was happening there:
const headerText = this.state.showPressable
? translate( 'Upload your WordPress Theme' )
: translate( 'Choose a theme.' );
const subHeaderText = this.state.showPressable
? translate( 'Our partner Pressable is here to help you' )
: translate( 'No need to overthink it. You can always switch to a different theme later.' );
versus:
let headerText = translate( 'Choose a theme.' );
let subHeaderText = translate( 'No need to overthink it. You can always switch to a different theme later.' );
if ( this.state.showPressable ) {
headerText = translate( 'Upload your WordPress Theme' );
subHeaderText = translate( 'Our partner Pressable is here to help you' );
}
I think the second one is better for readability if you're quickly skimming through the code and I don't think let
/const
would make a huge difference in terms of performance here :)
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 did get an error in the console on the page where I had to enter the user details:
vendor.development.js?v=9278c344b7:3350 Warning: `value` prop on `input` should not be null. Consider using the empty string to clear the component or `undefined` for uncontrolled components.
in input (created by FormTextInput)
in FormTextInput (created by SignupForm)
in fieldset (created by FormFieldset)
in FormFieldset (created by ValidationFieldset)
in ValidationFieldset (created by SignupForm)
in div (created by SignupForm)
in form (created by LoggedOutForm)
in div (created by Card)
in Card (created by LoggedOutForm)
in LoggedOutForm (created by SignupForm)
in div (created by SignupForm)
in SignupForm (created by UserStep)
in div (created by StepWrapper)
in div (created by StepWrapper)
in StepWrapper (created by UserStep)
in UserStep (created by LocalizedUserStep)
in LocalizedUserStep (created by Connect(LocalizedUserStep))
in Connect(LocalizedUserStep) (created by Signup)
in div (created by Signup)
in ReactCSSTransitionGroupChild (created by ReactTransitionGroup)
in span (created by ReactTransitionGroup)
in ReactTransitionGroup (created by ReactCSSTransitionGroup)
in ReactCSSTransitionGroup (created by Signup)
in span (created by Signup)
in Signup (created by Connect(Signup))
in Connect(Signup)
in Provider
And then, when submitting the form:
vendor.development.js?v=9278c344b7:3350 Warning: FormTextInput is changing an uncontrolled input of type email to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components
vendor.development.js?v=9278c344b7:3350 Warning: Failed prop type: Invalid prop `user` of type `boolean` supplied to `SignupProcessingScreen`, expected `object`.
in SignupProcessingScreen (created by Signup)
in Signup (created by Connect(Signup))
in Connect(Signup)
in Provider
vendor.development.js?v=9278c344b7:3350 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the SignupForm component.
And then, on the front-end after seeing Trampoline:
bootstrap 43c1d8f…:9 Uncaught TypeError: Cannot read property 'type' of undefinedh @ bootstrap 43c1d8f…:9(anonymous function) @ bootstrap 43c1d8f…:9(anonymous function) @ bootstrap 43c1d8f…:9n @ bootstrap 43c1d8f…:16h @ bootstrap 43c1d8f…:16d @ bootstrap 43c1d8f…:16
Then again I also get all of these on master
. This PR doesn't seem to add any problems.
I confirm there's no horizontal scroll bar in the themes step. Clicking "Upload Theme" works, and going back as well.
Apart from the one comment I left regarding let
vs. const
: LGTM! 🚢
Thanks for the update! 👍 |
client/signup/step-wrapper/index.jsx
Outdated
@@ -14,7 +14,14 @@ import config from 'config'; | |||
export default React.createClass( { | |||
displayName: 'StepWrapper', | |||
|
|||
propTypes: { | |||
hideNavButtons: React.PropTypes.bool |
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.
Drive-by comment: shouldHideNav[Buttons]
@@ -66,13 +66,34 @@ class ThemeSelectionStep extends Component { | |||
}; | |||
|
|||
renderThemesList() { | |||
const pressableWrapperClassName = classNames( { | |||
'theme-selection__pressable-wrapper': 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.
If this key is always true I think classnames allows single strings as arguments. Also, check which is more common in calypso: classnames or classNames
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.
344 classNames(
106 classnames(
} ); | ||
|
||
const themesWrapperClassName = classNames( { | ||
'theme-selection__themes-wrapper': 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.
Same applies here
<div className="theme-selection__pressable-substep-wrapper"> | ||
<div className={ pressableWrapperClassName }> | ||
<PressableThemeStep | ||
{ ... this.props } |
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.
Remove space after ellipsis
const { translate } = this.props; | ||
const subHeaderText = this.state.showPressable | ||
? translate( 'Our partner Pressable is here to help you' ) | ||
: translate( 'No need to overthink it. You can always switch to a different theme 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.
Maybe add context for translators. The other strings may not need it, but this one probably does.
? translate( 'Our partner Pressable is here to help you', { | ||
context: 'Subheader text in Signup, when a user chooses the Upload theme in the Themes step' | ||
} ) | ||
: translate( 'No need to overthink it. You can always switch to a different theme 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.
Hi! I've found a possible matching string that has already been translated 22 times:
translate( 'No need to overthink it. You can always switch to a different theme later.' )
ES Score: 14.48
See 2 additional suggestions in the PR translation status page
Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).
|
||
const { translate } = this.props; | ||
const subHeaderText = this.state.showPressable | ||
? translate( 'Our partner Pressable is here to help you', { |
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.
Hi! I've found a possible matching string that has already been translated 18 times:
translate( 'Our partner Pressable is here to help you' )
ES Score: 13.91
See 1 additional suggestion in the PR translation status page
Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).
This PR is a fix for #8745.
The Pressable "substeps" in Signup break the design a bit by being shifted to the side. Even though they are hidden, they still expand the bounding box and cause the scroll.
I'm trying to make the substeps play nice with the main steps and not cause such problems.
To test:
Upload theme
option is working correctlyNote:
After starting signup, you need to get yourself in the Theme Upload AB test, as @lsinger mentioned below: