APP-PUSH和纯色小组件
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { View, StyleSheet, TextInput, Platform, Animated, TouchableOpacity, Dimensions, Text } from 'react-native';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { OnboardingColors } from '@/constants/OnboardingTheme';
|
||||
import BtnNotClicked from '@/assets/images/icon/btn_Notclicked.svg';
|
||||
import BtnClicked from '@/assets/images/icon/btn_clicked.svg';
|
||||
@@ -14,6 +15,7 @@ interface NameInputStepProps {
|
||||
}
|
||||
|
||||
export function NameInputStep({ value, onChangeText, onNext }: NameInputStepProps) {
|
||||
const { t } = useTranslation();
|
||||
const [isFocused, setIsFocused] = useState(false);
|
||||
const blinkAnim = useRef(new Animated.Value(1)).current;
|
||||
const hasInput = value.trim().length > 0;
|
||||
@@ -46,7 +48,7 @@ export function NameInputStep({ value, onChangeText, onNext }: NameInputStepProp
|
||||
(!isFocused && !hasInput) && { color: OnboardingColors.textSecondary }
|
||||
]}
|
||||
>
|
||||
{hasInput ? value : (isFocused ? "" : "Mama")}
|
||||
{hasInput ? value : isFocused ? '' : t('onboardingSurvey.steps.name.placeholder')}
|
||||
</Text>
|
||||
{isFocused && (
|
||||
<Animated.View style={[styles.cursorWrapper, { opacity: blinkAnim, marginLeft: 2 }]}>
|
||||
|
||||
Reference in New Issue
Block a user