diff --git a/backend/models/Item.js b/backend/models/Item.js index 822670e..798edfa 100644 --- a/backend/models/Item.js +++ b/backend/models/Item.js @@ -111,6 +111,30 @@ const Item = sequelize.define('Item', { type: DataTypes.JSONB, defaultValue: [] }, + availableAfter: { + type: DataTypes.STRING, + defaultValue: '09:00' + }, + availableBefore: { + type: DataTypes.STRING, + defaultValue: '17:00' + }, + specifyTimesPerDay: { + type: DataTypes.BOOLEAN, + defaultValue: false + }, + weeklyTimes: { + type: DataTypes.JSONB, + defaultValue: { + sunday: { availableAfter: "09:00", availableBefore: "17:00" }, + monday: { availableAfter: "09:00", availableBefore: "17:00" }, + tuesday: { availableAfter: "09:00", availableBefore: "17:00" }, + wednesday: { availableAfter: "09:00", availableBefore: "17:00" }, + thursday: { availableAfter: "09:00", availableBefore: "17:00" }, + friday: { availableAfter: "09:00", availableBefore: "17:00" }, + saturday: { availableAfter: "09:00", availableBefore: "17:00" } + } + }, ownerId: { type: DataTypes.UUID, allowNull: false, diff --git a/frontend/src/components/DeliveryOptions.tsx b/frontend/src/components/DeliveryOptions.tsx new file mode 100644 index 0000000..4eb877c --- /dev/null +++ b/frontend/src/components/DeliveryOptions.tsx @@ -0,0 +1,60 @@ +import React from 'react'; + +interface DeliveryOptionsProps { + pickUpAvailable: boolean; + inPlaceUseAvailable: boolean; + onChange: (e: React.ChangeEvent) => void; +} + +const DeliveryOptions: React.FC = ({ + pickUpAvailable, + inPlaceUseAvailable, + onChange +}) => { + return ( +
+
+ +
+ + +
+
+ + +
+
+
+ ); +}; + +export default DeliveryOptions; \ No newline at end of file diff --git a/frontend/src/components/ImageUpload.tsx b/frontend/src/components/ImageUpload.tsx new file mode 100644 index 0000000..3ce9963 --- /dev/null +++ b/frontend/src/components/ImageUpload.tsx @@ -0,0 +1,70 @@ +import React from 'react'; + +interface ImageUploadProps { + imageFiles: File[]; + imagePreviews: string[]; + onImageChange: (e: React.ChangeEvent) => void; + onRemoveImage: (index: number) => void; + error: string; +} + +const ImageUpload: React.FC = ({ + imageFiles, + imagePreviews, + onImageChange, + onRemoveImage, + error +}) => { + return ( +
+
+
+ +
+ Have pictures of everything that's included +
+ = 5} + /> +
+ + {imagePreviews.length > 0 && ( +
+ {imagePreviews.map((preview, index) => ( +
+
+ {`Preview + +
+
+ ))} +
+ )} +
+
+ ); +}; + +export default ImageUpload; \ No newline at end of file diff --git a/frontend/src/components/ItemInformation.tsx b/frontend/src/components/ItemInformation.tsx new file mode 100644 index 0000000..0015a7f --- /dev/null +++ b/frontend/src/components/ItemInformation.tsx @@ -0,0 +1,53 @@ +import React from "react"; + +interface ItemInformationProps { + name: string; + description: string; + onChange: ( + e: React.ChangeEvent + ) => void; +} + +const ItemInformation: React.FC = ({ + name, + description, + onChange, +}) => { + return ( +
+
+
+ + +
+ +
+ +