Skip to content

Commit

Permalink
fix: consolidate TouchableOpacity and FlatList imports across co… (#1383
Browse files Browse the repository at this point in the history
)

Signed-off-by: Jean-Christophe Drouin <[email protected]>
  • Loading branch information
jcdrouin21 authored Jan 9, 2025
1 parent 2a30b6a commit bd408eb
Show file tree
Hide file tree
Showing 10 changed files with 1,589 additions and 1,477 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { LegacyBrandingOverlay } from '@hyperledger/aries-oca'
import { CredentialOverlay } from '@hyperledger/aries-oca/build/legacy'
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Image, ImageBackground, StyleSheet, Text, View, ViewStyle, useWindowDimensions } from 'react-native'
import { TouchableOpacity } from 'react-native-gesture-handler'
import { Image, ImageBackground, StyleSheet, Text, View, ViewStyle, useWindowDimensions, TouchableOpacity } from 'react-native'

import { TOKENS, useServices } from '../../container-api'
import { useTheme } from '../../contexts/theme'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
View,
ViewStyle,
useWindowDimensions,
TouchableOpacity
} from 'react-native'
import { TouchableOpacity } from 'react-native-gesture-handler'
import Icon from 'react-native-vector-icons/MaterialIcons'

import { TOKENS, useServices } from '../../container-api'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react'
import { StyleSheet, Text, View } from 'react-native'
import { TouchableOpacity } from 'react-native-gesture-handler'
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native'
import Icon from 'react-native-vector-icons/MaterialIcons'

import { useTheme } from '../../contexts/theme'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Image, StyleSheet, Text, useWindowDimensions, View } from 'react-native'
import { TouchableOpacity } from 'react-native-gesture-handler'
import { Image, StyleSheet, Text, useWindowDimensions, View, TouchableOpacity } from 'react-native'
import { useTheme } from '../../../contexts/theme'

interface CredentialRowCardProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useMemo } from 'react'
import { TouchableOpacity } from 'react-native-gesture-handler'
import { CredentialDisplay, DisplayImage } from '../types'
import { useTranslation } from 'react-i18next'
import { GenericFn } from '../../../types/fn'
Expand All @@ -12,6 +11,7 @@ import {
useWindowDimensions,
View,
ViewStyle,
TouchableOpacity
} from 'react-native'
import { testIdWithKey } from '../../../utils/testable'
import { credentialTextColor, toImageSource } from '../../../utils/credential'
Expand Down
19 changes: 11 additions & 8 deletions packages/legacy/core/App/screens/AutoLock.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Pressable, StyleSheet, Text, View } from 'react-native'
import { Pressable, StyleSheet, Text, View, FlatList } from 'react-native'
import BouncyCheckbox from 'react-native-bouncy-checkbox'
import { SafeAreaView } from 'react-native-safe-area-context'
import Icon from 'react-native-vector-icons/MaterialIcons'
Expand All @@ -7,18 +7,21 @@ import { testIdWithKey } from '../utils/testable'
import { useStore } from '../contexts/store'
import { DispatchAction } from '../contexts/reducers/store'
import React from 'react'
import { FlatList } from 'react-native-gesture-handler'

import { useTranslation } from 'react-i18next'
import { useTheme } from '../contexts/theme'

type AutoLockListItem = {
title: string
selected: boolean
value: (typeof AutoLockTime)[keyof typeof AutoLockTime]
testID: string
onPress: (val: (typeof AutoLockTime)[keyof typeof AutoLockTime]) => void
}

type LockoutRowProps = AutoLockListItem & {
selected: boolean
}

const AutoLock: React.FC = () => {
const { t } = useTranslation()
const [store, dispatch] = useStore()
Expand Down Expand Up @@ -56,7 +59,7 @@ const AutoLock: React.FC = () => {
})
}

const LockoutRow: React.FC<AutoLockListItem> = ({ title, value, selected, testID, onPress }) => (
const LockoutRow: React.FC<LockoutRowProps> = ({ title, value, selected, testID, onPress }) => (
<View style={[styles.section, styles.sectionRow]}>
<Text style={TextTheme.title}>{title}</Text>
<Pressable
Expand Down Expand Up @@ -89,25 +92,25 @@ const AutoLock: React.FC = () => {
{
title: t('AutoLockTimes.FiveMinutes'),
value: AutoLockTime.FiveMinutes,
testId: `auto-lock-time-${AutoLockTime.FiveMinutes}`,
testID: `auto-lock-time-${AutoLockTime.FiveMinutes}`,
onPress: handleTimeoutChange,
},
{
title: t('AutoLockTimes.ThreeMinutes'),
value: AutoLockTime.ThreeMinutes,
testId: `auto-lock-time-${AutoLockTime.ThreeMinutes}`,
testID: `auto-lock-time-${AutoLockTime.ThreeMinutes}`,
onPress: handleTimeoutChange,
},
{
title: t('AutoLockTimes.OneMinute'),
value: AutoLockTime.OneMinute,
testId: `auto-lock-time-${AutoLockTime.OneMinute}`,
testID: `auto-lock-time-${AutoLockTime.OneMinute}`,
onPress: handleTimeoutChange,
},
{
title: t('AutoLockTimes.Never'),
value: AutoLockTime.Never,
testId: `auto-lock-time-${AutoLockTime.Never}`,
testID: `auto-lock-time-${AutoLockTime.Never}`,
onPress: handleTimeoutChange,
},
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,71 +13,87 @@ exports[`CredentialCard11ActionFooter Component Matches snapshot 1`] = `
}
/>
<View>
<RNGestureHandlerButton
<View
accessibilityState={
Object {
"busy": undefined,
"checked": undefined,
"disabled": undefined,
"expanded": undefined,
"selected": undefined,
}
}
accessibilityValue={
Object {
"max": undefined,
"min": undefined,
"now": undefined,
"text": undefined,
}
}
accessible={true}
collapsable={false}
onGestureEvent={[Function]}
onGestureHandlerEvent={[Function]}
onGestureHandlerStateChange={[Function]}
onHandlerStateChange={[Function]}
rippleColor={0}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
Object {
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"justifyContent": "center",
"opacity": 1,
}
}
testID="com.ariesbifold:id/test"
>
<View
accessible={true}
collapsable={false}
<Text
style={
Object {
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"justifyContent": "center",
"opacity": 1,
"color": "#FFFFFF",
"fontSize": 20,
"fontWeight": "bold",
}
}
>
<Text
style={
sample
</Text>
<Text
allowFontScaling={false}
selectable={false}
style={
Array [
Object {
"color": "#FFFFFF",
"fontSize": 20,
"fontWeight": "bold",
}
}
>
sample
</Text>
<Text
allowFontScaling={false}
selectable={false}
style={
"color": undefined,
"fontSize": 12,
},
Array [
Object {
"color": undefined,
"fontSize": 12,
"color": "#FFFFFF",
"fontSize": 20,
"fontWeight": "bold",
},
Array [
Object {
"color": "#FFFFFF",
"fontSize": 20,
"fontWeight": "bold",
},
Object {
"fontSize": 25,
},
],
Object {
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
"fontSize": 25,
},
Object {},
]
}
>
</Text>
</View>
</RNGestureHandlerButton>
],
Object {
"fontFamily": "Material Icons",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
</View>
</View>
</View>
`;
Loading

0 comments on commit bd408eb

Please sign in to comment.