Skip to content

Commit 5b12889

Browse files
committed
Update compact receipt spacing and hover color
1 parent bfc83a8 commit 5b12889

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/components/ReceiptEmptyState.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {FileObject} from '@src/types/utils/Attachment';
1111

1212
import type {StyleProp, ViewStyle} from 'react-native';
1313

14-
import React, {useEffect, useRef} from 'react';
14+
import React, {useEffect, useRef, useState} from 'react';
1515
import {View} from 'react-native';
1616
import Svg, {Path} from 'react-native-svg';
1717

@@ -88,6 +88,7 @@ function ReceiptEmptyState({
8888
const {translate} = useLocalize();
8989
const theme = useTheme();
9090
const isLoadedRef = useRef(false);
91+
const [isHovered, setIsHovered] = useState(false);
9192
const icons = useMemoizedLazyExpensifyIcons(['Receipt', 'ReceiptPlus']);
9293

9394
const {validateFiles, PDFValidationComponent, ErrorModal} = useFilesValidation(setReceiptFile);
@@ -131,15 +132,17 @@ function ReceiptEmptyState({
131132
disabled={disabled}
132133
disabledStyle={styles.cursorDefault}
133134
hoverStyle={onPress && isCompact ? styles.hoveredComponentBG : undefined}
135+
onHoverIn={onPress && isCompact ? () => setIsHovered(true) : undefined}
136+
onHoverOut={onPress && isCompact ? () => setIsHovered(false) : undefined}
134137
style={containerStyle}
135138
>
136139
{PDFValidationComponent}
137140
{ErrorModal}
138141
{isCompact ? (
139-
<View style={[styles.flexRow, styles.justifyContentCenter, styles.alignItemsCenter, styles.gap3]}>
142+
<View style={[styles.flexRow, styles.justifyContentCenter, styles.alignItemsCenter, styles.gap2]}>
140143
<Icon
141144
src={icons.ReceiptPlus}
142-
fill={theme.icon}
145+
fill={isHovered ? theme.success : theme.icon}
143146
width={variables.iconSizeNormal}
144147
height={variables.iconSizeNormal}
145148
/>

0 commit comments

Comments
 (0)