-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(react-persona): Adding migration guide (#25022)
- Loading branch information
1 parent
cbf3f64
commit 86b3133
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-persona-7470d036-2f82-454b-86fc-bd8282e46c2f.json
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,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "docs: Add migration guide.", | ||
"packageName": "@fluentui/react-persona", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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,42 @@ | ||
# Badge Migration | ||
|
||
## Migration from v8 | ||
|
||
v8 offers a component equivalent to v9's `Persona`. However, the API is slightly different. The main difference is that v9's `Persona` does not handle the functionality of the `presence` and `avatar`. Instead, the `presence` and `avatar` are separate components that can be used in conjunction with `Persona`. | ||
|
||
Here's how the API of v8's `Persona` compares to the one from v9's `Persona` component: | ||
|
||
- `className` => `className` | ||
- `coinProps` => Use `avatar`'s or `presence`'s slot props | ||
- `componentRef` => NOT SUPPORTED - use `ref` instead | ||
- `hidePersonaDetails` => Use the `Avatar` component for this case | ||
- ``` | ||
- `imageShouldFadeIn` => NOT SUPPORTED | ||
- `isOutOfOffice` => Use the `outOfOffice` prop of the `presence` slot. E.g.: `presence={{ outOfOffice: true }}` | ||
- `presence` => Use the `status` prop of the `presence` slot. E.g.: `presence={{ status: 'away' }}` | ||
- `presenceTitle` => NOT SUPPORTED | ||
- `showOverflowTooltip` => NOT SUPPORTED | ||
- `showUnknownPersonaCoin` => NOT SUPPORTED | ||
- `styles` => Use style customization through `className` instead | ||
## Property Mapping | ||
| v8 `Persona` | v9 `Persona` | | ||
| ------------------------ | -------------------------------------- | | ||
| `coinProps` | `avatar` or `badge` slot props | | ||
| `coinSize` | `size` in the `badge` or `avatar` slot | | ||
| `className` | `className` | | ||
| `componentRef` | `ref` | | ||
| `hidePersonaDetails` | - | | ||
| `imageShouldFadeIn` | - | | ||
| `isOutOfOffice` | `status` in `presence` slot props | | ||
| `optionalText` | `quaternaryText` | | ||
| `presence` | `presence` | | ||
| `presenceTitle` | - | | ||
| `primaryText` | `primaryText` | | ||
| `secondaryText` | `secondaryText` | | ||
| `showOverflowTooltip` | - | | ||
| `showUnknownPersonaCoin` | - | | ||
| `styles` | `className` | | ||
| `tertiaryText` | `tertiaryText` | | ||
| `text` | `name` | |