-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update website with example usages and readme
- Loading branch information
1 parent
50a5e5d
commit 03da41a
Showing
17 changed files
with
173 additions
and
359 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
--- | ||
id: examples | ||
title: Examples | ||
slug: /examples | ||
--- | ||
|
||
## Configuring List | ||
|
||
### Sample List | ||
|
||
**Code** | ||
|
||
```js | ||
<HoldItem | ||
items={[ | ||
{ text: 'Reply', onPress: () => {} }, | ||
{ text: 'Edit', onPress: () => {} }, | ||
{ text: 'Delete', onPress: () => {} }, | ||
]} | ||
/> | ||
``` | ||
|
||
**Result** | ||
|
||
![list-simple](/img/examples/list-simple.png) | ||
|
||
### List with title | ||
|
||
**Code** | ||
|
||
```js | ||
<HoldItem | ||
items={[ | ||
{ text: 'Actions', isTitle: true, onPress: () => {} }, | ||
{ text: 'Reply', onPress: () => {} }, | ||
{ text: 'Edit', onPress: () => {} }, | ||
{ text: 'Delete', onPress: () => {} }, | ||
]} | ||
/> | ||
``` | ||
|
||
**Result** | ||
|
||
![list-with-title](/img/examples/list-with-title.png) | ||
|
||
### List with seperator | ||
|
||
**Code** | ||
|
||
```js | ||
<HoldItem | ||
items={[ | ||
{ text: 'Actions', isTitle: true, onPress: () => {} }, | ||
{ text: 'Reply', onPress: () => {} }, | ||
{ text: 'Edit', onPress: () => {} }, | ||
{ text: 'Delete', withSeperator: true, onPress: () => {} }, | ||
{ text: 'Share', onPress: () => {} }, | ||
]} | ||
/> | ||
``` | ||
|
||
**Result** | ||
|
||
![list-with-seperator](/img/examples/list-with-seperator.png) | ||
|
||
### List with destructive button | ||
|
||
**Code** | ||
|
||
```js | ||
<HoldItem | ||
items={[ | ||
{ text: 'Actions', isTitle: true, onPress: () => {} }, | ||
{ text: 'Reply', onPress: () => {} }, | ||
{ text: 'Edit', onPress: () => {} }, | ||
{ | ||
text: 'Delete', | ||
withSeperator: true, | ||
isDestructive: true, | ||
onPress: () => {}, | ||
}, | ||
{ text: 'Share', onPress: () => {} }, | ||
]} | ||
/> | ||
``` | ||
|
||
**Result** | ||
|
||
![list-with-destructive](/img/examples/list-with-destructive.png) | ||
|
||
### List with icons | ||
|
||
**Code** | ||
|
||
```js | ||
<HoldItem | ||
items={[ | ||
{ text: 'Action', isTitle: true, onPress: () => {} }, | ||
{ | ||
text: 'Home', | ||
icon: () => <Icon name="home" size={18} />, | ||
onPress: () => {}, | ||
}, | ||
{ | ||
text: 'Edit', | ||
icon: () => <Icon name="edit" size={18} />, | ||
onPress: () => {}, | ||
}, | ||
{ | ||
text: 'Delete', | ||
icon: () => <Icon name="delete" size={18} />, | ||
withSeperator: true, | ||
isDestructive: true, | ||
onPress: () => {}, | ||
}, | ||
{ | ||
text: 'Share', | ||
icon: () => <Icon name="share" size={18} />, | ||
onPress: () => {}, | ||
}, | ||
{ | ||
text: 'More', | ||
icon: () => <Icon name="more-horizontal" size={18} />, | ||
onPress: () => {}, | ||
}, | ||
]} | ||
/> | ||
``` | ||
|
||
**Result** | ||
|
||
![list-with-destructive](/img/examples/list-with-icons.png) | ||
|
||
<!-- ## Configuring Hold Item --> | ||
|
||
<!-- ## Menu from bottom | ||
**Code** | ||
```js | ||
<HoldItem | ||
bottom | ||
items={[ | ||
{ text: 'Action', isTitle: true, onPress: () => {} }, | ||
{ text: 'Action 1', onPress: () => {} }, | ||
{ text: 'Action 2', withSeperator: true, onPress: () => {} }, | ||
{ text: 'Action 3', isDestructive: true, onPress: () => {} }, | ||
]} | ||
/> | ||
``` | ||
**Result** | ||
![sample-menu](/img/og.png) --> |
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 |
---|---|---|
|
@@ -32,7 +32,7 @@ yarn add react-native-hold-menu | |
This library needs these dependencies to be installed in your project before you can use it: | ||
|
||
```bash | ||
yarn add [email protected].2 react-native-gesture-handler | ||
yarn add [email protected].0 react-native-gesture-handler | ||
``` | ||
|
||
:::info | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
someSidebar: { | ||
Documents: ['getting-started', 'usage', 'props'], | ||
Documents: ['getting-started', 'usage', 'props', 'examples'], | ||
}, | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.