diff --git a/main/SelectBox/index.tsx b/main/SelectBox/index.tsx index ed0ac990..f8e88f6f 100644 --- a/main/SelectBox/index.tsx +++ b/main/SelectBox/index.tsx @@ -16,6 +16,7 @@ import {Icon} from '../Icon'; import {TouchableOpacity} from 'react-native-gesture-handler'; import {Typography} from '../Typography'; import styled from '@emotion/native'; +import {useHover} from 'react-native-web-hooks'; import {withTheme} from '@emotion/react'; const Title = styled.View` @@ -45,6 +46,7 @@ type Styles = { rightElementContainer?: StyleProp; itemContainer?: StyleProp; itemText?: StyleProp; + hovered?: StyleProp; }; interface ItemCompProps { value: T; @@ -69,8 +71,11 @@ function ItemComp({ setIsOpened(false); }; + const ref = useRef(null); + const hover = useHover(ref); + return ( - + ({ backgroundColor: theme.textContrast, }, styles?.itemContainer, + hover && {backgroundColor: theme.secondary}, + hover && styles?.hovered, ]} > diff --git a/stories/dooboo-ui/SelectBoxStories/SelectBoxStory.tsx b/stories/dooboo-ui/SelectBoxStories/SelectBoxStory.tsx index 0f372b0b..c36f6d19 100644 --- a/stories/dooboo-ui/SelectBoxStories/SelectBoxStory.tsx +++ b/stories/dooboo-ui/SelectBoxStories/SelectBoxStory.tsx @@ -90,12 +90,15 @@ const SelectBoxStory: FC = () => { borderRightWidth: 0, }, itemContainer: { - backgroundColor: theme.secondary, + backgroundColor: theme.paper, borderTopWidth: 0, borderBottomWidth: 0, borderLeftWidth: 0, borderRightWidth: 0, }, + hovered: { + backgroundColor: theme.secondary, + }, }} />