import React, { ReactElement } from 'react'; import { Pressable, Text, StyleSheet, ViewStyle, StyleProp, View } from 'react-native'; interface NormalButtonProps { title: ReactElement; extendedStyle?: StyleProp; onPress: () => void; disabled?: boolean; buttonPressedStyle?: StyleProp; } const NormalButton: React.FC = ({ title, extendedStyle, onPress, disabled, buttonPressedStyle }) => { return ( [ // pressed ? buttonPressedStyle || styles.buttonPressed : null, // extendedStyle, // ]} > {({ pressed }) => ( {title} )} ); }; const styles = StyleSheet.create({ button: { maxWidth: '100%', fontSize: 16, backgroundColor: '#025c72', justifyContent: 'center', alignItems: 'center', borderRadius: 12, padding: 20 }, buttonPressed: { backgroundColor: '#28495c' } }); export default NormalButton; //*************************PLEASE IGNORE BELOW COMMENTS. FOR MY OWN REVIEW ONLY**************************************/ //*************************PLEASE IGNORE BELOW COMMENTS. FOR MY OWN REVIEW ONLY**************************************/ //*************************PLEASE IGNORE BELOW COMMENTS. FOR MY OWN REVIEW ONLY**************************************/ //*************************PLEASE IGNORE BELOW COMMENTS. FOR MY OWN REVIEW ONLY**************************************/ //*************************PLEASE IGNORE BELOW COMMENTS. FOR MY OWN REVIEW ONLY**************************************/ // import React, { ReactElement } from 'react'; // import { Pressable, PressableProps, StyleSheet, TextStyle } from 'react-native'; // interface NormalButtonProps extends PressableProps { // title: ReactElement; // extendedStyle?: TextStyle; // } // //2024-06-06 I modified the button so that it accept a forwarded ref for Navigation // const NormalButton = React.forwardRef< // React.ElementRef, // NormalButtonProps // >(({ title, extendedStyle, onPress, disabled }, ref) => { // return ( // [ // styles.button, // pressed ? styles.buttonPressed : null, // extendedStyle // ]} // > // {title} // // ); // }); // const styles = StyleSheet.create({ // button: { // maxWidth: '100%', // fontSize: 16, // backgroundColor: '#025c72', // justifyContent: 'center', // alignItems: 'center', // borderRadius: 12, // padding: 20 // }, // buttonPressed: { // backgroundColor: '#28495c' // } // }); // export default NormalButton;