This commit is contained in:
Avinash Lingaloo
2021-11-30 14:46:21 +04:00
parent 565106b491
commit a778e1f761
8 changed files with 11 additions and 28 deletions

View File

@@ -8,7 +8,7 @@ import FormattedText from '@components/formatted_text';
import {makeStyleSheetFromTheme} from '@utils/theme';
type ErrorProps = {
error: Partial<ClientErrorProps> | string;
error: ErrorText;
testID?: string;
textStyle?: StyleProp<ViewStyle> | StyleProp<TextStyle>;
theme: Theme;

View File

@@ -240,7 +240,6 @@ const FloatingTextInput = forwardRef<FloatingTextInputRef, FloatingTextInputProp
</Animated.Text>
}
<TextInput
{...props}
editable={isKeyboardInput && editable}
style={combinedTextInputStyle}
placeholder=''
@@ -251,6 +250,9 @@ const FloatingTextInput = forwardRef<FloatingTextInputRef, FloatingTextInputProp
onBlur={onTextInputBlur}
ref={inputRef}
underlineColorAndroid='transparent'
autoCorrect={false}
autoCapitalize={'none'}
{...props}
/>
{Boolean(error) && (
<View style={styles.errorContainer}>

View File

@@ -64,13 +64,14 @@ const EmailField = ({authService, email, onChange}: EmailSettingsProps) => {
return (
<Field
fieldDescription={helpText ?? ''}
fieldDescription={helpText}
id='email'
isDisabled={true}
label={FIELDS.email}
onChange={onChange}
testID='edit_profile.text_setting.email'
value={email}
keyboardType='email-address'
/>
);
};

View File

@@ -80,7 +80,7 @@ const Field = ({
theme={theme}
value={value}
/>
{isDisabled && (
{isDisabled && fieldDescription && (
<FieldDescription
text={fieldDescription}
/>

View File

@@ -9,7 +9,7 @@ import {useTheme} from '@context/theme';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
type HelpContentProps = {
text?: string;
text: string;
};
const Description = ({text}: HelpContentProps) => {

View File

@@ -84,7 +84,7 @@ const EditProfile = ({
username: currentUser.username,
});
const [canSave, setCanSave] = useState(false);
const [error, setError] = useState<string | undefined>();
const [error, setError] = useState<ErrorText | undefined>();
const [profileImage] = useState<undefined>();
@@ -180,7 +180,6 @@ const EditProfile = ({
} catch (e) {
resetScreen(e as Error);
}
};
const resetScreen = (resetError: Error) => {
@@ -242,7 +241,7 @@ const EditProfile = ({
innerRef={setScrollViewRef}
testID='edit_profile.scroll_view'
>
{Boolean(error) && <ProfileError error={error}/>}
{Boolean(error) && <ProfileError error={error!}/>}
{renderProfilePicture()}
<Field
id='firstName'

20
package-lock.json generated
View File

@@ -110,7 +110,6 @@
"@types/jest": "27.0.3",
"@types/lodash": "4.14.177",
"@types/react": "17.0.37",
"@types/react-intl": "3.0.0",
"@types/react-native": "0.66.6",
"@types/react-native-button": "3.0.1",
"@types/react-native-share": "3.3.3",
@@ -5585,16 +5584,6 @@
"csstype": "^3.0.2"
}
},
"node_modules/@types/react-intl": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/react-intl/-/react-intl-3.0.0.tgz",
"integrity": "sha512-k8F3d05XQGEqSWIfK97bBjZe4z9RruXU9Wa7OZ2iUC5pdeIpzuQDZe/9C2J3Xir5//ZtAkhcv08Wfx3n5TBTQg==",
"deprecated": "This is a stub types definition. react-intl provides its own type definitions, so you do not need this installed.",
"dev": true,
"dependencies": {
"react-intl": "*"
}
},
"node_modules/@types/react-native": {
"version": "0.66.6",
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.66.6.tgz",
@@ -28713,15 +28702,6 @@
"csstype": "^3.0.2"
}
},
"@types/react-intl": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/react-intl/-/react-intl-3.0.0.tgz",
"integrity": "sha512-k8F3d05XQGEqSWIfK97bBjZe4z9RruXU9Wa7OZ2iUC5pdeIpzuQDZe/9C2J3Xir5//ZtAkhcv08Wfx3n5TBTQg==",
"dev": true,
"requires": {
"react-intl": "*"
}
},
"@types/react-native": {
"version": "0.66.6",
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.66.6.tgz",

View File

@@ -5,3 +5,4 @@ type Dictionary<T> = {
[key: string]: T;
};
type ErrorText = Partial<ClientErrorProps> | string;