PliWould/app/(tabs)/index.tsx

51 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-06-27 23:31:59 +02:00
import { Image, StyleSheet, Platform, ImageBackground } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
2024-06-27 23:31:59 +02:00
import { MeasurementInput } from '@/components/LengthInput';
import { setupStore, useAppDispatch } from '../store';
import { selectProducts } from '@/features/product/productSlice';
import { Product } from '@/lib/product';
2024-06-28 04:00:29 +02:00
import { ProductTile } from '@/components/ProductTile';
2024-06-27 23:31:59 +02:00
import { Measure, area, length } from 'enheter';
export default function HomeScreen() {
2024-06-27 23:31:59 +02:00
const products = useAppDispatch(selectProducts);
function calculatePrice() {
}
2024-06-27 23:31:59 +02:00
const selectProduct = (product : Product) => {
}
return (
<SafeAreaView>
2024-06-27 23:31:59 +02:00
<MeasurementInput onMeasurementSet={calculatePrice} />
{products.map((product) => {
<ProductTile product={product} onProductSelected={selectProduct} />
})}
</SafeAreaView>
);
}
const styles = StyleSheet.create({
titleContainer: {
flexDirection: 'row',
alignItems: 'center',
gap: 8,
},
stepContainer: {
gap: 8,
marginBottom: 8,
},
reactLogo: {
height: 178,
width: 290,
bottom: 0,
left: 0,
position: 'absolute',
},
});