Skip to content

Commit 9c2c239

Browse files
committed
chore: code review
1 parent 9cce9ad commit 9c2c239

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

packages/avatars/src/styled/StyledStatusIndicator.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ const colorStyles = ({
6969
$borderColor,
7070
$surfaceColor
7171
}: IStatusIndicatorProps & ThemeProps<DefaultTheme>) => {
72-
let boxShadow = theme.shadows.sm(
73-
$surfaceColor ||
74-
($type
75-
? getColor({ variable: 'background.default', theme })
76-
: (theme.palette.white as string))
77-
);
78-
79-
if ($size === xxs) {
80-
boxShadow = boxShadow.replace(theme.shadowWidths.sm, '1px');
72+
const shadowSize = $size === xxs ? 'xs' : 'sm';
73+
let boxShadow;
74+
75+
if ($type) {
76+
boxShadow = theme.shadows[shadowSize](
77+
$surfaceColor || getColor({ theme, variable: 'background.default' })
78+
);
79+
} else {
80+
boxShadow = theme.shadows[shadowSize]($surfaceColor || (theme.palette.white as string));
8181
}
8282

8383
return css`

packages/avatars/src/styled/StyledStatusIndicatorBase.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,15 @@ const sizeStyles = (props: IStyledStatusIndicatorProps) => {
6969

7070
const colorStyles = ({ theme, $type }: IStyledStatusIndicatorProps) => {
7171
const foregroundColor = getColor({ variable: 'foreground.onEmphasis', theme });
72-
let backgroundColor = getStatusColor(theme, $type);
73-
let borderColor = backgroundColor;
72+
let backgroundColor;
73+
let borderColor;
7474

7575
if ($type === 'offline') {
7676
borderColor = getStatusColor(theme, $type);
7777
backgroundColor = getColor({ variable: 'background.default', theme });
78+
} else {
79+
backgroundColor = getStatusColor(theme, $type);
80+
borderColor = backgroundColor;
7881
}
7982

8083
return css`

0 commit comments

Comments
 (0)