From 8fb4681d9c0e464826a4149fe061b517e02f5cd4 Mon Sep 17 00:00:00 2001 From: Pinar Olguc Date: Mon, 10 Dec 2018 20:49:43 +0300 Subject: [PATCH 1/7] Update styling of more block --- .../block-library/src/more/edit.native.js | 32 ++++++++++++++----- .../block-library/src/more/editor.native.scss | 24 +++++++------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/packages/block-library/src/more/edit.native.js b/packages/block-library/src/more/edit.native.js index a6845e2ade8a5..f7217ffedaf56 100644 --- a/packages/block-library/src/more/edit.native.js +++ b/packages/block-library/src/more/edit.native.js @@ -47,18 +47,20 @@ export default class MoreEdit extends Component { this.props.setAttributes( { customText: value } ); } - render() { + renderLine(key) { + return + } + + renderText(key: number) { const { attributes, onFocus, onBlur } = this.props; const { customText } = attributes; const defaultText = __( 'Read more' ); const value = customText !== undefined ? customText : defaultText; - return ( - - - <!-- + return ( + - <Text style={ styles[ 'block-library-more__right-marker' ] }>--&gt;</Text> - </View> + </View> + ) + } + + renderInner() { + return [ + this.renderLine(1), + this.renderText(2), + this.renderLine(3) + ] + } + + render() { + return ( + <View style={ styles[ 'block-library-more__container' ]}> + { this.renderInner() } </View> ); } diff --git a/packages/block-library/src/more/editor.native.scss b/packages/block-library/src/more/editor.native.scss index 46d36fe08e321..73a93beba50cc 100644 --- a/packages/block-library/src/more/editor.native.scss +++ b/packages/block-library/src/more/editor.native.scss @@ -2,21 +2,21 @@ .block-library-more__container { align-items: center; - padding-left: 4; - padding-right: 4; - padding-top: 4; - padding-bottom: 4; -} - -.block-library-more__sub-container { - align-items: center; + padding: 4px; flex-direction: row; } -.block-library-more__left-marker { - padding-right: 4; +.block-library-more__line { + background-color: #555d66; + height: 2; + flex: 1; } -.block-library-more__right-marker { - padding-left: 4; +.block-library-more__text { + text-decoration-style: solid; + flex: 1; + text-align: center; + margin-left: 15; + margin-right: 15; + margin-bottom: 5; } From b8e922485b61b6e6fa0fd8f402dc87dd90781d99 Mon Sep 17 00:00:00 2001 From: Pinar Olguc <pinarolguc@gmail.com> Date: Mon, 10 Dec 2018 21:04:30 +0300 Subject: [PATCH 2/7] Fix CI test --- packages/block-library/src/more/edit.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/more/edit.native.js b/packages/block-library/src/more/edit.native.js index f7217ffedaf56..f91ca9afefcdc 100644 --- a/packages/block-library/src/more/edit.native.js +++ b/packages/block-library/src/more/edit.native.js @@ -51,7 +51,7 @@ export default class MoreEdit extends Component { return <View key={key} style={ styles[ 'block-library-more__line' ] } /> } - renderText(key: number) { + renderText(key) { const { attributes, onFocus, onBlur } = this.props; const { customText } = attributes; const defaultText = __( 'Read more' ); From 6a367d46e1abbd0e27ef5b20bc496e920f497be1 Mon Sep 17 00:00:00 2001 From: Pinar Olguc <pinarolguc@gmail.com> Date: Mon, 10 Dec 2018 21:31:28 +0300 Subject: [PATCH 3/7] Update spaces --- packages/block-library/src/more/edit.native.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/more/edit.native.js b/packages/block-library/src/more/edit.native.js index f91ca9afefcdc..4180f2749fdaf 100644 --- a/packages/block-library/src/more/edit.native.js +++ b/packages/block-library/src/more/edit.native.js @@ -47,11 +47,11 @@ export default class MoreEdit extends Component { this.props.setAttributes( { customText: value } ); } - renderLine(key) { + renderLine(key) { return <View key={key} style={ styles[ 'block-library-more__line' ] } /> } - renderText(key) { + renderText(key) { const { attributes, onFocus, onBlur } = this.props; const { customText } = attributes; const defaultText = __( 'Read more' ); @@ -79,7 +79,7 @@ export default class MoreEdit extends Component { this.renderLine(1), this.renderText(2), this.renderLine(3) - ] + ] } render() { From e1b59f95f0df38b6fc0baf33fc0fdc12e167ba4b Mon Sep 17 00:00:00 2001 From: Pinar Olguc <pinarolguc@gmail.com> Date: Mon, 10 Dec 2018 21:33:56 +0300 Subject: [PATCH 4/7] Convert indentation to tabs --- packages/block-library/src/more/edit.native.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/more/edit.native.js b/packages/block-library/src/more/edit.native.js index 4180f2749fdaf..0e89623167c90 100644 --- a/packages/block-library/src/more/edit.native.js +++ b/packages/block-library/src/more/edit.native.js @@ -48,8 +48,8 @@ export default class MoreEdit extends Component { } renderLine(key) { - return <View key={key} style={ styles[ 'block-library-more__line' ] } /> - } + return <View key={key} style={ styles[ 'block-library-more__line' ] } /> + } renderText(key) { const { attributes, onFocus, onBlur } = this.props; @@ -71,8 +71,8 @@ export default class MoreEdit extends Component { onBlur={ onBlur } /> </View> - ) - } + ) + } renderInner() { return [ From 7f2a93a9ffef29e75dc753d1aa0bd698bc580a12 Mon Sep 17 00:00:00 2001 From: Pinar Olguc <pinarolguc@gmail.com> Date: Mon, 10 Dec 2018 21:54:54 +0300 Subject: [PATCH 5/7] Fix lint issues --- .../block-library/src/more/edit.native.js | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/block-library/src/more/edit.native.js b/packages/block-library/src/more/edit.native.js index 0e89623167c90..945869a788b5b 100644 --- a/packages/block-library/src/more/edit.native.js +++ b/packages/block-library/src/more/edit.native.js @@ -47,38 +47,38 @@ export default class MoreEdit extends Component { this.props.setAttributes( { customText: value } ); } - renderLine(key) { - return <View key={key} style={ styles[ 'block-library-more__line' ] } /> + renderLine( key ) { + return <View key={ key } style={ styles[ 'block-library-more__line' ] } /> } - renderText(key) { + renderText( key ) { const { attributes, onFocus, onBlur } = this.props; const { customText } = attributes; const defaultText = __( 'Read more' ); const value = customText !== undefined ? customText : defaultText; - return ( - <View key={key} > - <PlainText - style={ styles[ 'block-library-more__text' ] } - value={ value } - multiline={ true } - underlineColorAndroid="transparent" - onChange={ this.onChangeInput } - placeholder={ defaultText } - isSelected={ this.props.isSelected } - onFocus={ onFocus } - onBlur={ onBlur } - /> - </View> + return ( + <View key={ key } > + <PlainText + style={ styles[ 'block-library-more__text' ] } + value={ value } + multiline={ true } + underlineColorAndroid="transparent" + onChange={ this.onChangeInput } + placeholder={ defaultText } + isSelected={ this.props.isSelected } + onFocus={ onFocus } + onBlur={ onBlur } + /> + </View> ) } renderInner() { - return [ - this.renderLine(1), - this.renderText(2), - this.renderLine(3) + return [ + this.renderLine(1), + this.renderText(2), + this.renderLine(3) ] } From edeb040b02f8ee5b575ceeac6279f634c38600e0 Mon Sep 17 00:00:00 2001 From: Pinar Olguc <pinarolguc@gmail.com> Date: Tue, 11 Dec 2018 15:03:23 +0300 Subject: [PATCH 6/7] Remove key attribute --- .../block-library/src/more/edit.native.js | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/block-library/src/more/edit.native.js b/packages/block-library/src/more/edit.native.js index 945869a788b5b..da731dd953f13 100644 --- a/packages/block-library/src/more/edit.native.js +++ b/packages/block-library/src/more/edit.native.js @@ -47,18 +47,18 @@ export default class MoreEdit extends Component { this.props.setAttributes( { customText: value } ); } - renderLine( key ) { - return <View key={ key } style={ styles[ 'block-library-more__line' ] } /> + renderLine() { + return <View style={ styles[ 'block-library-more__line' ] } /> } - renderText( key ) { + renderText() { const { attributes, onFocus, onBlur } = this.props; const { customText } = attributes; const defaultText = __( 'Read more' ); const value = customText !== undefined ? customText : defaultText; return ( - <View key={ key } > + <View> <PlainText style={ styles[ 'block-library-more__text' ] } value={ value } @@ -74,18 +74,12 @@ export default class MoreEdit extends Component { ) } - renderInner() { - return [ - this.renderLine(1), - this.renderText(2), - this.renderLine(3) - ] - } - render() { return ( <View style={ styles[ 'block-library-more__container' ]}> - { this.renderInner() } + { this.renderLine() } + { this.renderText() } + { this.renderLine() } </View> ); } From 6b640ca872054b37b1e66562ee5a1d369f8d48b4 Mon Sep 17 00:00:00 2001 From: Pinar Olguc <pinarolguc@gmail.com> Date: Tue, 11 Dec 2018 15:03:50 +0300 Subject: [PATCH 7/7] Set fixed width to the text input --- packages/block-library/src/more/editor.native.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/more/editor.native.scss b/packages/block-library/src/more/editor.native.scss index 73a93beba50cc..beb5ef423776f 100644 --- a/packages/block-library/src/more/editor.native.scss +++ b/packages/block-library/src/more/editor.native.scss @@ -14,7 +14,8 @@ .block-library-more__text { text-decoration-style: solid; - flex: 1; + flex: 0; + width: 200; text-align: center; margin-left: 15; margin-right: 15;