Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions app/product/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { allProducts } from '../../constants/products';
import { useCart } from '../../context/CartContext';
import Emoji from '../../components/Emoji';

const CURRENCY_CODE = 'USD';

export default function ProductDetailScreen() {
const router = useRouter();
const { id } = useLocalSearchParams<{ id: string }>();
Expand Down Expand Up @@ -61,7 +63,7 @@ export default function ProductDetailScreen() {
<View
style={[
styles.badge,
product.badge === 'RARE'
product.badge === 'RARE' || product.badge === 'COMMON'
? styles.badgeRare
: product.badge === 'NEW'
? styles.badgeNew
Expand All @@ -83,7 +85,7 @@ export default function ProductDetailScreen() {

{/* Details */}
<View style={styles.detailsSection}>
<Text style={styles.sectionTitle}>SPECIMEN DETAILS</Text>
<Text style={styles.sectionTitle}>DETAILS</Text>
<View style={styles.detailRow}>
<Text style={styles.detailLabel}>Category</Text>
<Text style={styles.detailValue}>{product.category}</Text>
Expand Down Expand Up @@ -130,7 +132,9 @@ export default function ProductDetailScreen() {
<View style={styles.footer}>
<View style={styles.footerPrice}>
<Text style={styles.footerPriceLabel}>Price</Text>
<Text style={styles.footerPriceValue}>${product.price.toFixed(2)}</Text>
<Text style={styles.footerPriceValue}>
${product.price.toFixed(2)} {CURRENCY_CODE}
</Text>
</View>
<TouchableOpacity
style={styles.addToCartBtn}
Expand Down
4 changes: 2 additions & 2 deletions constants/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ export type Product = {
name: string;
price: number;
emoji: string;
badge?: 'RARE' | 'NEW' | 'HOT';
badge?: 'COMMON' | 'RARE' | 'NEW' | 'HOT';
category: string;
description: string;
};

export const allProducts: Product[] = [
{ id: 1, name: 'Hercules Beetle', price: 45.00, emoji: '🪲', badge: 'RARE', category: 'Beetles', description: 'The mightiest of all beetles. Known for its incredible horn and strength. A true collector\'s specimen.' },
{ id: 1, name: 'Hercules Beetle', price: 45.00, emoji: '🪲', badge: 'COMMON', category: 'Beetles', description: 'The mightiest of all beetles. Known for its incredible horn and strength. A true collector\'s specimen.' },
{ id: 2, name: 'Blue Morpho', price: 28.50, emoji: '🦋', category: 'Butterflies', description: 'Iridescent blue wings that shimmer in the light. One of the most beautiful butterflies in the world.' },
{ id: 3, name: 'Orchid Mantis', price: 62.00, emoji: '🦗', category: 'Crawlers', description: 'Masters of disguise. This stunning mantis mimics orchid petals to lure prey. Premium specimen.' },
{ id: 4, name: 'Gold Tortoise', price: 18.00, emoji: '🐞', badge: 'NEW', category: 'Beetles', description: 'A tiny golden jewel. This beetle can change color from gold to reddish-brown. Freshly collected.' },
Expand Down