-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Port blockquote block to RN mobile #15482
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
Changes from 1 commit
6f02cba
8dc7c06
116cf9b
ae65dfc
3bc05ac
6507230
4d1de79
f5ebb76
536442e
587a01b
03be5ad
f28f013
a1a16f4
08b2327
d8b77ba
1f8a12a
1f2e231
889116f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const Blockquote = 'blockquote'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /** | ||
| * External dependencies | ||
| */ | ||
| import { View } from 'react-native'; | ||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import styles from './style'; | ||
|
|
||
| export const Blockquote = ( props ) => { | ||
| return ( | ||
| <View style={ { flex: 1, flexDirection: 'row', alignItems: 'stretch' } } > | ||
| <View style={ styles.wpBlockQuoteMargin } /> | ||
| <View style={ styles.wpBlockQuoteComponents } > | ||
| { props.children } | ||
| </View> | ||
| </View> | ||
| ); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,10 @@ | |
| */ | ||
| import { __ } from '@wordpress/i18n'; | ||
| import { AlignmentToolbar, BlockControls, RichText } from '@wordpress/block-editor'; | ||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { Blockquote } from './blockquote'; | ||
|
||
|
|
||
| export default function QuoteEdit( { attributes, setAttributes, isSelected, mergeBlocks, onReplace, className } ) { | ||
| const { align, value, citation } = attributes; | ||
|
|
@@ -16,7 +20,7 @@ export default function QuoteEdit( { attributes, setAttributes, isSelected, merg | |
| } } | ||
| /> | ||
| </BlockControls> | ||
| <blockquote className={ className } style={ { textAlign: align } }> | ||
| <Blockquote className={ className } style={ { textAlign: align } }> | ||
| <RichText | ||
| identifier="value" | ||
| multiline | ||
|
|
@@ -54,7 +58,7 @@ export default function QuoteEdit( { attributes, setAttributes, isSelected, merg | |
| className="wp-block-quote__citation" | ||
| /> | ||
| ) } | ||
| </blockquote> | ||
| </Blockquote> | ||
| </> | ||
| ); | ||
| } | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| .wpBlockQuoteContainer { | ||
| flex: 1; | ||
| flex-direction: row; | ||
| align-items: stretch; | ||
| } | ||
|
|
||
| .wpBlockQuoteMargin { | ||
| width: 2; | ||
| background-color: $blue-dark-900; | ||
| } | ||
|
|
||
| .wpBlockQuoteComponents { | ||
| flex: 1; | ||
| flex-direction: column; | ||
| justify-content: flex-start; | ||
| align-items: stretch; | ||
| } |
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 think this can be simpler, Views in react native seem to support border styles:
I'll let Thomas review the exact colors, but the web version seems to be using black. If you're seeing a blue line, that's coming from Twenty Nineteen