forked from Ivasoft/mattermost-mobile
ts fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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}>
|
||||
|
||||
@@ -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'
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -80,7 +80,7 @@ const Field = ({
|
||||
theme={theme}
|
||||
value={value}
|
||||
/>
|
||||
{isDisabled && (
|
||||
{isDisabled && fieldDescription && (
|
||||
<FieldDescription
|
||||
text={fieldDescription}
|
||||
/>
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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
20
package-lock.json
generated
@@ -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",
|
||||
|
||||
1
types/utils/index.d.ts
vendored
1
types/utils/index.d.ts
vendored
@@ -5,3 +5,4 @@ type Dictionary<T> = {
|
||||
[key: string]: T;
|
||||
};
|
||||
|
||||
type ErrorText = Partial<ClientErrorProps> | string;
|
||||
|
||||
Reference in New Issue
Block a user