256 lines
6.4 KiB
TypeScript
256 lines
6.4 KiB
TypeScript
import { StyleSheet } from 'react-native';
|
|
import { typography } from '@theme';
|
|
|
|
export const getStyles = (colors: any) =>
|
|
StyleSheet.create({
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: colors.background,
|
|
},
|
|
loadingContainer: {
|
|
flex: 1,
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
},
|
|
loadingText: {
|
|
marginTop: 12,
|
|
fontSize: typography.fontSize.md,
|
|
color: colors.textSecondary,
|
|
},
|
|
errorContainer: {
|
|
flex: 1,
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
padding: 20,
|
|
},
|
|
errorText: {
|
|
fontSize: typography.fontSize.md,
|
|
color: colors.error,
|
|
textAlign: 'center',
|
|
},
|
|
content: {
|
|
padding: 16,
|
|
paddingBottom: 40,
|
|
},
|
|
section: {
|
|
backgroundColor: colors.cardBg,
|
|
borderRadius: 12,
|
|
padding: 16,
|
|
marginBottom: 16,
|
|
borderWidth: 1,
|
|
borderColor: colors.border,
|
|
},
|
|
// Used for the OrderStatusTimeline section — no inner padding as the
|
|
// component renders its own self-contained card with rounded borders.
|
|
timelineSection: {
|
|
marginBottom: 16,
|
|
},
|
|
sectionTitle: {
|
|
fontSize: typography.fontSize.md,
|
|
fontWeight: typography.fontWeight.bold,
|
|
color: colors.text,
|
|
marginBottom: 12,
|
|
},
|
|
headerRow: {
|
|
flexDirection: 'row',
|
|
justifyContent: 'space-between',
|
|
alignItems: 'center',
|
|
marginBottom: 12,
|
|
},
|
|
orderNumber: {
|
|
fontSize: typography.fontSize.lg,
|
|
fontWeight: typography.fontWeight.bold,
|
|
color: colors.text,
|
|
},
|
|
statusBadge: {
|
|
paddingHorizontal: 10,
|
|
paddingVertical: 4,
|
|
borderRadius: 12,
|
|
backgroundColor: '#E8F5E9',
|
|
},
|
|
statusText: {
|
|
fontSize: typography.fontSize.xs,
|
|
fontWeight: typography.fontWeight.bold,
|
|
color: colors.primary,
|
|
},
|
|
dateText: {
|
|
fontSize: typography.fontSize.sm,
|
|
color: colors.textSecondary,
|
|
marginBottom: 4,
|
|
},
|
|
merchantRow: {
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
marginTop: 8,
|
|
paddingTop: 12,
|
|
borderTopWidth: 1,
|
|
borderTopColor: colors.border,
|
|
},
|
|
merchantIcon: {
|
|
width: 32,
|
|
height: 32,
|
|
borderRadius: 16,
|
|
backgroundColor: colors.surface,
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
marginRight: 12,
|
|
},
|
|
merchantName: {
|
|
fontSize: typography.fontSize.md,
|
|
fontWeight: typography.fontWeight.semibold,
|
|
color: colors.text,
|
|
},
|
|
itemRow: {
|
|
flexDirection: 'row',
|
|
justifyContent: 'space-between',
|
|
alignItems: 'flex-start',
|
|
marginBottom: 12,
|
|
},
|
|
itemInfo: {
|
|
flex: 1,
|
|
flexDirection: 'row',
|
|
alignItems: 'flex-start',
|
|
marginRight: 16,
|
|
},
|
|
itemQuantityBadge: {
|
|
backgroundColor: colors.surface,
|
|
borderWidth: 1,
|
|
borderColor: colors.border,
|
|
borderRadius: 4,
|
|
paddingHorizontal: 6,
|
|
paddingVertical: 2,
|
|
marginRight: 10,
|
|
marginTop: 2,
|
|
},
|
|
itemQuantityText: {
|
|
fontSize: typography.fontSize.xs,
|
|
fontWeight: typography.fontWeight.bold,
|
|
color: colors.text,
|
|
},
|
|
itemName: {
|
|
fontSize: typography.fontSize.sm,
|
|
color: colors.text,
|
|
lineHeight: 20,
|
|
},
|
|
itemPrice: {
|
|
fontSize: typography.fontSize.sm,
|
|
fontWeight: typography.fontWeight.semibold,
|
|
color: colors.text,
|
|
marginTop: 2,
|
|
},
|
|
billRow: {
|
|
flexDirection: 'row',
|
|
justifyContent: 'space-between',
|
|
marginBottom: 8,
|
|
},
|
|
billLabel: {
|
|
fontSize: typography.fontSize.sm,
|
|
color: colors.textSecondary,
|
|
},
|
|
billValue: {
|
|
fontSize: typography.fontSize.sm,
|
|
color: colors.text,
|
|
fontWeight: typography.fontWeight.medium,
|
|
},
|
|
billDivider: {
|
|
height: 1,
|
|
backgroundColor: colors.border,
|
|
marginVertical: 12,
|
|
},
|
|
billTotalLabel: {
|
|
fontSize: typography.fontSize.md,
|
|
fontWeight: typography.fontWeight.bold,
|
|
color: colors.text,
|
|
},
|
|
billTotalValue: {
|
|
fontSize: typography.fontSize.md,
|
|
fontWeight: typography.fontWeight.bold,
|
|
color: colors.primary,
|
|
},
|
|
addressType: {
|
|
fontSize: typography.fontSize.sm,
|
|
fontWeight: typography.fontWeight.semibold,
|
|
color: colors.text,
|
|
marginBottom: 4,
|
|
},
|
|
addressText: {
|
|
fontSize: typography.fontSize.sm,
|
|
color: colors.textSecondary,
|
|
lineHeight: 20,
|
|
},
|
|
paymentRow: {
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
},
|
|
paymentIcon: {
|
|
marginRight: 8,
|
|
fontSize: 20,
|
|
},
|
|
paymentText: {
|
|
fontSize: typography.fontSize.sm,
|
|
color: colors.text,
|
|
fontWeight: typography.fontWeight.medium,
|
|
},
|
|
|
|
// ── Rating integration ──────────────────────────────────────────────────
|
|
/** Subtle highlight applied to item rows when the order is DELIVERED */
|
|
itemRowTappable: {
|
|
backgroundColor: colors.surface ?? '#F8F9FA',
|
|
borderRadius: 10,
|
|
paddingHorizontal: 10,
|
|
paddingVertical: 8,
|
|
marginHorizontal: -10,
|
|
},
|
|
ratingPillRow: {
|
|
flexDirection: 'row',
|
|
marginTop: 4,
|
|
},
|
|
/** Green "✓ Rated" pill */
|
|
ratedPill: {
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
backgroundColor: (colors.primaryMuted ?? '#E9F7EF'),
|
|
borderRadius: 20,
|
|
paddingHorizontal: 8,
|
|
paddingVertical: 3,
|
|
},
|
|
ratedPillText: {
|
|
fontSize: 11,
|
|
color: colors.primary ?? '#05824C',
|
|
fontWeight: typography.fontWeight.semibold,
|
|
},
|
|
/** Amber "⭐ Rate this" pill */
|
|
ratePill: {
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
backgroundColor: '#FFF8E1',
|
|
borderRadius: 20,
|
|
paddingHorizontal: 8,
|
|
paddingVertical: 3,
|
|
},
|
|
ratePillText: {
|
|
fontSize: 11,
|
|
color: '#F59E0B',
|
|
fontWeight: typography.fontWeight.semibold,
|
|
},
|
|
/** Banner shown at the top of Order Items when DELIVERED */
|
|
rateHintBanner: {
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
backgroundColor: '#FFF8E1',
|
|
borderRadius: 10,
|
|
paddingHorizontal: 12,
|
|
paddingVertical: 10,
|
|
marginBottom: 14,
|
|
},
|
|
rateHintEmoji: {
|
|
fontSize: 16,
|
|
marginRight: 8,
|
|
},
|
|
rateHintText: {
|
|
fontSize: typography.fontSize.sm,
|
|
color: '#92400E',
|
|
fontWeight: typography.fontWeight.medium,
|
|
},
|
|
});
|