-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implement help text in react snippet editor #517
Implement help text in react snippet editor #517
Conversation
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.
CR done 🚧
|
||
|
||
const HelpTextContainer = styled.div` | ||
max-width: 50em; |
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.
indentation?
`; | ||
|
||
let HelpTextDiv = styled.div` | ||
max-width: 30em !important; |
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.
Was this !important really necessary or is it a remnant from experimenting?
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.
Why is it in ems instead of px/%?
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 was copied from the specifications of the old snippet editor help text, but I have adjusted it to use pixels now instead.
max-height: 0; | ||
`; | ||
|
||
const colorHelpTextButton = "#0073aa"; |
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.
Isn't this color in the colors.json? Or, if not, a color that's very close?
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.
And please move this to above the styled components
|
||
const colorHelpTextButton = "#0073aa"; | ||
|
||
const HelpTextContent = [ "This is a rendering of what this post might look like in Google's search results. ", |
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 move this to above the styled components
/** | ||
* Renders the help text wrapper. | ||
* | ||
* @returns {ReactElement} The rendered help text wrapper . |
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.
space before period
render() { | ||
return ( | ||
<HelpTextContainer | ||
className={ `${ this.props.className }` }> |
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.
Plkease try without ${
> | ||
<StyledSvg | ||
size="16px" | ||
color="#72777c" |
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 a color from colors.json (this one or a close one)
@@ -615,6 +566,9 @@ export default class SnippetPreview extends PureComponent { | |||
/* eslint-disable jsx-a11y/mouse-events-have-key-events */ | |||
return ( | |||
<section> | |||
<div> | |||
<HelpTextWrapper /> |
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 pass the specific help text as a prop here, instead of hardcoding it in the wrapper. This way, the wrapper remains reusable.
Implemented most changes from the CR but temporarily on hold until a decision is made on the colors. |
…le from the develop branch.
…ies/implement-help-text-in-snippet-preview-editor
ac1fd00
to
bc48778
Compare
margin: 0px 20px 10px 25px | ||
`; | ||
|
||
let HelpTextDiv = styled.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.
Looks like it could be a const instead of a let?
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 change the properties of the div depending on a conditional in the render method, so I thought I needed let
but it turns out that const
works as well. Changed to the latter.
|
||
|
||
const HelpTextContainer = styled.div` | ||
max-width: 600px; |
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.
One tab too much?
max-width: 600px; | ||
padding: 1 0 3 1em; | ||
font-weight: normal; | ||
margin: 0px 20px 10px 25px |
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 0px, replace with 0.
box-shadow: 0 0 0 0px #5b9dd9; | ||
position: relative; | ||
display: block; | ||
margin: -44px -10px 10px 0px; |
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.
0px to 0
border-radius: 50%; | ||
border: none; | ||
clip: rect(1px 1px 1px 1px); | ||
box-shadow: 0 0 0 0px #5b9dd9; |
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.
0px to 0, is there a color in colors.json that corresponds to the box shadow color?
margin: -44px -10px 10px 0px; | ||
background-color: transparent; | ||
float: right; | ||
padding: 2px 0px 2px 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.
0px to 0
/** | ||
* Handles the onButtonClick event. | ||
* | ||
* Toggles the boolean isExpanded in the state |
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.
dot
* Renders the HelpTextWrapper component | ||
* | ||
* @param {Object} props The passed props. | ||
* @param {string} props.className The class name. |
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.
Either line up the documentation, or keep the seperation space between the description and the variable name the same, now it's inconsistent. And should the helpText prop also be documented here?
@@ -659,6 +663,9 @@ export default class SnippetPreview extends PureComponent { | |||
/* eslint-disable jsx-a11y/mouse-events-have-key-events */ | |||
return ( | |||
<section> | |||
<div> | |||
<HelpTextWrapper helpText = { helpText } /> |
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.
no spacing around the = sign.
@@ -53,6 +54,9 @@ const angleRight = ( color ) => "data:image/svg+xml;charset=utf8," + encodeURI( | |||
"</svg>" | |||
); | |||
|
|||
export const helpText = [ "This is a rendering of what this post might look like in Google's search results. ", |
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.
looks like it should be translatable
Cr: placed some comments |
CR 👍 |
Acceptance 👍 |
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
feature/content-analysis-in-sidebar
branch and has already been code reviewedTest instructions
This PR can be tested by following these steps:
yarn test
should pass all testsFixes #481