Skip to content
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

feat(AvatarStack): add component #924

Merged
merged 86 commits into from
Jul 17, 2024
Merged

feat(AvatarStack): add component #924

merged 86 commits into from
Jul 17, 2024

Conversation

ogonkov
Copy link
Contributor

@ogonkov ogonkov commented Aug 21, 2023

No description provided.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@ogonkov ogonkov marked this pull request as ready for review August 22, 2023 09:35
@ogonkov ogonkov marked this pull request as draft August 22, 2023 13:17
src/components/ImageStack/types.ts Outdated Show resolved Hide resolved
src/components/ImageStack/README.md Outdated Show resolved Hide resolved
src/components/ImageStack/ImageStack.tsx Outdated Show resolved Hide resolved
src/components/ImageStack/ImageStack.scss Outdated Show resolved Hide resolved
src/components/ImageStack/types.ts Outdated Show resolved Hide resolved
src/components/ImageStack/ImageStack.tsx Outdated Show resolved Hide resolved
@ogonkov ogonkov marked this pull request as ready for review August 23, 2023 12:01
@ogonkov ogonkov requested a review from DaffPunks as a code owner August 23, 2023 12:01
@ogonkov ogonkov requested a review from amje August 23, 2023 15:04
@ogonkov ogonkov changed the title feat(ImageStack): add component feat(AvatarStack): add component Aug 28, 2023
styles/mixins.scss Outdated Show resolved Hide resolved
src/components/index.ts Show resolved Hide resolved
src/components/UserAvatar/_mixins.scss Outdated Show resolved Hide resolved
styles/mixins.scss Outdated Show resolved Hide resolved
src/components/AvatarStack/AvatarStack.tsx Outdated Show resolved Hide resolved
DaffPunks
DaffPunks previously approved these changes Aug 29, 2023
src/components/AvatarStack/types.ts Show resolved Hide resolved
@DaffPunks DaffPunks dismissed their stale review August 29, 2023 09:17

missclick

@amje
Copy link
Contributor

amje commented Sep 14, 2023

I have some thoughts on this feature:
We are planning to introduce a new universal Avatar component that replaces current UserAvatar component. Avatar will be fully customizable, different shapes, borders, allow badges and also can be a wrapper around any ReactNode, like Icon can. Thus I see AvatarStack component as follow:

It accepts Avatar components as children. "More" item is an Avatar component with custom render and by default will be rendered depending on props max and total. max prop slices passed children, total concats "More" item to passed children:

<AvatarStack max={2}>
  <Avatar/>
  <Avatar/>
  <Avatar/>
  <Avatar/>
</AvatarStack>

<AvatarStack total={25}>
  <Avatar/>
  <Avatar/>
</AvatarStack>

Alternatively, if full control needed we can render "More" item by ourselves:

<AvatarStack>
  <Avatar/>
  <Avatar/>
  <AvatarStack.More render={...}/>
</AvatarStack>

@gravity-ui-bot
Copy link
Contributor

Playwright Test Component is ready.

@ogonkov ogonkov force-pushed the feat/image_stack branch 2 times, most recently from 02a537e to e20f0bb Compare January 29, 2024 21:38
@ogonkov ogonkov requested a review from amje January 29, 2024 23:10
@ogonkov
Copy link
Contributor Author

ogonkov commented Jan 29, 2024

@amje i have changed component API from render props to children mapping. I didn't add max and total props yet, can we do it in separate PR?

@ogonkov ogonkov force-pushed the feat/image_stack branch 3 times, most recently from 88e28e4 to 3d23edd Compare May 20, 2024 19:29
@ogonkov ogonkov requested a review from DakEnviy as a code owner May 20, 2024 20:15
@ogonkov ogonkov force-pushed the feat/image_stack branch from af46e3f to 8e6b0f1 Compare July 17, 2024 08:39
@ogonkov ogonkov merged commit 862f4fb into main Jul 17, 2024
6 checks passed
@ogonkov ogonkov deleted the feat/image_stack branch July 17, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants