2024-06-27 23:31:59 +02:00
|
|
|
import { Image, StyleSheet, Platform, ImageBackground } from 'react-native';
|
2024-06-26 04:20:08 +02:00
|
|
|
|
2024-06-27 16:06:39 +02:00
|
|
|
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';
|
2024-06-26 04:20:08 +02:00
|
|
|
|
|
|
|
export default function HomeScreen() {
|
2024-06-27 16:06:39 +02:00
|
|
|
|
2024-06-27 23:31:59 +02:00
|
|
|
const products = useAppDispatch(selectProducts);
|
2024-06-27 16:06:39 +02:00
|
|
|
|
|
|
|
function calculatePrice() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-06-27 23:31:59 +02:00
|
|
|
const selectProduct = (product : Product) => {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-06-26 04:20:08 +02:00
|
|
|
return (
|
2024-06-27 16:06:39 +02:00
|
|
|
<SafeAreaView>
|
2024-06-27 23:31:59 +02:00
|
|
|
<MeasurementInput onMeasurementSet={calculatePrice} />
|
|
|
|
{products.map((product) => {
|
|
|
|
<ProductTile product={product} onProductSelected={selectProduct} />
|
|
|
|
})}
|
2024-06-27 16:06:39 +02:00
|
|
|
</SafeAreaView>
|
2024-06-26 04:20:08 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
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',
|
|
|
|
},
|
|
|
|
});
|