reza added FormButton

RezaAshrafi77 3 years ago
parent 003561703c
commit eec74305e1
  1. 31
      src/components/FormButton/index.js
  2. 14
      src/views/Home/index.js

@ -0,0 +1,31 @@
import React from 'react';
import {StyleSheet, Text, Pressable, Dimensions } from 'react-native';
export default function FormButton({text, color, onPress}) {
const styles = StyleSheet.create({
button: {
width : '100%',
alignItems: 'center',
justifyContent: 'center',
paddingVertical: 12,
paddingHorizontal: 0,
borderRadius: 6,
elevation: 3,
backgroundColor: color,
},
text: {
fontSize: Dimensions.get('window').width / 25,
fontWeight: '300',
color: 'white',
},
});
return (
<Pressable
color={color}
style={styles.button}
onPress={() => onPress}
>
<Text style={styles.text}>{text}</Text>
</Pressable>
);
}

@ -1,13 +1,17 @@
import React from 'react' import React from 'react';
import { View, Text } from 'react-native'; import {View} from 'react-native';
import {connect} from 'react-redux'; import FormButton from '../../components/FormButton/index.js';
function Home({}) { function Home({}) {
return ( return (
<View> <View>
<Text></Text> <FormButton
text={'ادامه'}
color={'#6CBE44'}
onPress={console.log('reza')}
/>
</View> </View>
) );
} }
export default Home; export default Home;

Loading…
Cancel
Save