-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port blockquote block to RN mobile (#15482)
* Enable quote block in editor. * Add mobile version of quote edit. * Stop reading focus from context. * Make default tag to be div like on the web. * Implement block quote component in web and RN. * Simplify native block quote component. * Implement empty Alignment toolbar. * Fix style import. * Remove import * Rename blockquote to BlockQuotation. * Move BlockQuotation to be a primate component. * Add documentation reference for BlockQuotation. * Add BlockQuotation info to the changeling. * Update packages/components/CHANGELOG.md Co-Authored-By: Grzegorz (Greg) Ziółkowski <[email protected]> * Restore style file.
- Loading branch information
1 parent
9b4f31a
commit 95f51b4
Showing
14 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/block-editor/src/components/alignment-toolbar/index.native.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const AlignmentToolbar = () => { | ||
return null; | ||
}; | ||
|
||
export default AlignmentToolbar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/components/src/primitives/block-quotation/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# HorizontalRule | ||
|
||
A drop-in replacement for the HTML [blockquote](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote) element that works both on the web and in the mobile apps. It indicates that the enclosed text is an extended quotation. | ||
|
||
## Usage | ||
|
||
```jsx | ||
import { BlockQuotation } from '@wordpress/components'; | ||
|
||
const MyBlockQuotation = () => ( | ||
<BlockQuotation> | ||
...Quote content | ||
</BlockQuotation> | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const BlockQuotation = 'blockquote'; |
16 changes: 16 additions & 0 deletions
16
packages/components/src/primitives/block-quotation/index.native.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { View } from 'react-native'; | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import styles from './style.scss'; | ||
|
||
export const BlockQuotation = ( props ) => { | ||
return ( | ||
<View style={ styles.wpBlockQuote } > | ||
{ props.children } | ||
</View> | ||
); | ||
}; |
7 changes: 7 additions & 0 deletions
7
packages/components/src/primitives/block-quotation/style.native.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.wpBlockQuote { | ||
border-left-width: 4px; | ||
border-left-color: $black; | ||
border-left-style: solid; | ||
padding-left: 8px; | ||
margin-left: 8px; | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/components/src/primitives/block-quotation/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.wp-block-quote { | ||
&.is-style-large, | ||
&.is-large { | ||
margin: 0 0 16px; | ||
padding: 0 1em; | ||
|
||
p { | ||
font-size: 24px; | ||
font-style: italic; | ||
line-height: 1.6; | ||
} | ||
|
||
cite, | ||
footer { | ||
font-size: 18px; | ||
text-align: right; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './svg'; | ||
export * from './horizontal-rule'; | ||
export * from './block-quotation'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|