Feature/wms 63 - Image upload component (#54)

* Updated: Image component functionality
* Updated: Added accept type support
* Updated: Restrict based on multiple key

Co-authored-by: Llewellyn D'souza <lledsouza2209@gmail.com>
This commit is contained in:
bluestreamlds
2022-02-11 16:26:32 +05:30
committed by GitHub
parent aa3e712ebe
commit ff9ea9c71c
3 changed files with 80 additions and 48 deletions

View File

@@ -22,8 +22,6 @@ const useStyles = makeStyles({
}
});
const previewImg = [1, 2, 3];
const inventoryTypes = ['Perishable', 'Material', 'Product', 'Inventory', 'Fleet'];
function EditWarehouseDetails() {
@@ -46,7 +44,8 @@ function EditWarehouseDetails() {
warehousename: location.state.name,
address: location.state.address,
inventorytype: [],
attributes: ''
attributes: '',
images: []
},
validationSchema: schema.warehouseForm,
onSubmit: (values, onSubmitProps) => {
@@ -185,7 +184,15 @@ function EditWarehouseDetails() {
</Grid>
<Grid item xs={12} sm={6} md={6}>
<Box sx={{ marginTop: '30px' }}>
<ImageUpload heading="Upload Warehouse Image" previewImg={previewImg} />
<ImageUpload
multiple
heading="Upload Warehouse Image"
accept="image/*"
images={formik.values.images}
setImages={(images) => {
formik.setFieldValue('images', images);
}}
/>
</Box>
</Grid>
</Grid>