updated code with dsc and device binding
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { StyleSheet, Text, TouchableOpacity, ViewStyle } from 'react-native';
|
||||
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';
|
||||
@@ -7,33 +7,25 @@ import colors from '../../Constant/Color';
|
||||
type PrimaryButtonProps = {
|
||||
title: string;
|
||||
onPress: () => void | any;
|
||||
style?: ViewStyle;
|
||||
style?: ViewStyle;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
const PrimaryButton: React.FC<PrimaryButtonProps> = ({ title, onPress, style, disabled }) => {
|
||||
return (
|
||||
<LinearGradient
|
||||
colors={[
|
||||
colors.primary, // #F97316 (Orange)
|
||||
colors.primaryLight, // #FDBA74 (OrangeLight)
|
||||
colors.OrangeLight, // #FDBA74 (backup)
|
||||
colors.OrangeSoft // #FFF3E8 (super soft orange end)
|
||||
]}
|
||||
start={{ x: 0, y: 0 }}
|
||||
end={{ x: 1, y: 1 }}
|
||||
locations={[0.0, 0.4, 0.7, 1.0]}
|
||||
<View
|
||||
|
||||
style={[styles.primaryButton, style]}
|
||||
>
|
||||
<TouchableOpacity
|
||||
<TouchableOpacity
|
||||
style={styles.touchable}
|
||||
onPress={onPress}
|
||||
onPress={onPress}
|
||||
activeOpacity={0.82}
|
||||
disabled={disabled}
|
||||
>
|
||||
<Text style={styles.buttonText}>{title}</Text>
|
||||
</TouchableOpacity>
|
||||
</LinearGradient>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -46,14 +38,14 @@ const styles = StyleSheet.create({
|
||||
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: {
|
||||
|
||||
Reference in New Issue
Block a user