@ledvance/base 1.3.27 → 1.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/TextField.tsx +3 -1
- package/src/hooks/Hooks.ts +8 -2
- package/src/i18n/strings.ts +6490 -6490
- package/src/models/modules/NativePropsSlice.tsx +1 -1
- package/src/utils/common.ts +38 -0
package/package.json
CHANGED
|
@@ -13,11 +13,13 @@ interface TextFieldProps extends TextInputProps {
|
|
|
13
13
|
errorText?: string
|
|
14
14
|
tipIcon?: ImageSourcePropType
|
|
15
15
|
tipColor?: string
|
|
16
|
+
editable?: boolean
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
const TextField = (props: TextFieldProps) => {
|
|
19
20
|
const icon = props.tipIcon || res.ic_warning_amber
|
|
20
21
|
const color = props.tipColor || props.theme?.global.warning
|
|
22
|
+
const editable = props.editable ?? !props.editable
|
|
21
23
|
|
|
22
24
|
const styles = StyleSheet.create({
|
|
23
25
|
topTip: {
|
|
@@ -69,7 +71,7 @@ const TextField = (props: TextFieldProps) => {
|
|
|
69
71
|
<Text style={[styles.topTip, { opacity: (!!props.value) ? 1 : 0 }]}>{props.placeholder}</Text>
|
|
70
72
|
<View style={styles.textInputGroup}>
|
|
71
73
|
<TextInput{...props} style={styles.textInput} />
|
|
72
|
-
{!!props.value &&
|
|
74
|
+
{!!props.value && editable &&
|
|
73
75
|
<TouchableOpacity
|
|
74
76
|
style={styles.iconTouchable}
|
|
75
77
|
onPress={() => {
|
package/src/hooks/Hooks.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRoute } from '@react-navigation/core'
|
|
1
|
+
import { useRoute, useNavigation } from '@react-navigation/core'
|
|
2
2
|
|
|
3
3
|
export function createParams<T>(params: T): T {
|
|
4
4
|
return { ...params }
|
|
@@ -6,4 +6,10 @@ export function createParams<T>(params: T): T {
|
|
|
6
6
|
|
|
7
7
|
export function useParams<T extends any>(): T {
|
|
8
8
|
return useRoute().params as T
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function useCurrentPage(routeName: string): boolean {
|
|
12
|
+
const navigation = useNavigation()
|
|
13
|
+
const { index, routes} = navigation.getState()
|
|
14
|
+
return routeName === routes[index].name
|
|
15
|
+
}
|