Skip to content

Commit 4671ad6

Browse files
committed
fix tests that expect Icon to have onPress
1 parent 5aa226a commit 4671ad6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

boilerplate/app/components/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { isRTL, translate } from "@/i18n"
1111
import { $styles } from "../theme"
1212
import { ExtendedEdge, useSafeAreaInsetsStyle } from "../utils/useSafeAreaInsetsStyle"
13-
import { Icon, IconTypes } from "./Icon"
13+
import { IconTypes, PressableIcon } from "./Icon"
1414
import { Text, TextProps } from "./Text"
1515
import { useAppTheme } from "@/utils/useAppTheme"
1616
import type { ThemedStyle } from "@/theme"
@@ -255,7 +255,7 @@ function HeaderAction(props: HeaderActionProps) {
255255

256256
if (icon) {
257257
return (
258-
<Icon
258+
<PressableIcon
259259
size={24}
260260
icon={icon}
261261
color={iconColor}

boilerplate/app/screens/LoginScreen.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import { observer } from "mobx-react-lite"
22
import { ComponentType, FC, useEffect, useMemo, useRef, useState } from "react"
33
import { TextInput, TextStyle, ViewStyle } from "react-native"
4-
import { Button, Icon, Screen, Text, TextField, TextFieldAccessoryProps } from "../components"
4+
import {
5+
Button,
6+
PressableIcon,
7+
Screen,
8+
Text,
9+
TextField,
10+
TextFieldAccessoryProps,
11+
} from "../components"
512
import { useStores } from "../models"
613
import { AppStackScreenProps } from "../navigators"
714
import type { ThemedStyle } from "@/theme"
@@ -60,7 +67,7 @@ export const LoginScreen: FC<LoginScreenProps> = observer(function LoginScreen(_
6067
() =>
6168
function PasswordRightAccessory(props: TextFieldAccessoryProps) {
6269
return (
63-
<Icon
70+
<PressableIcon
6471
icon={isAuthPasswordHidden ? "view" : "hidden"}
6572
color={colors.palette.neutral800}
6673
containerStyle={props.style}

0 commit comments

Comments
 (0)