web: Components: Fixed Avatar component readme

This commit is contained in:
Ilya Oleshko 2019-11-19 15:21:11 +03:00
parent c83088b0de
commit e5256f8ca9

View File

@ -1,29 +1,25 @@
# Avatar
## Usage
Used to display an avatar or brand.
### Usage
```js
import { Avatar } from "asc-web-components";
<Avatar size="max" role="admin" source="" userName="" editing={false} />;
```
#### Description
If you want to create an avatar with initials, only _first letter of first two words_ of line is used.
Required to display user avatar on page.
If you want to create an avatar with initials, only *first letter of first two words* of line is used.
#### Usage
```js
<Avatar size="max" role="admin" source="" userName="" editing={false} />
```
#### Properties
### Properties
| Props | Type | Required | Values | Default | Description |
| ---------- | -------- | :------: | --------------------------------- | -------- | ------------------------------------------ |
| `size` | `oneOf` | - | `max`, `big`, `medium`, `small` | `medium` | Tells what size avatar should be displayed |
| `role` | `oneOf` | - | `owner`, `admin`, `guest`, `user` | - | Adds a user role table |
| `source` | `string` | - | - | - | Avatar image source |
| ------------ | -------- | :------: | --------------------------------- | ------------ | -------------------------------------------------------- |
| `size` | `oneOf` | - | `max`, `big`, `medium`, `small` | `medium` | Size of avatar |
| `role` | `oneOf` | - | `owner`, `admin`, `guest`, `user` | `user` | Adds a user role table |
| `source` | `string` | - | - | - | The address of the image for an image avatar |
| `userName` | `string` | - | - | - | Need to create an avatar with initials |
| `editing` | `bool` | - | - | `false` | Displays avatar edit layer |
| `editLabel` | `string` | - | - | `Edit photo` | Label for editing layer |
| `editAction` | `func` | - | - | - | Function called when the avatar change button is pressed |