Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@dooboo-ui/native-edit-text
Advanced tools
[![Npm Version](http://img.shields.io/npm/v/@dooboo-ui/native-edit-text.svg?style=flat-square)](https://npmjs.org/package/@dooboo-ui/native-edit-text) [![Downloads](http://img.shields.io/npm/dm/@dooboo-ui/native-edit-text.svg?style=flat-square)](https://n
[EditText] component is an enhanced version on pure react-native [TextInput] component.
Default | Row | |
---|---|---|
underlined | ||
box |
necessary | types | default | |
---|---|---|---|
testID | string | ||
errorTestID | string | ||
isRow | boolean | false | |
style | StyleProp<ViewStyle> | ||
label | string | ||
labelTextStyle | StyleProp<TextStyle> | ||
value | TextInputProps | ||
inputContainerType | string | underlined | |
inputContainerRadius | string | 3 | |
borderStyle | StyleProp<ViewStyle> | ||
borderWidth | number | 0.6 | |
borderColor | string | #eaeaf9 | |
inputLeftMargin | number | 110 | |
textStyle | StyleProp<TextStyle> | ||
placeholder | string | ||
placeholderTextColor | string | ||
secureTextEntry | boolean | ||
onChangeText | (e) => {} | ||
onSubmitEditing | func | ||
leftElement | ReactElement | ||
leftElementStyle | StyleProp<ViewStyle> | ||
rightElement | ReactElement | ||
rightElementStyle | StyleProp<ViewStyle> | ||
textInputProps | TextInputProps | ||
errorText | string | ||
errorTextStyle | StyleProp<TextStyle> |
yarn add @dooboo-ui/native
or
yarn add @dooboo-ui/native-edit-text
Import
import { EditText } from '@dooboo-ui/native';
// or
import EditText from '@dooboo-ui/native-edit-text';
Usage
function Page(props: Props) {
const validateEmail = (email: string) => {
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
};
const fontStyle: TextStyle = {
fontWeight: 'bold',
fontSize: 13,
};
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [errorEmail, setErrorEmail] = useState('');
const onSignIn = () => {
if (!validateEmail(email)) {
setErrorEmail('Not a valid email address');
} else {
setErrorEmail('');
}
};
const onTextChanged = (type: string, text: string) => {
type === 'EMAIL' ? setEmail(text) : setPassword(text);
if (type === 'EMAIL' && text === '') {
setErrorEmail('');
}
};
return (
<StyledScrollView
contentContainerStyle={{
marginTop: 8,
paddingHorizontal: 20,
paddingBottom: 40,
}}
>
<Container>
<HeaderTitle>Sign in with Email</HeaderTitle>
<EditText
testID="EMAIL_INPUT"
textStyle={{
color: '#495057',
}}
label="Email"
placeholder="Write email address"
placeholderTextColor="#ADB5BD"
value={email}
onChangeText={(text: string) => onTextChanged('EMAIL', text)}
style={{ marginTop: 50 }}
errorText={errorEmail}
onSubmitEditing={onSignIn}
/>
<EditText
testID="PASSWORD_INPUT"
textStyle={{
color: '#ADB5BD',
}}
secureTextEntry={true}
label="Password"
placeholder="Please write your password"
placeholderTextColor="#ADB5BD"
value={password}
onChangeText={(text: string) => onTextChanged('PASSWORD', text)}
style={{ marginTop: 36 }}
onSubmitEditing={onSignIn}
/>
<StyledSignInButton
testID="btnEmail"
onClick={() => onSignIn()}
textStyle={fontStyle}
text="Login"
/>
{/* Email SignUp text */}
<View
style={{
marginTop: 20,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
}}
>
<StyledText testID="NO_ACCOUNT">
Do not have and account?{' '}
</StyledText>
<TouchableOpacity onPress={() => null} style={{ padding: 4 }}>
<StyledAccentText>Find</StyledAccentText>
</TouchableOpacity>
</View>
</Container>
</StyledScrollView>
);
}
FAQs
[![Npm Version](http://img.shields.io/npm/v/@dooboo-ui/native-edit-text.svg?style=flat-square)](https://npmjs.org/package/@dooboo-ui/native-edit-text) [![Downloads](http://img.shields.io/npm/dm/@dooboo-ui/native-edit-text.svg?style=flat-square)](https://n
The npm package @dooboo-ui/native-edit-text receives a total of 0 weekly downloads. As such, @dooboo-ui/native-edit-text popularity was classified as not popular.
We found that @dooboo-ui/native-edit-text demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.