-
Notifications
You must be signed in to change notification settings - Fork 2.9k
react-avatar: Adding initial implementation of AvatarGroup. #22736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
33c8028
11be710
9a6f9b4
5fe2af0
155cdde
6a42db5
d1a04b9
69625b5
f5583b2
c8bb4c4
f3bfd1d
ffe8b41
575d8c6
cfeea42
2467069
edbfe66
f3bcb81
6fb6258
cd74a0e
5a6bced
2bd144d
9761bab
136b2ea
539f419
f802a98
98c7dd5
43b2213
e8e42a6
4fee5ba
2118864
8da8f1f
bd3ae84
7501379
7801453
42cc81a
7f1f741
8d932f2
6b38759
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "none", | ||
| "comment": "Adding initial implementation of AvatarGroup", | ||
| "packageName": "@fluentui/react-avatar", | ||
| "email": "[email protected]", | ||
| "dependentChangeType": "none" | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,36 @@ | ||
| import * as React from 'react'; | ||
| import { Popover, PopoverTrigger } from '@fluentui/react-popover'; | ||
| import { Tooltip } from '@fluentui/react-tooltip'; | ||
| import { getSlots } from '@fluentui/react-utilities'; | ||
| import { AvatarGroupContext } from '../../contexts/AvatarGroupContext'; | ||
| import type { AvatarGroupState, AvatarGroupSlots } from './AvatarGroup.types'; | ||
|
|
||
| /** | ||
| * Render the final JSX of AvatarGroup | ||
| */ | ||
| export const renderAvatarGroup_unstable = (state: AvatarGroupState) => { | ||
| const { slots, slotProps } = getSlots<AvatarGroupSlots>(state); | ||
| const { layout, size } = state; | ||
|
|
||
| // TODO Add additional slots in the appropriate place | ||
| return <slots.root {...slotProps.root} />; | ||
| return ( | ||
| <AvatarGroupContext.Provider value={{ layout, size }}> | ||
| <slots.root {...slotProps.root}> | ||
| {state.root.children} | ||
| {state.hasOverflow && slots.overflowButton && slots.overflowSurface && slots.overflowList && ( | ||
| <Popover trapFocus size="small"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might also need a slot for this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since |
||
| <PopoverTrigger> | ||
| <Tooltip content={state.tooltipContent} relationship="label"> | ||
| <slots.overflowButton {...slotProps.overflowButton} /> | ||
| </Tooltip> | ||
| </PopoverTrigger> | ||
| <slots.overflowSurface {...slotProps.overflowSurface}> | ||
| <AvatarGroupContext.Provider value={{ isOverflow: true, layout, size: 24 }}> | ||
| <slots.overflowList {...slotProps.overflowList} /> | ||
| </AvatarGroupContext.Provider> | ||
| </slots.overflowSurface> | ||
| </Popover> | ||
| )} | ||
| </slots.root> | ||
| </AvatarGroupContext.Provider> | ||
| ); | ||
| }; | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.