Answered step by step
Verified Expert Solution
Question
1 Approved Answer
App.js : import { Text, SafeAreaView, StyleSheet } from 'react - native'; import { Card } from 'react - native - paper'; import AssetExample from
App.js : import Text, SafeAreaView, StyleSheet from 'reactnative';
import Card from 'reactnativepaper';
import AssetExample from componentsAssetExample;
import Category from componentsCategory;
export default function App
return
Welcome to POG
Fresh, High Quality Produce
;
const styles StyleSheet.create
container:
flex:
justifyContent: 'center',
backgroundColor: #ecff
padding:
headerTitle:
margin:
fontSize:
fontWeight: 'bold',
textAlign: 'center',
subTitle:
margin:
fontSize:
fontWeight: 'bold',
textAlign: 'center',
;
ComponentCategoryjs
import React, useState from 'react';
import View, Text, Image, StyleSheet,Button from 'reactnative';
import Picker from @reactnativepickerpicker;
export default function Category
const selectedFruit setSelectedFruit useStateselect;
const selectedQuantity setSelectedQuantity useStatequantity;
const totalPrice setTotalPrice useState;
const fruitPrices
apple:
banana:
orange:
grapes:
mango:
;
const addToBasket
const price fruitPricesselectedFruit;
const subtotal price selectedQuantity;
const newTotalPrice totalPrice subtotal;
setTotalPricenewTotalPrice;
console.logAdding $selectedQuantity $selectedFruits to the basket. Total cost: $$newTotalPrice;
You can implement the functionality to add to basket here
;
return
Fruits
setSelectedFruititemValue
setSelectedQuantityitemValue
Total Price: $totalPricetoFixed
;
const styles StyleSheet.create
fruits:
width:
height:
borderTopLeftRadius:
borderTopRightRadius:
title:
fontSize:
fontWeight: 'bold',
textAlign: 'center',
paddingVertical:
;
import Text, View, StyleSheet, Image from 'reactnative';
export default function AssetExample
return
;
const styles StyleSheet.create
container:
alignItems: 'center',
justifyContent: 'center',
padding:
backgroundColor: #ecff
borderColor: #ecff
logo:
height:
width:
marginBottom:
;
AssetExample.js
import Text, View, StyleSheet, Image from 'reactnative';
export default function AssetExample
return
;
const styles StyleSheet.create
container:
alignItems: 'center',
justifyContent: 'center',
padding:
backgroundColor: #ecff
borderColor: #ecff
logo:
height:
width:
marginBottom:
;
How do I enter this code into snack expo?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started