Skip to content

Commit 18706c8

Browse files
authored
fix: android search icon color (storybookjs#688)
1 parent 08be202 commit 18706c8

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

packages/react-native-ui/src/Search.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,17 @@ const options = {
3939
],
4040
} as IFuseOptions<SearchItem>;
4141

42-
const SearchIconWrapper = styled.View(({ theme }) => ({
42+
const SearchIconWrapper = styled.View({
4343
position: 'absolute',
4444
top: 0,
4545
left: 8,
4646
zIndex: 1,
4747
pointerEvents: 'none',
48-
color: theme.textMutedColor,
4948
display: 'flex',
5049
flexDirection: 'row',
5150
alignItems: 'center',
5251
height: '100%',
53-
}));
52+
});
5453

5554
const SearchField = styled.View({
5655
display: 'flex',

packages/react-native-ui/src/icon/SearchIcon.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
import * as React from 'react';
21
import { Path, Svg, SvgProps } from 'react-native-svg';
2+
import { useTheme } from '@storybook/react-native-theming';
33

4-
export const SearchIcon = ({
5-
color = 'currentColor',
6-
width = 14,
7-
height = 14,
8-
...props
9-
}: SvgProps) => {
4+
export const SearchIcon = ({ width = 14, height = 14, ...props }: SvgProps) => {
5+
const theme = useTheme();
106
return (
11-
<Svg width={width} height={height} viewBox="0 0 14 14" fill="none" {...props}>
7+
<Svg width={width} height={height} viewBox="0 0 14 14" fill={theme.color.dark} {...props}>
128
<Path
139
fillRule="evenodd"
1410
clipRule="evenodd"
1511
d="M9.544 10.206a5.5 5.5 0 11.662-.662.5.5 0 01.148.102l3 3a.5.5 0 01-.708.708l-3-3a.5.5 0 01-.102-.148zM10.5 6a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0z"
16-
fill={color}
1712
/>
1813
</Svg>
1914
);

0 commit comments

Comments
 (0)