@hoddy-ui/core 1.0.59 → 1.0.60
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 +2 -2
- package/src/Components/TextField.tsx +19 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hoddy-ui/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.60",
|
|
4
4
|
"description": "Core rich react native components written in typescript",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@react-navigation/native": ">=6.1.7",
|
|
17
17
|
"@types/react": "^18.2.6",
|
|
18
18
|
"@types/react-native": "^0.72.0",
|
|
19
|
-
"expo-haptics": "
|
|
19
|
+
"expo-haptics": ">=12.4.0",
|
|
20
20
|
"expo-location": ">=15.1.1",
|
|
21
21
|
"expo-navigation-bar": ">=2.1.1",
|
|
22
22
|
"expo-system-ui": ">=2.2.1",
|
|
@@ -283,7 +283,7 @@ export const TextField2: React.FC<TextFieldProps> = ({
|
|
|
283
283
|
}) => {
|
|
284
284
|
const colors = useColors();
|
|
285
285
|
const [focused, _setFocused] = useState(false);
|
|
286
|
-
|
|
286
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
287
287
|
const labelAnim = useRef(new Animated.Value(0)).current;
|
|
288
288
|
|
|
289
289
|
const height = moderateScale(
|
|
@@ -394,7 +394,7 @@ export const TextField2: React.FC<TextFieldProps> = ({
|
|
|
394
394
|
}
|
|
395
395
|
: type === "password"
|
|
396
396
|
? {
|
|
397
|
-
secureTextEntry:
|
|
397
|
+
secureTextEntry: !showPassword,
|
|
398
398
|
autoCompleteType: "password",
|
|
399
399
|
autoCapitalize: "none",
|
|
400
400
|
textContentType: "password",
|
|
@@ -444,6 +444,7 @@ export const TextField2: React.FC<TextFieldProps> = ({
|
|
|
444
444
|
}}
|
|
445
445
|
value={value}
|
|
446
446
|
onChangeText={onChangeText}
|
|
447
|
+
key={showPassword ? "show" : "hide"}
|
|
447
448
|
keyboardType={keyboardType}
|
|
448
449
|
placeholderTextColor={colors.textSecondary.main}
|
|
449
450
|
editable={!disabled}
|
|
@@ -456,7 +457,22 @@ export const TextField2: React.FC<TextFieldProps> = ({
|
|
|
456
457
|
/>
|
|
457
458
|
)}
|
|
458
459
|
|
|
459
|
-
{end
|
|
460
|
+
{end ? (
|
|
461
|
+
<View style={{ marginRight: 20 }}>{end}</View>
|
|
462
|
+
) : (
|
|
463
|
+
type === "password" && (
|
|
464
|
+
<TouchableOpacity
|
|
465
|
+
style={{ marginRight: 20 }}
|
|
466
|
+
onPress={() => setShowPassword(!showPassword)}
|
|
467
|
+
>
|
|
468
|
+
<Ionicons
|
|
469
|
+
name={showPassword ? "eye-outline" : "eye-off-outline"}
|
|
470
|
+
size={24}
|
|
471
|
+
color={colors.textSecondary.main}
|
|
472
|
+
/>
|
|
473
|
+
</TouchableOpacity>
|
|
474
|
+
)
|
|
475
|
+
)}
|
|
460
476
|
</TouchableOpacity>
|
|
461
477
|
{helperText && (
|
|
462
478
|
<Typography
|