Skip to content

Commit

Permalink
update version to 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Hamilton committed Feb 7, 2021
1 parent efb74ea commit ab0526b
Show file tree
Hide file tree
Showing 55 changed files with 1,769 additions and 1,665 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-elements",
"version": "3.1.0",
"version": "3.2.0",
"description": "React Native Elements & UI Toolkit",
"main": "src/index.js",
"files": [
Expand Down
176 changes: 176 additions & 0 deletions website/versioned_docs/version-3.2.0/avatar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
---
id: avatar
title: Avatar
---

import Props from './props/avatar.md'

Avatars are found all over ui design from lists to profile screens. They are
commonly used to represent a user and can contain photos, icons, or even text.

<div class="component-preview component-preview--grid">
<figure>
<img src="/img/avatar/avatar--photo.jpg" alt="Standard Avatar" />
<figcaption>Standard</figcaption>
</figure>
<figure>
<img src="/img/avatar/avatar--title.jpg" alt="Avatar with Title" />
<figcaption>Title</figcaption>
</figure>
<figure>
<img src="/img/avatar/avatar--icon.jpg" alt="Avatar with Icon" />
<figcaption>Icon</figcaption>
</figure>
<figure>
<img src="/img/avatar/avatar--edit.jpg" alt="Standard Avatar with accessory" />
<figcaption>Standard with accessory</figcaption>
</figure>
</div>

## Usage

```js
import { Avatar } from 'react-native-elements';

// Standard Avatar
<Avatar
rounded
source={{
uri:
'https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg',
}}
/>

// Avatar with Title
<Avatar rounded title="MD" />

// Avatar with Icon
<Avatar rounded icon={{ name: 'home' }} />

// Standard Avatar with accessory
<Avatar
source={{
uri:
'https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg',
}}
>
<Avatar.Accessory {...accessoryProps} />
</Avatar>
```

#### Avatar with initials

<img src="/img/avatar_with_initials.png" width="500" />

```js
import { Avatar } from "react-native-elements";

<Avatar
size="small"
rounded
title="MT"
onPress={() => console.log("Works!")}
activeOpacity={0.7}
/>
<Avatar
size="medium"
title="BP"
onPress={() => console.log("Works!")}
activeOpacity={0.7}
/>
<Avatar
size="large"
title="LW"
onPress={() => console.log("Works!")}
activeOpacity={0.7}
/>
<Avatar
size="xlarge"
rounded
title="CR"
onPress={() => console.log("Works!")}
activeOpacity={0.7}
/>
```

#### Avatar with icons

<img src="/img/avatar_with_icons.png" width="500" />

```js
import { Avatar } from "react-native-elements";

<Avatar
rounded
icon={{name: 'user', type: 'font-awesome'}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
containerStyle={{flex: 2, marginLeft: 20, marginTop: 115}}
/>
<Avatar
size="small"
rounded
icon={{name: 'user', type: 'font-awesome'}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
containerStyle={{flex: 2, marginLeft: 20, marginTop: 115}}
/>
<Avatar
size="medium"
overlayContainerStyle={{backgroundColor: 'blue'}}
icon={{name: 'meetup', color: 'red', type: 'font-awesome'}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
containerStyle={{flex: 3, marginTop: 100}}
/>
<Avatar
size="large"
icon={{name: 'rocket', color: 'orange', type: 'font-awesome'}}
overlayContainerStyle={{backgroundColor: 'white'}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
containerStyle={{flex: 4, marginTop: 75}}
/>
<Avatar
size="xlarge"
rounded
icon={{name: 'home', type: 'font-awesome'}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
containerStyle={{flex: 5, marginRight: 60}}
/>
<Avatar
size={200}
rounded
icon={{name: 'user', type: 'font-awesome'}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
containerStyle={{flex: 2, marginLeft: 20, marginTop: 115}}
/>
```

#### Avatar with title placeholder

<img src="/img/avatar_with_title_placeholder.gif" width="500" />

```js
import { Avatar, ListItem } from 'react-native-elements';

<ListItem>
<Avatar
title={name[0]}
source={{ uri: avatar_url }}
/>
<ListItem.Content>
<ListItem.Title>{name}</ListItem.Title>
<ListItem.SubTitle>{role}</ListItem.Subtitle>
</ListItem.Content>
<ListItem.Chevron/>
/>;
```

---

<Props />

---
90 changes: 90 additions & 0 deletions website/versioned_docs/version-3.2.0/badge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
id: badge
title: Badge
---

import Props from './props/badge.md'

Badges are small components typically used to communicate a numerical value or
indicate the status of an item to the user.

<div className="component-preview component-preview--grid component-preview--grid-3">
<figure>
<img src="/img/badge/badge--standard.jpg" alt="Standard" />
<figcaption>Standard</figcaption>
</figure>
<figure>
<img src="/img/badge/badge--mini.jpg" alt="Mini Badge" />
<figcaption>Mini Badge</figcaption>
</figure>
<figure>
<img src="/img/badge/badge--indicator.jpg" alt="Badge as Indicator" />
<figcaption>Badge as Indicator</figcaption>
</figure>
</div>

### Mini Badge

This type of badge shows when no `value` prop is provided. This form is
effective for showing statuses.

### withBadge Higher-Order Component

The withBadge HOC allows you to easily add badges to icons and other components.

## Usage

```js
import { Text, View } from 'react-native'
import { Avatar, Badge, Icon, withBadge } from 'react-native-elements'

// Standard badge
<Badge value="99+" status="error" />
<Badge value={<Text>My Custom Badge</Text>} />

// Mini badge
<Badge status="success" />
<Badge status="error" />
<Badge status="primary" />
<Badge status="warning" />

// Avatar with mini badge
<View>
<Avatar
rounded
source={{
uri: 'https://randomuser.me/api/portraits/men/41.jpg',
}}
size="large"
/>

<Badge
status="success"
containerStyle={{ position: 'absolute', top: -4, right: -4 }}
/>
</View>

// withBadge HOC

const BadgedIcon = withBadge(1)(Icon)
<BadgedIcon type="ionicon" name="ios-chatbubbles" />

// Using the decorator proposal
@connect(state => ({
notifications: state.notifications,
}))
@withBadge(props => props.notifications.length)
export default class MyDecoratedIcon extends React.Component {
render() {
return (
<Icon type="ionicon" name="md-cart" />
);
}
}
```

---

<Props />

---
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Bottom Sheet
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import Props from './props/bottomsheet.md'

**Note:**
Make sure that you have completed [Step 3](getting_started.md#step-3-setup-react-native-safe-area-context) in the setup guide before using `BottomSheet`.
Expand Down Expand Up @@ -43,42 +44,6 @@ const list = [

---

## Props

- [`containerStyle`](#containerStyle)
- [`isVisible`](#isvisible)
- [`modalProps`](#modalprops)

---

## Reference

### `containerStyle`

Style of the bottom sheet's container

Use this to change the color of the underlay

| Type | Default |
| :-----------------: | :------------: |
| View style (object) | Internal Style |
<Props />

---

### `isVisible`

Is the modal component shown

| Type | Default |
| :-----: | :-----: |
| boolean | false |

---

### `modalProps`

Additional props handed to the `Modal`

| Type | Default |
| :----------------------------------------------------------: | :-----: |
| [Modal Props](https://reactnative.dev/docs/modal.html#props) | {} |
Loading

0 comments on commit ab0526b

Please sign in to comment.