Loading materials and mutations...
Loading materials...
- {materials.map((material) => (
-
- {material.image && (
-

- )}
-
-
{material.name}
-
{material.unit}
+ {!loading && (
+
+
+
+ {currentMaterial ? (
+
+ {currentMaterial.image && (
+

+ )}
+
+
{currentMaterial.name}
+
{currentMaterial.unit}
+
+
+
+
+
+
+
+
-
-
- ))}
+ ) : (
+
No materials available.
+ )}
+
+
+
+ )}
+
+ {selectedMaterialId && !loading && (
+
+ {filteredMutations.length > 0 ? (
+ filteredMutations.map((mutation) => (
+
+
Mutation ID: {mutation.id}
+
Details: {mutation.reason}
+
dari {mutation.oldStock}
+
ke {mutation.newStock}
+
+ ))
+ ) : (
+
No mutations available.
+ )}
)}
);
};
-// Styles
const styles = {
container: {
- padding: "20px",
+ paddingLeft: "10px",
+ paddingRight: "10px",
maxWidth: "800px",
margin: "0 auto",
+ height: "100%", // Adjust height based on your needs
+ overflowY: "auto", // Enables vertical scrolling
},
heading: {
textAlign: "center",
@@ -254,16 +436,31 @@ const styles = {
transition: "background-color 0.3s, transform 0.3s",
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.1)",
},
- materialList: {
+ navigationContainer: {
display: "flex",
- flexWrap: "wrap",
- gap: "15px",
+ alignItems: "center",
justifyContent: "center",
- maxHeight: "500px", // Adjust the height as needed
- overflowY: "auto", // Makes the container scrollable vertically
+ marginTop: "20px",
+ position: "relative",
+ },
+ navigationButton: {
+ padding: "10px",
+ border: "none",
+ borderRadius: "5px",
+ backgroundColor: "#007bff",
+ color: "white",
+ fontSize: "18px",
+ cursor: "pointer",
+ margin: "0 5px",
+ transition: "background-color 0.3s ease",
+ },
+ materialCardContainer: {
+ flex: "1",
+ display: "flex",
+ justifyContent: "center",
+ transition: "opacity 0.5s ease-in-out",
},
materialCard: {
- flex: "1 1 200px",
padding: "15px",
borderRadius: "8px",
border: "1px solid #ddd",
@@ -283,9 +480,9 @@ const styles = {
marginBottom: "5px",
},
image: {
- width: "80px",
- height: "80px",
- objectFit: "cover",
+ width: "250px",
+ height: "150px",
+ objectFit: "contain",
borderRadius: "8px",
marginBottom: "10px",
},
@@ -293,6 +490,64 @@ const styles = {
color: "#dc3545",
marginBottom: "15px",
},
+ mutationContainer: {
+ marginTop: "20px",
+ padding: "10px",
+ borderRadius: "8px",
+ border: "1px solid #ddd",
+ backgroundColor: "#f8f9fa",
+ boxShadow: "0 4px 8px rgba(0, 0, 0, 0.1)",
+ },
+ mutationCard: {
+ padding: "10px",
+ borderRadius: "8px",
+ border: "1px solid #ddd",
+ backgroundColor: "#fff",
+ marginBottom: "10px",
+ boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)",
+ },
+ mutationTitle: {
+ fontSize: "16px",
+ fontWeight: "600",
+ },
+ buttonContainer: {
+ display: "flex",
+ alignItems: "center",
+ marginTop: "10px",
+ },
+ quantityButton: {
+ padding: "8px 12px",
+ border: "none",
+ borderRadius: "5px",
+ backgroundColor: "#007bff",
+ color: "white",
+ fontSize: "16px",
+ cursor: "pointer",
+ margin: "0 5px",
+ transition: "background-color 0.3s ease",
+ },
+ quantityDisplay: {
+ padding: "8px 12px",
+ border: "1px solid #ddd",
+ borderRadius: "5px",
+ backgroundColor: "#fff",
+ color: "#000",
+ fontSize: "16px",
+ textAlign: "center",
+ margin: "0 5px",
+ },
+ updateMutation: {
+ marginTop: "10px",
+ padding: "12px 20px",
+ border: "none",
+ borderRadius: "8px",
+ backgroundColor: "#007bff",
+ color: "#fff",
+ cursor: "pointer",
+ fontSize: "16px",
+ transition: "background-color 0.3s, transform 0.3s",
+ boxShadow: "0 4px 8px rgba(0, 0, 0, 0.1)",
+ },
};
export default MaterialList;
diff --git a/src/pages/MaterialMutationsPage.js b/src/pages/MaterialMutationsPage.js
index d486a11..6bff12f 100644
--- a/src/pages/MaterialMutationsPage.js
+++ b/src/pages/MaterialMutationsPage.js
@@ -158,6 +158,7 @@ const MaterialMutationPage = ({ cafeId }) => {
try {
const data = await getMaterials(cafeId);
setMaterials(data);
+ console.log(data);
} catch (err) {
setError(err.message);
}
diff --git a/src/pages/Transaction_confirmed.js b/src/pages/Transaction_confirmed.js
index d30ed54..19eab4a 100644
--- a/src/pages/Transaction_confirmed.js
+++ b/src/pages/Transaction_confirmed.js
@@ -113,7 +113,6 @@ export default function Transaction_pending({ paymentUrl }) {
{/* Generate QR code */}
-
Generated QR Code from Data
+