Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
showComponent(theme) {
return (
showComponent(theme) {
if (this.checkCustomSignUpFields()) {
this.signUpFields = this.props.signUpConfig.signUpFields;
}
this.sortFields();
return (
<header>{I18n.get(this.header)}</header>
theme={theme}
key={'phone_number'}
onChangeText={text => this.setState({ phone_number: text })}
label={I18n.get('Phone Number')}
placeholder={I18n.get('Enter your phone number')}
keyboardType="phone-pad"
required={true}
/>
);
} else {
return (
this.setState({ username: text })}
label={I18n.get(this.getUsernameLabel())}
placeholder={I18n.get('Enter your username')}
required={true}
/>
);
}
}
if (!unverified) {
logger.debug('no unverified contact');
return null;
}
const { email, phone_number } = unverified;
return React.createElement(
View,
{ style: theme.sectionBody },
React.createElement(
Picker,
{
selectedValue: this.state.pickAttr,
onValueChange: (value, index) => this.setState({ pickAttr: value })
},
email ? React.createElement(Picker.Item, { label: I18n.get('Email'), value: 'email' }) : null,
phone_number ? React.createElement(Picker.Item, { label: I18n.get('Phone Number'), value: 'phone_number' }) : null
),
React.createElement(Button, {
title: I18n.get('Verify'),
onPress: this.verify,
disabled: !this.state.pickAttr
})
);
}
showComponent(theme) {
if (this.checkCustomSignUpFields()) {
this.signUpFields = this.props.signUpConfig.signUpFields;
}
this.sortFields();
return (
<header>{I18n.get(this.header)}</header>
submitBody(theme) {
return (
);
}
render() {
const { authState, hide, federated, onStateChange } = this.props;
if (!['signIn', 'signedOut', 'signedUp'].includes(this.props.authState)) {
return null;
}
const theme = this.props.theme || AmplifyTheme;
return React.createElement(
View,
{ style: theme.section },
React.createElement(
Header,
{ theme: theme },
I18n.get('Sign In')
),
React.createElement(
View,
{ style: theme.sectionBody },
React.createElement(Username, {
theme: theme,
onChangeText: text => this.setState({ username: text })
}),
React.createElement(Password, {
theme: theme,
onChangeText: text => this.setState({ password: text })
}),
React.createElement(Button, {
title: I18n.get('Sign In'),
style: theme.button,
onPress: this.signIn,
{I18n.get('Change')}
this.changeState('signIn')}>
{I18n.get('Back to Sign In')}
)
}
}
const Footer = props => {
const theme = props.theme || AmplifyTheme;
return React.createElement(
View,
{ style: theme.sectionFooter },
React.createElement(
LinkCell,
{ theme: theme, onPress: () => onStateChange('signIn') },
I18n.get('Back to Sign In')
)
);
};