Enhancement/9942 siwg woocommerce registration - #13233
Conversation
📚 Storybook for d18c9eb: 📦 Build files for d18c9eb:
🎭 Playwright reports for d18c9eb: |
|
Size Change: 0 B Total Size: 3.25 MB ℹ️ View Unchanged
|
tofumatt
left a comment
There was a problem hiding this comment.
Looks good, just a few comment tweaks and questions, but overall this seems good-to-go after the few issues mentioned are resolved/answered 👍🏻
| * `false` both when WooCommerce is inactive and when it is active but its | ||
| * own account-creation settings are closed. |
There was a problem hiding this comment.
| * `false` both when WooCommerce is inactive and when it is active but its | |
| * own account-creation settings are closed. | |
| * `false` when: | |
| * - WooCommerce is inactive | |
| * - when WooCommerce is active but account-creation in WooCommerce | |
| * is disabled. |
| breakpoint, | ||
| } ) { | ||
| return createInterpolateElement( message, { | ||
| a: showLink ? <Link key="link" href={ settingsURL } /> : <span />, |
There was a problem hiding this comment.
The key prop isn't needed here, from what I can see.
| a: showLink ? <Link key="link" href={ settingsURL } /> : <span />, | |
| a: showLink ? <Link href={ settingsURL } /> : <span />, |
| br: | ||
| breakpoint !== BREAKPOINT_SMALL ? ( | ||
| <br /> | ||
| ) : ( | ||
| // eslint-disable-next-line react/jsx-no-useless-fragment | ||
| <Fragment /> | ||
| ), | ||
| } ); |
There was a problem hiding this comment.
I know this was here before, but why not add a className to this <br /> tag and hide it with CSS instead on small screens? This is sort of odd, and will cause the internal markup of the text to change on screen size changes as well. A pure-CSS implementation would be better.
| const anyoneCanRegister = useSelect( ( select ) => | ||
| select( CORE_SITE ).getAnyoneCanRegister() | ||
| ); | ||
| const anyoneCanRegisterWooCommerce = useSelect( ( select ) => | ||
| select( CORE_SITE ).getAnyoneCanRegisterWooCommerce() | ||
| ); |
There was a problem hiding this comment.
Seems like this would make sense to build as a single, consolidated selector. Especially if we want to expand on the value later and not have to manage each setting.
| /** | ||
| * Checks if the registration is open. | ||
| * | ||
| * Checked here in the base class, rather than only in |
There was a problem hiding this comment.
There's redundant phrasing here 🙂
| * Checked here in the base class, rather than only in | |
| * Checked here rather than in |
| * that public static method on the subclass triggers a fatal | ||
| * "Cannot make non static method ... static" error, even though private | ||
| * methods aren't supposed to participate in override compatibility | ||
| * checks. PHP 8.1+ correctly excludes private methods from that check, | ||
| * but the plugin's floor is PHP 7.4. |
There was a problem hiding this comment.
| * that public static method on the subclass triggers a fatal | |
| * "Cannot make non static method ... static" error, even though private | |
| * methods aren't supposed to participate in override compatibility | |
| * checks. PHP 8.1+ correctly excludes private methods from that check, | |
| * but the plugin's floor is PHP 7.4. | |
| * that public static method on the subclass triggers a fatal | |
| * error, even though private methods aren't supposed to | |
| * participate in override compatibility checks. |
Summary
Related issue(s):
Allow customers to create an accountsetting #9942Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist