Files
ProcureLinc-Mobile-App/src/Component/PrimaryButton/PrimaryButton.tsx
T

68 lines
1.5 KiB
TypeScript

import { StyleSheet, Text, TouchableOpacity, View, ViewStyle } from 'react-native';
import React from 'react';
import LinearGradient from 'react-native-linear-gradient';
import colors from '../../Constant/Color';
type PrimaryButtonProps = {
title: string;
onPress: () => void | any;
style?: ViewStyle;
disabled?: boolean;
};
const PrimaryButton: React.FC<PrimaryButtonProps> = ({ title, onPress, style, disabled }) => {
return (
<View
style={[styles.primaryButton, style]}
>
<TouchableOpacity
style={styles.touchable}
onPress={onPress}
activeOpacity={0.82}
disabled={disabled}
>
<Text style={styles.buttonText}>{title}</Text>
</TouchableOpacity>
</View>
);
};
export default PrimaryButton;
const styles = StyleSheet.create({
primaryButton: {
borderRadius: 14,
paddingVertical: 16,
paddingHorizontal: 28,
marginBottom: 20,
minHeight: 54,
// Orange-themed shadows
shadowColor: colors.primary,
shadowOffset: { width: 0, height: 6 },
shadowOpacity: 0.3,
shadowRadius: 12,
elevation: 10,
overflow: 'hidden',
},
touchable: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
buttonText: {
textAlign: 'center',
color: colors.white,
fontWeight: '800', // Extra bold for orange contrast
fontSize: 16,
letterSpacing: 0.3,
textShadowColor: 'rgba(0,0,0,0.2)',
textShadowOffset: { width: 0, height: 1 },
textShadowRadius: 2,
includeFontPadding: false,
},
});