From 91ab442af65f62749f1852a6472624a631f5185f Mon Sep 17 00:00:00 2001 From: boblinthorst Date: Thu, 24 May 2018 09:45:33 +0200 Subject: [PATCH 1/3] Added explanatory text for the replacevars --- .../components/SnippetEditorFields.js | 13 +- .../__snapshots__/SnippetEditorTest.js.snap | 300 ++++++++++++------ 2 files changed, 221 insertions(+), 92 deletions(-) diff --git a/composites/Plugin/SnippetEditor/components/SnippetEditorFields.js b/composites/Plugin/SnippetEditor/components/SnippetEditorFields.js index b3541594..ac52bf12 100644 --- a/composites/Plugin/SnippetEditor/components/SnippetEditorFields.js +++ b/composites/Plugin/SnippetEditor/components/SnippetEditorFields.js @@ -94,11 +94,11 @@ const InputContainerDescription = InputContainer.extend` `; const FormSection = styled.div` - margin: 32px 0; + margin: 32px 0 0; `; const StyledEditor = styled.section` - padding: 10px 20px 20px 20px; + padding: 10px 20px 0 20px; `; const SimulatedLabel = styled.div` @@ -107,6 +107,11 @@ const SimulatedLabel = styled.div` font-family: Arial, Roboto-Regular, HelveticaNeue, sans-serif; `; +const ReplacementVariableExplanation = styled.p` + margin: 16px 0; + font-size: 13px; +`; + class SnippetEditorFields extends React.Component { /** * Constructs the snippet editor fields. @@ -276,6 +281,10 @@ class SnippetEditorFields extends React.Component { value={ descriptionLengthProgress.actual } progressColor={ this.getProgressColor( descriptionLengthProgress.score ) } /> + { + __( "Type '%' to add snippet variables, " + + "see the 'Help' tab on this page to see all available variables.", "yoast-components" ) + } ); diff --git a/composites/Plugin/SnippetEditor/tests/__snapshots__/SnippetEditorTest.js.snap b/composites/Plugin/SnippetEditor/tests/__snapshots__/SnippetEditorTest.js.snap index b914086d..40e92546 100644 --- a/composites/Plugin/SnippetEditor/tests/__snapshots__/SnippetEditorTest.js.snap +++ b/composites/Plugin/SnippetEditor/tests/__snapshots__/SnippetEditorTest.js.snap @@ -743,7 +743,7 @@ exports[`SnippetEditor calls callbacks when the editors are focused or changed 1 margin-right: 7px; } -.c37 { +.c38 { font-size: 0.8rem; height: 33px; border: 1px solid #dbdbdb; @@ -1044,11 +1044,11 @@ exports[`SnippetEditor calls callbacks when the editors are focused or changed 1 } .c30 { - margin: 32px 0; + margin: 32px 0 0; } .c29 { - padding: 10px 20px 20px 20px; + padding: 10px 20px 0 20px; } .c31 { @@ -1057,6 +1057,11 @@ exports[`SnippetEditor calls callbacks when the editors are focused or changed 1 font-family: Arial,Roboto-Regular,HelveticaNeue,sans-serif; } +.c37 { + margin: 16px 0; + font-size: 13px; +} + .c24 { border: none; border-bottom: 4px solid transparent; @@ -2200,6 +2205,13 @@ exports[`SnippetEditor calls callbacks when the editors are focused or changed 1 value={42} /> + +

+ Type '%' to add snippet variables, see the "Help" tab on this page to see all available variables. +

+
@@ -2212,7 +2224,7 @@ exports[`SnippetEditor calls callbacks when the editors are focused or changed 1 backgroundColor="#f7f7f7" borderColor="#ccc" boxShadowColor="#ccc" - className="c37" + className="c38" onClick={[Function]} textColor="#555" type="button" @@ -2221,7 +2233,7 @@ exports[`SnippetEditor calls callbacks when the editors are focused or changed 1 backgroundColor="#f7f7f7" borderColor="#ccc" boxShadowColor="#ccc" - className="c37 Button-kDSBcD c3" + className="c38 Button-kDSBcD c3" onClick={[Function]} textColor="#555" type="button" @@ -2230,7 +2242,7 @@ exports[`SnippetEditor calls callbacks when the editors are focused or changed 1 backgroundColor="#f7f7f7" borderColor="#ccc" boxShadowColor="#ccc" - className="c37 Button-kDSBcD c3 Button-kDSBcD c4" + className="c38 Button-kDSBcD c3 Button-kDSBcD c4" onClick={[Function]} textColor="#555" type="button" @@ -2239,7 +2251,7 @@ exports[`SnippetEditor calls callbacks when the editors are focused or changed 1 backgroundColor="#f7f7f7" borderColor="#ccc" boxShadowColor="#ccc" - className="c37 Button-kDSBcD c3 Button-kDSBcD c4 Button-kDSBcD c5" + className="c38 Button-kDSBcD c3 Button-kDSBcD c4 Button-kDSBcD c5" onClick={[Function]} textColor="#555" type="button" @@ -2248,13 +2260,13 @@ exports[`SnippetEditor calls callbacks when the editors are focused or changed 1 backgroundColor="#f7f7f7" borderColor="#ccc" boxShadowColor="#ccc" - className="c37 Button-kDSBcD c3 Button-kDSBcD c4 Button-kDSBcD c5 Button-kDSBcD c6" + className="c38 Button-kDSBcD c3 Button-kDSBcD c4 Button-kDSBcD c5 Button-kDSBcD c6" onClick={[Function]} textColor="#555" type="button" >