Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
Binary file added docs/.bundle.min.js.map.icloud
Binary file not shown.
1 change: 0 additions & 1 deletion docs/bundle.min.js.map

This file was deleted.

13 changes: 13 additions & 0 deletions src-docs/src/views/avatar/avatar_initials.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,18 @@ export default () => (
initials="En"
initialsLength={2}
/>
<EuiSpacer />
<EuiTitle size="xs">
<h4>Disabled Type</h4>
Comment thread
anuragxxd marked this conversation as resolved.
Outdated
</EuiTitle>
<EuiSpacer />
<EuiAvatar
size="m"
type="space"
name="Disabled Button"
Comment thread
cchaos marked this conversation as resolved.
Outdated
initials="Di"
initialsLength={2}
isDisabled={true}
/>
</div>
);
5 changes: 5 additions & 0 deletions src/components/avatar/_avatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
border-radius: $euiBorderRadius;
}

.euiAvatar--disabled {
Comment thread
anuragxxd marked this conversation as resolved.
Outdated
cursor: not-allowed;
filter: grayscale(100%);
}

// Modifiers for sizing.
$avatarSizing: (
s: (
Expand Down
5 changes: 4 additions & 1 deletion src/components/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export type EuiAvatarProps = Omit<HTMLAttributes<HTMLDivElement>, 'color'> &
type?: EuiAvatarType;
imageUrl?: string;
size?: EuiAvatarSize;
isDisabled?: boolean;
Comment thread
anuragxxd marked this conversation as resolved.
};

export const EuiAvatar: FunctionComponent<EuiAvatarProps> = ({
Expand All @@ -84,6 +85,7 @@ export const EuiAvatar: FunctionComponent<EuiAvatarProps> = ({
name,
size = 'm',
type = 'user',
isDisabled = false,
...rest
}) => {
const visColors = euiPaletteColorBlindBehindText();
Expand All @@ -92,7 +94,8 @@ export const EuiAvatar: FunctionComponent<EuiAvatarProps> = ({
'euiAvatar',
sizeToClassNameMap[size],
typeToClassNameMap[type],
className
className,
isDisabled ? 'euiAvatar--disabled' : ''
Comment thread
anuragxxd marked this conversation as resolved.
Outdated
);

checkValidColor(color);
Expand Down