Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Apr 16, 2022
1 parent 9fbde80 commit b9d1691
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 20 deletions.
2 changes: 1 addition & 1 deletion website/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ yarn add react-native-reanimated@2.1.0 react-native-gesture-handler react-native
:::info
**React Native Gesture Handler** needs extra steps to finalize its installation, please follow their [installation instructions](https://github.com/software-mansion/react-native-gesture-handler).

**React Native Reanimated v2** needs extra steps to finalize its installation, please follow their [installation instructions](https://docs.swmansion.com/react-native-reanimated/docs/installation).
**React Native Reanimated v2** needs extra steps to finalize its installation, please follow their [installation instructions](https://docs.swmansion.com/react-native-reanimated/docs).

**React Native Unimodules** needs extra steps to finalize its installation, please follow their [installation instructions](https://docs.expo.io/bare/installing-unimodules/). And make sure you excluded unwanted modules in your app. You can check the [exampale project](https://github.com/enesozturk/react-native-hold-menu/tree/main/example).
:::
Expand Down
46 changes: 45 additions & 1 deletion website/docs/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,51 @@ title: Props
slug: /props
---

## Configuration
## HoldMenuProvider

### `iconComponent`

If you want to use icon in your menu items, you need to set you Icon component to HoldMenuProvider to be able to use it. And than you can set just name of the icon in menu item list with `icon` prop like below.

:::note
Icon can be used with just **react-native-vector-icons** for now.
:::

```tsx
import FeatherIcon from 'react-native-vector-icons/Feather';

/* ... */
<HoldMenuProvider iconComponent={FeatherIcon}>

```

### `theme`

If you want to set spesific theme or change depends on your theme, use `theme` prop like below.

Values:

| value | default |
| ----- | ------- |
| light | true |
| dark | false |

```tsx
<HoldMenuProvider theme={"dark"}>
```

### `paddingBottom`

Set if you'd like to apply padding to bottom. In most cases, you may want to set this for safe area provider values.

#### Example

```tsx
const { bottom } = useSafeAreaProvider();
<HoldMenuProvider paddingBottom={bottom} />;
```

## HoldItem

### `items`

Expand Down
24 changes: 6 additions & 18 deletions website/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ hide_title: true

## Usage

### Provider
### HoldMenuProvider

Before using Hold Menu in your application, you need to wrap your app with `HoldMenuProvider` first.

See all the [HoldMenuProvider props](/react-native-hold-menu/docs/props#holdmenuprovider).

```tsx
import React from 'react';

Expand All @@ -28,26 +30,12 @@ const App = () => {
export default App;
```

### Icons

If you want to use icon in your menu items, you need to set you Icon component to HoldMenuProvider to be able to use it. And than you can set just name of the icon in menu item list with `icon` prop like below.

:::note
Icon can be used with just **react-native-vector-icons** for now.
:::

```tsx
import FeatherIcon from 'react-native-vector-icons/Feather';

/* ... */
<HoldMenuProvider iconComponent={FeatherIcon} theme="light">

```

### Wrapper
### HoldItem

Now you can wrap your components with `HoldItem`. You need to set [items](/react-native-hold-menu/docs/props#items) prop and also see other optional props for your menu.

See all the [HoldItem props](/react-native-hold-menu/docs/props#holditem).

```tsx
import React from 'react';
import { View } from 'react-native';
Expand Down

0 comments on commit b9d1691

Please sign in to comment.