110 lines
2.7 KiB
TypeScript

import { StyleSheet, Dimensions, Platform } from 'react-native';
import { typography } from '@theme';
const { width } = Dimensions.get('window');
// Screen padding = 16 * 2 = 32
// Gap between cards = 16
// Total cards width = width - 32 - 16 = width - 48
const CARD_WIDTH = (width - 48) / 2;
export const getStyles = (colors: any) =>
StyleSheet.create({
cardContainer: {
width: CARD_WIDTH,
backgroundColor: colors.surface ?? '#FFFFFF',
borderRadius: 12,
marginBottom: 16,
overflow: 'hidden',
...Platform.select({
ios: {
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.05,
shadowRadius: 8,
},
android: { elevation: 2 },
}),
},
imageContainer: {
width: '100%',
height: CARD_WIDTH, // Square image
backgroundColor: colors.background ?? '#F8F9FA',
position: 'relative',
},
image: {
width: '100%',
height: '100%',
resizeMode: 'cover',
},
discountBadge: {
position: 'absolute',
top: 8,
left: 8,
backgroundColor: colors.error ?? '#E53935',
paddingHorizontal: 6,
paddingVertical: 2,
borderRadius: 4,
},
discountText: {
color: '#FFFFFF',
fontSize: 10,
fontWeight: typography.fontWeight.bold,
},
favoriteButton: {
position: 'absolute',
top: 8,
right: 8,
backgroundColor: 'rgba(255,255,255,0.9)',
width: 28,
height: 28,
borderRadius: 14,
alignItems: 'center',
justifyContent: 'center',
},
infoContainer: {
padding: 10,
},
brandText: {
fontSize: 10,
color: colors.textSecondary,
textTransform: 'uppercase',
marginBottom: 2,
fontWeight: typography.fontWeight.semibold,
},
titleText: {
fontSize: 13,
color: colors.text,
fontWeight: typography.fontWeight.medium,
marginBottom: 4,
},
priceRow: {
flexDirection: 'row',
alignItems: 'center',
marginBottom: 8,
},
priceText: {
fontSize: 14,
color: colors.text,
fontWeight: typography.fontWeight.bold,
marginRight: 6,
},
comparePriceText: {
fontSize: 11,
color: colors.textSecondary,
textDecorationLine: 'line-through',
},
addButton: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: colors.primaryMuted ?? '#E9F7EF',
paddingVertical: 6,
borderRadius: 6,
},
addButtonText: {
color: colors.primary ?? '#05824C',
fontSize: 12,
fontWeight: typography.fontWeight.bold,
},
});