From 33a344feca3de8b25988932fd0039d14c363b5cd Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Sat, 26 Jun 2021 23:45:43 +0530 Subject: ported and changed order in ItemsDisplay --- src/components/Display/ItemsDisplay.js | 53 ------------------------------ src/components/Display/ItemsDisplay.tsx | 58 +++++++++++++++++++++++++++++++++ src/index.js | 14 -------- src/index.tsx | 20 ++++++++++++ 4 files changed, 78 insertions(+), 67 deletions(-) delete mode 100644 src/components/Display/ItemsDisplay.js create mode 100644 src/components/Display/ItemsDisplay.tsx delete mode 100644 src/index.js create mode 100644 src/index.tsx (limited to 'src') diff --git a/src/components/Display/ItemsDisplay.js b/src/components/Display/ItemsDisplay.js deleted file mode 100644 index f0882af..0000000 --- a/src/components/Display/ItemsDisplay.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * OpenBills - Self hosted browser app to generate and keep track of simple invoices - * Version - 0 - * Licensed under the MIT license - https://opensource.org/licenses/MIT - * - * Copyright (c) 2021 Vidhu Kant Sharma -*/ - -import React from "react"; -import "./Display.scss"; -import DisplayItem from "./DisplayItem"; -// import {SummaryDisplayTR} from "./SummaryDisplay"; - -const ItemsDisplay = (props) => { - const items = props.items; - // TODO: remove mutability - let itemNumber = 0; - - // TODO: Add HSN Support - - return ( - - - - - - - - - - - - - - - - {items.map( - (item) => { - itemNumber++ - return ( - - ); - } - )} - - -
S. NumItemDescriptionQuantity(NOS)Discount(%)sgst(%)cgst(%)igst(%)HSNPrice
- ); - // this goes right before - // -} - -export default ItemsDisplay; diff --git a/src/components/Display/ItemsDisplay.tsx b/src/components/Display/ItemsDisplay.tsx new file mode 100644 index 0000000..db3d336 --- /dev/null +++ b/src/components/Display/ItemsDisplay.tsx @@ -0,0 +1,58 @@ +/* + * OpenBills - Self hosted browser app to generate and keep track of simple invoices + * Version - 0 + * Licensed under the MIT license - https://opensource.org/licenses/MIT + * + * Copyright (c) 2021 Vidhu Kant Sharma +*/ + +import React from "react"; +import { Item } from "./../../interfaces"; +import "./Display.scss"; +import DisplayItem from "./DisplayItem"; +// import {SummaryDisplayTR} from "./SummaryDisplay"; + +interface Props { + items: Item[] + defGSTValue: number +} + +const ItemsDisplay: React.FC = (props) => { + const items = props.items; + // TODO: remove mutability + let itemNumber = 0; + + return ( + + + + + + + + + + + + + + + + + {items.map( + (item) => { + itemNumber++ + return ( + + ); + } + )} + + +
S. NumItemDescriptionHSNQuantityUnit PriceDiscountsgstcgstigstPrice
+ ); + // this goes right before + // +} + +export default ItemsDisplay; diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 0d1a5dc..0000000 --- a/src/index.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * OpenBills - Self hosted browser app to generate and keep track of simple invoices - * Version - 0 - * Licensed under the MIT license - https://opensource.org/licenses/MIT - * - * Copyright (c) 2021 Vidhu Kant Sharma - */ - -// import React from 'react'; -import ReactDOM from 'react-dom'; -import "./styles/global.scss" -import App from "./components/App"; - -ReactDOM.render(App(), document.getElementById("root")) diff --git a/src/index.tsx b/src/index.tsx new file mode 100644 index 0000000..682b794 --- /dev/null +++ b/src/index.tsx @@ -0,0 +1,20 @@ +/* + * OpenBills - Self hosted browser app to generate and keep track of simple invoices + * Version - 0 + * Licensed under the MIT license - https://opensource.org/licenses/MIT + * + * Copyright (c) 2021 Vidhu Kant Sharma + */ + +// import React from 'react'; +import React from "react"; +import ReactDOM from "react-dom"; +import "./styles/global.scss" +import App from "./components/App"; + +ReactDOM.render( + + + , + document.getElementById("root") +) -- cgit v1.2.3