Skip to content

Commit

Permalink
Merge pull request #337 from JayaShakthi97/fix-avatar
Browse files Browse the repository at this point in the history
fix(react): fix style inconsistency in Header component
  • Loading branch information
JayaShakthi97 authored Feb 7, 2025
2 parents f2e9b0e + cb18225 commit cceb11a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
14 changes: 11 additions & 3 deletions packages/react/src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,18 @@ const Avatar: OverridableComponent<AvatarTypeMap<AvatarProps>> = forwardRef(

const {color} = usePastelColorGenerator(colorRandomizer);

const classes: string = clsx('oxygen-avatar', className);

return (
<MuiAvatar ref={ref} className={classes} sx={{bgcolor: randomBackgroundColor ? color : undefined}} {...rest}>
<MuiAvatar
ref={ref}
className={clsx(
/* @deprecated Use `OxygenAvatar-root` instead. https://github.com/wso2/oxygen-ui/issues/274 */
'oxygen-avatar',
'OxygenAvatar-root',
className,
)}
sx={{bgcolor: randomBackgroundColor ? color : undefined}}
{...rest}
>
{children}
</MuiAvatar>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Avatar/avatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
* under the License.
*/

.oxygen-avatar {
/* Add Styles */
.OxygenAvatar-root {
text-transform: capitalize;
}
1 change: 0 additions & 1 deletion packages/react/src/components/Header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
.image {
width: 2.2rem;
height: 2.2rem;
text-transform: capitalize;
}
}

Expand Down

0 comments on commit cceb11a

Please sign in to comment.