1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-01 21:57:06 +01:00
metamask-extension/ui/components/component-library/avatar-with-badge
Nidhi Kumari 0fe3633e4d
Added AvatarBadge component (#15676)
* avatar badge component added

* resolved conflicts

* added badge prop

* updated avatar badge children/badge props

* updated badge token size to be 16px

* added AvatarBadge Test component

* added avatar badge test

* updated avatarBadge props

* added Readme and test files to AvatarWithBadge Component

* resolved conflicts

* removed unused change

* updated badge and badge props

* updated avatar badge stories

* updated constants for avatar badge

* updated avatar badge test

* replaced avatar-badge with avatar-with-badge

* updated avatar badge tests

* updated test for badgeProps
2022-10-12 23:49:12 +05:30
..
avatar-with-badge.constants.js Added AvatarBadge component (#15676) 2022-10-12 23:49:12 +05:30
avatar-with-badge.js Added AvatarBadge component (#15676) 2022-10-12 23:49:12 +05:30
avatar-with-badge.scss Added AvatarBadge component (#15676) 2022-10-12 23:49:12 +05:30
avatar-with-badge.stories.js Added AvatarBadge component (#15676) 2022-10-12 23:49:12 +05:30
avatar-with-badge.test.js Added AvatarBadge component (#15676) 2022-10-12 23:49:12 +05:30
index.js Added AvatarBadge component (#15676) 2022-10-12 23:49:12 +05:30
README.mdx Added AvatarBadge component (#15676) 2022-10-12 23:49:12 +05:30

import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';

import { AvatarWithBadge } from './avatar-with-badge';

# AvatarWithBadge

The `AvatarWithBadge` is a wrapper component that adds badge display options to avatars.

<Canvas>
  <Story id="ui-components-component-library-avatar-with-badge-avatar-with-badge-stories-js--default-story" />
</Canvas>

## Props

The `AvatarWithBadge` accepts all props below 

<ArgsTable of={AvatarWithBadge} />

### Badge Position

Use the `badgePosition` prop to set the position of the badge, it can have two values `Top` and `Bottom`

<Canvas>
  <Story id="ui-components-component-library-avatar-with-badge-avatar-with-badge-stories-js--badge-positions" />
</Canvas>

### Badge

Used to define the badge component to be rendered inside the `AvatarWithBadge`

### Badge Props

The required props to be passed to the badge.

### Children

The children to be rendered inside the AvatarWithBadge. Generally used with the `AvatarAccount`