Skip to content

Commit

Permalink
docs(react-persona): Adding migration guide (#25022)
Browse files Browse the repository at this point in the history
  • Loading branch information
sopranopillow authored Oct 2, 2022
1 parent cbf3f64 commit 86b3133
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
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"
}
42 changes: 42 additions & 0 deletions packages/react-components/react-persona/MIGRATION.md
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` |

0 comments on commit 86b3133

Please sign in to comment.