Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>((props, ref)
fallbackImgUrl={props.fallbackImgUrl}
sizes={props.sizes}
srcSet={props.srcSet}
alt={props.alt || title}
loading={props.loading}
withImageBorder={props.withImageBorder}
size={size}
Expand Down
3 changes: 1 addition & 2 deletions src/components/Avatar/AvatarImage/AvatarImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const AvatarImage = ({
fallbackImgUrl,
sizes,
srcSet,
alt,
loading,
withImageBorder,
size,
Expand All @@ -36,8 +35,8 @@ export const AvatarImage = ({
src={fallbackImgUrl && isErrored ? fallbackImgUrl : imgUrl}
sizes={sizes}
srcSet={srcSet}
alt={alt}
onError={handleError}
alt=""
/>
);
};
1 change: 0 additions & 1 deletion src/components/Avatar/AvatarImage/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface AvatarImageProps extends AvatarCommonProps {
fallbackImgUrl?: string;
sizes?: string;
srcSet?: string;
alt?: string;
loading?: 'eager' | 'lazy';
withImageBorder?: boolean;
}
1 change: 0 additions & 1 deletion src/components/Avatar/README-ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ LANDING_BLOCK-->
| fallbackImgUrl | Резервное изображение, отображаемое в случае ошибки. | `string` | |
| sizes | HTML-атрибут `sizes` для `img`. | `string` | |
| srcSet | HTML-атрибут `srcSet` для `img`. | `string` | |
| alt | HTML-атрибут `alt` для `img`. | `string` | props.title |
| loading | HTML-атрибут `loading` для `img`. | `'eager'` `'lazy'` | |
| withImageBorder | Добавляет обводку по умолчанию для изображения | `boolean` | |

Expand Down
17 changes: 8 additions & 9 deletions src/components/Avatar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,14 @@ LANDING_BLOCK-->

### Image-specific

| Name | Description | Type | Default |
| :-------------- | :---------------------------------------- | :----------------: | :---------: |
| imgUrl | `img` `src` HTML attribute | `string` | |
| fallbackImgUrl | Fallback image shown if an error occurred | `string` | |
| sizes | `img` `sizes` HTML attribute | `string` | |
| srcSet | `img` `srcSet` HTML attribute | `string` | |
| alt | `img` `alt` HTML attribute | `string` | props.title |
| loading | `img` `loading` HTML attribute | `'eager'` `'lazy'` | |
| withImageBorder | Add default border for the image | `boolean` | |
| Name | Description | Type | Default |
| :-------------- | :---------------------------------------- | :----------------: | :-----: |
| imgUrl | `img` `src` HTML attribute | `string` | |
| fallbackImgUrl | Fallback image shown if an error occurred | `string` | |
| sizes | `img` `sizes` HTML attribute | `string` | |
| srcSet | `img` `srcSet` HTML attribute | `string` | |
| loading | `img` `loading` HTML attribute | `'eager'` `'lazy'` | |
| withImageBorder | Add default border for the image | `boolean` | |

### Icon-specific

Expand Down
4 changes: 0 additions & 4 deletions src/components/Avatar/__stories__/Avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const randomAvatars = faker.helpers

const imageProps = {
imgUrl,
alt: 'Sample image',
};

const iconProps = {
Expand Down Expand Up @@ -83,7 +82,6 @@ export const Image: Story = {
args: {
imgUrl,
'aria-label': 'Sample avatar',
alt: 'Generated avatar',
},
};

Expand All @@ -102,15 +100,13 @@ export const ImageSrcSet: StoryFunc = (args) => {
ImageSrcSet.args = {
imgUrl: faker.image.urlLoremFlickr({category: 'cats'}),
size: 'xl',
alt: 'Image with srcset',
'aria-label': 'Random avatar',
};

export const ImageFallback: Story = {
args: {
imgUrl: 'random_link',
fallbackImgUrl: imgUrl,
alt: 'Fallbacked image',
'aria-label': 'Fallback demonstration',
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function getChildren({
size={avatarSize}
borderColor={'var(--g-color-line-generic-solid)'}
aria-label={'For tests'}
alt={'For tests'}
/>
),
count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const StartSlot = ({selfStart}: {selfStart?: boolean}) => (
<Flex shrink="0" alignSelf={selfStart ? 'flex-start' : undefined}>
<Avatar
imgUrl="https://avatars.mds.yandex.net/get-yapic/69015/enc-137b8b64288fa6fc5ec58c6b83aea00e7723c8fa5638c078312a1134d8ee32ac/islands-retina-50"
alt="A random image"
aria-label="Sample avatar"
/>
</Flex>
Expand Down
Loading