Skip to content

Commit 3e8325f

Browse files
authored
fix: sign-in advanced option focus UI fix (#1083)
refactor: fontWeight condition using isEmpty variable fix: sign-in advanced option focus UI fix
1 parent ceca0bb commit 3e8325f

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

examples/SampleApp/src/screens/AdvancedUserSelectorScreen.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,29 @@ export const LabeledTextInput: React.FC<LabeledTextInputProps> = ({
6464
}) => {
6565
const {
6666
theme: {
67-
colors: { accent_red, black, grey, white_smoke },
67+
colors: { accent_blue, accent_red, black, grey, white_smoke },
6868
},
6969
} = useTheme();
70+
const [borderColor, setBorderColor] = useState(white_smoke);
71+
72+
const onFocus = () => {
73+
setBorderColor(accent_blue);
74+
};
75+
76+
const onBlur = () => {
77+
setBorderColor(white_smoke);
78+
};
79+
80+
const isEmpty = value === undefined;
81+
7082
return (
7183
<View
7284
style={[
7385
styles.labelTextContainer,
7486
{
7587
backgroundColor: white_smoke,
88+
borderColor,
89+
borderWidth: 1,
7690
paddingVertical: !!value || !!error ? 16 : 8,
7791
},
7892
]}
@@ -102,13 +116,18 @@ export const LabeledTextInput: React.FC<LabeledTextInputProps> = ({
102116
</Text>
103117
)}
104118
<TextInput
119+
onBlur={onBlur}
105120
onChangeText={onChangeText}
121+
onFocus={onFocus}
106122
placeholder={label}
107123
placeholderTextColor={grey}
108124
returnKeyType='next'
109125
style={[
110126
styles.input,
111-
{ color: black, fontWeight: value ? undefined : '500' }, // design team wanted placeholder fontWeight of 500
127+
{
128+
color: black,
129+
fontWeight: isEmpty ? '500' : 'normal',
130+
}, // design team wanted placeholder fontWeight of 500
112131
]}
113132
value={value}
114133
/>

0 commit comments

Comments
 (0)