From c8946ca83d8a75d5c00bec5b15b28e38308f531c Mon Sep 17 00:00:00 2001
From: meskio <meskio@sindominio.net>
Date: Sun, 24 Jan 2021 18:59:10 +0100
Subject: [PATCH] Stop using bootstrap-react-table

---
 package-lock.json            | 42 ------------------------------------
 package.json                 |  2 --
 src/index.js                 |  1 -
 src/purchase/ShowPurchase.js | 36 ++++++++++++++++++++-----------
 4 files changed, 23 insertions(+), 58 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index ec1b89f..8f4ab4b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -17,8 +17,6 @@
         "bootstrap": "^4.5.2",
         "react": "^16.13.1",
         "react-bootstrap": "^1.3.0",
-        "react-bootstrap-table-next": "^4.0.3",
-        "react-bootstrap-table2-editor": "^1.4.0",
         "react-bootstrap-typeahead": "^5.1.1",
         "react-dom": "^16.13.1",
         "react-icons": "^3.11.0",
@@ -12655,21 +12653,6 @@
         "warning": "^4.0.3"
       }
     },
-    "node_modules/react-bootstrap-table-next": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/react-bootstrap-table-next/-/react-bootstrap-table-next-4.0.3.tgz",
-      "integrity": "sha512-uKxC73qUdUfusRf2uzDfMiF9LvTG5vuhTZa0lbAgHWSLLLaKTsI0iHf1e4+c7gP71q8dFsp7StvkP65SxC1JRg==",
-      "dependencies": {
-        "classnames": "^2.2.5",
-        "react-transition-group": "^4.2.0",
-        "underscore": "1.9.1"
-      }
-    },
-    "node_modules/react-bootstrap-table2-editor": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/react-bootstrap-table2-editor/-/react-bootstrap-table2-editor-1.4.0.tgz",
-      "integrity": "sha512-18yDCwsVt3b5Fwy0jidNDAbUA6vC7k9JjQVmykazWSw8G115+mmZnhe9/7RO7jAu8X7lhmobwlNwECzwPu1nDg=="
-    },
     "node_modules/react-bootstrap-typeahead": {
       "version": "5.1.1",
       "resolved": "https://registry.npmjs.org/react-bootstrap-typeahead/-/react-bootstrap-typeahead-5.1.1.tgz",
@@ -15485,11 +15468,6 @@
         "react-lifecycles-compat": "^3.0.4"
       }
     },
-    "node_modules/underscore": {
-      "version": "1.9.1",
-      "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",
-      "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg=="
-    },
     "node_modules/unicode-canonical-property-names-ecmascript": {
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
@@ -27594,21 +27572,6 @@
         "warning": "^4.0.3"
       }
     },
-    "react-bootstrap-table-next": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/react-bootstrap-table-next/-/react-bootstrap-table-next-4.0.3.tgz",
-      "integrity": "sha512-uKxC73qUdUfusRf2uzDfMiF9LvTG5vuhTZa0lbAgHWSLLLaKTsI0iHf1e4+c7gP71q8dFsp7StvkP65SxC1JRg==",
-      "requires": {
-        "classnames": "^2.2.5",
-        "react-transition-group": "^4.2.0",
-        "underscore": "1.9.1"
-      }
-    },
-    "react-bootstrap-table2-editor": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/react-bootstrap-table2-editor/-/react-bootstrap-table2-editor-1.4.0.tgz",
-      "integrity": "sha512-18yDCwsVt3b5Fwy0jidNDAbUA6vC7k9JjQVmykazWSw8G115+mmZnhe9/7RO7jAu8X7lhmobwlNwECzwPu1nDg=="
-    },
     "react-bootstrap-typeahead": {
       "version": "5.1.1",
       "resolved": "https://registry.npmjs.org/react-bootstrap-typeahead/-/react-bootstrap-typeahead-5.1.1.tgz",
@@ -29973,11 +29936,6 @@
         "react-lifecycles-compat": "^3.0.4"
       }
     },
-    "underscore": {
-      "version": "1.9.1",
-      "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",
-      "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg=="
-    },
     "unicode-canonical-property-names-ecmascript": {
       "version": "1.0.4",
       "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
diff --git a/package.json b/package.json
index 0ed6447..b712a28 100644
--- a/package.json
+++ b/package.json
@@ -13,8 +13,6 @@
     "bootstrap": "^4.5.2",
     "react": "^16.13.1",
     "react-bootstrap": "^1.3.0",
-    "react-bootstrap-table-next": "^4.0.3",
-    "react-bootstrap-table2-editor": "^1.4.0",
     "react-bootstrap-typeahead": "^5.1.1",
     "react-dom": "^16.13.1",
     "react-icons": "^3.11.0",
diff --git a/src/index.js b/src/index.js
index 4f0ecf1..d19ee88 100644
--- a/src/index.js
+++ b/src/index.js
@@ -3,7 +3,6 @@ import ReactDOM from "react-dom";
 import App from "./App";
 import * as serviceWorker from "./serviceWorker";
 import "bootstrap/dist/css/bootstrap.min.css";
-import "react-bootstrap-table-next/dist/react-bootstrap-table2.min.css";
 import "react-bootstrap-typeahead/css/Typeahead.css";
 
 ReactDOM.render(
diff --git a/src/purchase/ShowPurchase.js b/src/purchase/ShowPurchase.js
index 9ce53b6..634cb75 100644
--- a/src/purchase/ShowPurchase.js
+++ b/src/purchase/ShowPurchase.js
@@ -1,21 +1,31 @@
 import React from "react";
-import BootstrapTable from "react-bootstrap-table-next";
+import { Table } from "react-bootstrap";
 import { printMoney } from "../util";
 
-const columns = [
-  { dataField: "code", text: "Codigo" },
-  { dataField: "product.name", text: "Nombre" },
-  {
-    dataField: "price",
-    text: "Precio",
-    formatter: (cell) => printMoney(cell) + " €",
-  },
-  { dataField: "amount", text: "Cantidad" },
-];
-
 function ShowPurchase(props) {
+  const entries = props.purchase.map((p) => {
+    return (
+      <tr key={p.code}>
+        <td>{p.code}</td>
+        <td>{p.product.name}</td>
+        <td>{printMoney(p.price) + " €"}</td>
+        <td>{p.amount}</td>
+      </tr>
+    );
+  });
+
   return (
-    <BootstrapTable keyField="code" data={props.purchase} columns={columns} />
+    <Table striped bordered hover responsive>
+      <thead>
+        <tr>
+          <th>Codigo</th>
+          <th>Nombre</th>
+          <th>Precio</th>
+          <th>Cantidad</th>
+        </tr>
+      </thead>
+      <tbody>{entries}</tbody>
+    </Table>
   );
 }
 
-- 
GitLab