ebanutsya

This commit is contained in:
2023-10-29 06:54:42 +03:00
parent 0bc1835405
commit cd89a70b17
15 changed files with 346 additions and 88 deletions

View File

@@ -25,10 +25,12 @@ const SearchBar: FC<Props> = ({onSearch, onSupplierProductSelected}) => {
const scannedData = useSelector((state: RootState) => state.scanModal.scannedData);
useEffect(() => {
if (!scannedData) return;
barcodeApi.searchProducts(scannedData).then(setProducts);
barcodeApi.searchProducts(scannedData).then((response) => {
console.log("Response: " + response);
setProducts(response)
});
}, [scannedData]);
const selectProductModalVisible = products.length > 0 && false;
const selectProductModalVisible = products.length > 0;
return (
<View style={styles.container}>
@@ -74,6 +76,7 @@ const styles = StyleSheet.create({
borderRadius: 0,
borderTopRightRadius: responsiveWidth(1),
borderBottomRightRadius: responsiveWidth(1),
paddingHorizontal: responsiveWidth(5)
},
scanImageWrapper: {
paddingHorizontal: responsiveWidth(1),
@@ -85,14 +88,13 @@ const styles = StyleSheet.create({
},
textInput: {
height: responsiveHeight(height),
flex: 2,
flex: 1,
borderWidth: 1,
borderColor: "#A5A5A5",
borderTopLeftRadius: responsiveWidth(1),
borderBottomLeftRadius: responsiveWidth(1),
paddingLeft: responsiveHeight(2),
fontSize: RFPercentage(2),
// fontFamily: 'SF Pro Text'
}
})