aboutsummaryrefslogtreecommitdiff
path: root/src/components/Display/ItemsDisplay.js
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-04-17 16:18:12 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-04-17 16:18:12 +0530
commit444a8147f59df78ebf14222edcebf944226b533e (patch)
tree88f72d041c3b75b5c3d7d6f48fffc2b943379809 /src/components/Display/ItemsDisplay.js
parent2efc453d20aca682ac3f34af8687d4bb28642195 (diff)
designed DisplayItem and ItemsDisplay so it now renders a pretty table
Diffstat (limited to 'src/components/Display/ItemsDisplay.js')
-rw-r--r--src/components/Display/ItemsDisplay.js66
1 files changed, 50 insertions, 16 deletions
diff --git a/src/components/Display/ItemsDisplay.js b/src/components/Display/ItemsDisplay.js
index 766d16f..7026530 100644
--- a/src/components/Display/ItemsDisplay.js
+++ b/src/components/Display/ItemsDisplay.js
@@ -1,29 +1,63 @@
import React from "react";
import "./Display.css";
+import DisplayItem from "./DisplayItem";
const ItemsDisplay = (props) => {
const items = props.items;
+ let itemNumber = 0;
+
return (
- <div className={"ItemsDisplay"}>
- <ol>
- {items.map( (item) => {
+ <table className={"ItemsDisplay"}>
+ <tr className="legend">
+ <th>S. Num</th>
+ <th className={"leftAlign"}>Item</th>
+ <th className={"leftAlign"}>Description</th>
+ <th>Quantity(NOS)</th>
+ <th>Price</th>
+ <th>Discount(%)</th>
+ <th>GST(%)</th>
+ </tr>
+
+ {items.map(
+ (item) => {
+ itemNumber++
return (
- <li>
- <ul>
- <li key={item.Model}>{item.Model}</li>
- <li key={item.Description}>{item.Description}</li>
- <li key={item.Quantity}>{item.Quantity}</li>
- <li key={item.Price}>{item.Price}</li>
- <li key={item.Discount}>{item.Discount}</li>
- <li key={item.GST}>{item.GST}</li>
- </ul>
- </li>
+ <DisplayItem itemNumber={itemNumber} item={item}/>
);
- })}
- </ol>
+ }
+ )}
+ </table>
+ )
+
+
+ /*return (
+ <div className={"ItemsDisplay"}>
+ <div className={"legend"}>
+ <ul>
+ <li className={"num"}>S. Num.</li>
+ <li className={"text"}>Name</li>
+ <li className={"text"}>Description</li>
+ <li className={"num"}>Quantity</li>
+ <li className={"num"}>Price</li>
+ <li className={"num"}>Discount</li>
+ <li className={"num"}>GST</li>
+ </ul>
+ </div>
+
+ <div className={"items"}>
+ {items.map(
+ (item) => {
+ itemNumber++
+ return (
+ <DisplayItem itemNumber={itemNumber} item={item}/>
+ );
+ }
+ )}
+ </div>
+
</div>
- );
+ );*/
}
export default ItemsDisplay;