-
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.
RN: Add Insert Button Mobile Component. (#25204)
* RN: Add Icon Button Block Editor component. * Add the missing styles * Add readme descriptions Co-authored-by: Gerardo Pacheco <[email protected]>
- Loading branch information
Showing
7 changed files
with
141 additions
and
77 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
InserterButton | ||
============================= | ||
|
||
InserterButton is a type of button component. | ||
|
||
## Usage | ||
|
||
|
||
```jsx | ||
function render() { | ||
return ( | ||
<View> | ||
<Text>Some rendered content here</Text> | ||
<InserterButton item={ { title: "Short Text", icon: <SVG></SVG> } } onSelect={ function( item ) { console.log( 'selected' ); } } /> | ||
</View> | ||
); | ||
} | ||
``` | ||
|
||
_Note:_ | ||
|
||
## Props | ||
|
||
### `maxWidth` | ||
* **Type:** `String` | ||
* **Default:** `undefined` | ||
|
||
The max-width of the button. | ||
|
||
### `itemWidth` | ||
* **Type:** `String` | ||
* **Default:** `undefined` | ||
|
||
The button width. | ||
|
||
### `onSelect` | ||
* **Type:** `Function` | ||
* **Required** `true` | ||
|
||
The function that is called once the InserterButton has been selected. | ||
|
||
### `item` | ||
* **Type:** `Object` | ||
* **Required** `true` | ||
|
||
The object that gets selected. | ||
|
||
## Examples | ||
|
||
<InserterButton | ||
item={ item } | ||
itemWidth={ itemWidth } | ||
maxWidth={ maxWidth } | ||
onSelect={ onSelect } | ||
/> |
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
64 changes: 64 additions & 0 deletions
64
packages/components/src/mobile/inserter-button/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,64 @@ | ||
/** @format */ | ||
.touchableArea { | ||
border-radius: 8px 8px 8px 8px; | ||
} | ||
|
||
.modalIconWrapper { | ||
width: 104px; | ||
height: 64px; | ||
background-color: $gray-light; //#f3f6f8 | ||
border-radius: 8px 8px 8px 8px; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.modalIconWrapperDark { | ||
background-color: rgba($white, 0.07); | ||
} | ||
|
||
.modalIcon { | ||
width: 32px; | ||
height: 32px; | ||
justify-content: center; | ||
align-items: center; | ||
fill: $gray-dark; | ||
} | ||
|
||
.modalIconDark { | ||
fill: $white; | ||
} | ||
|
||
.modalItemLabel { | ||
background-color: transparent; | ||
padding-left: 2; | ||
padding-right: 2; | ||
padding-top: 4; | ||
padding-bottom: 0; | ||
justify-content: center; | ||
font-size: 12; | ||
color: $gray-dark; | ||
} | ||
|
||
.modalItemLabelDark { | ||
color: $white; | ||
} | ||
|
||
.clipboardBlock { | ||
background-color: transparent; | ||
border-width: 1px; | ||
border-color: $light-gray-400; | ||
} | ||
|
||
.clipboardBlockDark { | ||
border-color: $gray-70; | ||
} | ||
|
||
.modalItem { | ||
flex-direction: column; | ||
justify-content: flex-start; | ||
align-items: center; | ||
padding-left: $grid-unit-20 / 2; | ||
padding-right: $grid-unit-20 / 2; | ||
padding-top: 0; | ||
padding-bottom: 0; | ||
} |