-
-
Notifications
You must be signed in to change notification settings - Fork 828
Fixes a broken link and set margin around links on authentication dialog #8208
Conversation
Closes element-hq/element-web#21624 Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Codecov Report
@@ Coverage Diff @@
## develop #8208 +/- ##
===========================================
- Coverage 30.74% 29.82% -0.93%
===========================================
Files 892 875 -17
Lines 50681 50024 -657
Branches 12900 12727 -173
===========================================
- Hits 15584 14918 -666
- Misses 35097 35106 +9
|
@@ -614,8 +614,8 @@ export default class Registration extends React.Component<IProps, IState> { | |||
onServerConfigChange={this.state.doingUIAuth ? undefined : this.props.onServerConfigChange} | |||
/> | |||
{ this.renderRegisterComponent() } | |||
{ goBack } | |||
{ signIn } | |||
<div className="mx_AuthBody_link_goBack">{ goBack }</div> |
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.
The margins of mx_Dialog_buttons_items
will still be applied even when goBack
is falsy, creating a weird gap in the UI when we don't render a go back button.
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 guess you are talking about #8160?
{ goBack } | ||
{ signIn } | ||
<div className="mx_AuthBody_link_goBack">{ goBack }</div> | ||
<div className="mx_AuthBody_link_signIn">{ signIn }</div> |
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.
The margin styles you define for these wrappers can be added to the style of the signIn
and goBack
elements themselves - both use the class mx_AuthBody_changeFlow
It's unnecessary to introduce more wrapping elements.
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.
OK, I am going to fix the bug of the link with specifying additional rules. Actually You need a wrapper anyway, in order to place an inlined element at the center. There could be another way of achieving that, but it needs an unnecessarily complicated solution.mx_AuthBody_changeFlow
of those elements do nothing 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.
Addressed: dbdf83d
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.
Addressed: ca411f7.
TODO: margin setting. See below.
res/css/views/auth/_AuthBody.scss
Outdated
} | ||
|
||
.mx_AuthBody_link_goBack { | ||
margin: 12px auto 6px; |
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.
Please use the spacing variables for standard spacings https://github.com/matrix-org/matrix-react-sdk/blob/develop/res/css/_spacing.scss
res/css/views/auth/_AuthBody.scss
Outdated
@@ -94,6 +94,22 @@ limitations under the License. | |||
background-color: $authpage-focus-bg-color; | |||
} | |||
} | |||
|
|||
.mx_recaptchaContainer { | |||
.mx_recaptchaContainer_info, |
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.
mx_recaptchaContainer_info
is a specific selector, it does not need to be nested.
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.
Generally semantic specificity does not prevent unexpected visual regressions. Nesting should. It also should serve its function not only on large SASS files but also on tiny ones, as checking visual regressions for the latter is a difficult task if there is not an automated test available. Setting an insurance is better than leaving them vulnerable to possibility of the regressions. If you don't have a strong opinion against it, I would rather keep this nested until another element outside of it requires this.
{ this.state.errorText } | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<div ref={this.recaptchaContainer}> | ||
<p>{ _t( | ||
<div className="mx_recaptchaContainer" ref={this.recaptchaContainer}> |
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 prefix our classes with the component they are styling - so the classes you've added should be mx_CaptchaForm_recaptchaContainer
, mx_CaptchaForm_recaptchaContainerInfo
etc
This is explained a bit more in the css rules in the developer guide https://github.com/matrix-org/matrix-react-sdk/blob/develop/README.md#developer-guide
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.
Thanks for letting me know about that guide.
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.
Addressed: 9425477
res/css/views/auth/_AuthBody.scss
Outdated
@@ -94,6 +94,22 @@ limitations under the License. | |||
background-color: $authpage-focus-bg-color; | |||
} | |||
} | |||
|
|||
.mx_recaptchaContainer { |
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.
Components should have their own style files, since these classes are used in CaptchaForm
component they should be in _CaptchaForm.scss
. This helps keep our components independent and maintainable.
Please move these into the correct file (and don't forget to run yarn rethemendex
when adding new scss files)
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.
Addressed: 42874a9
As long as mx_AuthBody_changeFlow is specified to the AccessibleButton, the link may not be inlined as expected because of mx_AuthBody_changeFlow's styles (display: block & width: 100%). We need a wrapper anyway. Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
mx_CaptchaForm_* Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Setting "p" tag instead of "mx_CaptchaForm_recaptchaContainer_info" would be too broad. Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
I am having trouble of comprehending the usage of the spacing variables.
I also would like to know where the standardized usage of them is published and the guideline and documentation about it are available. Answers would be very appreciated. Thank you in advance. Edit: I've accustomed to the usage of the variables, so it is no longer a problem for me, while it does not mean the style guide about the usage is unnecessary. |
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Please review this one. thanks. |
@turt2live If this PR is not really necessary, please let me know... |
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.
@turt2live @luixxiul Yeah, let's please close this PR. It seems to have been addressed already in recent updates.
Screenshot from production app:
Closes element-hq/element-web#21624
Go back
link is enabled over the rowtype: defect
Signed-off-by: Suguru Hirahara luixxiul@users.noreply.github.com
Here's what your changelog entry will look like:
🐛 Bug Fixes
Preview: https://pr8208--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.