From e554aa9a10e0ad3d22030ff8ccab5200dc8a3b69 Mon Sep 17 00:00:00 2001
From: [Alisina92] <asb92.jobs@gmail.com>
Date: Apr 01 2021 00:02:23 +0000
Subject: [PATCH 1/2] Redundancy removed from Blockers


---

diff --git a/src/landingpage/BetaStats.js b/src/landingpage/BetaStats.js
new file mode 100644
index 0000000..f0dd7ea
--- /dev/null
+++ b/src/landingpage/BetaStats.js
@@ -0,0 +1,36 @@
+import React from "react";
+
+const BetaStats = (props) => {
+  return (
+    <div className="col-md-6">
+      <table className="events">
+        <thead>
+          <tr>
+            <td colSpan="2">
+              <b>Beta</b>
+            </td>
+          </tr>
+        </thead>
+        <tbody>
+          <tr>
+            <td>Proposed Blockers</td>
+            <td className="bugscount">{props.data.beta_blockers_proposed}</td>
+          </tr>
+          <tr>
+            <td>Accepted Blockers</td>
+            <td className="bugscount">{props.data.beta_blockers}</td>
+          </tr>
+          <tr>
+            <td>Proposed FEs</td>
+            <td className="bugscount">{props.data.beta_fe_proposed}</td>
+          </tr>
+          <tr>
+            <td>Accepted FEs</td>
+            <td className="bugscount">{props.data.beta_fe}</td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+  );
+};
+export default BetaStats;
diff --git a/src/landingpage/Blockers.js b/src/landingpage/Blockers.js
index 30b923a..907549e 100644
--- a/src/landingpage/Blockers.js
+++ b/src/landingpage/Blockers.js
@@ -1,85 +1,26 @@
-import React, { Component } from "react"
-import { Row } from "reactstrap"
-import SourceLink from "./SourceLink"
+import React, { useState } from "react";
+import { Row } from "reactstrap";
+import SourceLink from "./SourceLink";
+import BetaStats from "./BetaStats";
+import FinalStats from "./FinalStats";
 
-class Blockers extends Component {
-  constructor(props) {
-    super(props)
-    this.state = { blockerbugs: {}, release: 0 }
-  }
+const Blockers = (props) => {
+  const [blockerbugs] = useState({});
+  const [release] = useState(0);
 
-  render() {
-    if (this.props.data)
-      return (
-        <div>
-          <h1 className="padded">
-            Fedora {this.props.release} blockers and FEs{" "}
-            <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />
-          </h1>
-          <Row>
-            <div className="col-md-6">
-              <table className="events">
-                <thead>
-                  <tr>
-                    <td colSpan="2">
-                      <b>Beta</b>
-                    </td>
-                  </tr>
-                </thead>
-                <tbody>
-                  <tr>
-                    <td>Proposed Blockers</td>
-                    <td className="bugscount">{this.props.data.beta_blockers_proposed}</td>
-                  </tr>
-                  <tr>
-                    <td>Accepted Blockers</td>
-                    <td className="bugscount">{this.props.data.beta_blockers}</td>
-                  </tr>
-                  <tr>
-                    <td>Proposed FEs</td>
-                    <td className="bugscount">{this.props.data.beta_fe_proposed}</td>
-                  </tr>
-                  <tr>
-                    <td>Accepted FEs</td>
-                    <td className="bugscount">{this.props.data.beta_fe}</td>
-                  </tr>
-                </tbody>
-              </table>
-            </div>
+  if (props.data)
+    return (
+      <div>
+        <h1 className="padded">
+          Fedora {props.release} blockers and FEs{" "}
+          <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />
+        </h1>
+        <Row>
+          <BetaStats data={props.data} />
+          <FinalStats data={props.data} />
+        </Row>
+      </div>
+    );
+};
 
-            <div className="col-md-6">
-              <table className="events">
-                <thead>
-                  <tr>
-                    <td colSpan="2">
-                      <b>Final</b>
-                    </td>
-                  </tr>
-                </thead>
-                <tbody>
-                  <tr>
-                    <td>Proposed Blockers</td>
-                    <td className="bugscount">{this.props.data.final_blockers_proposed}</td>
-                  </tr>
-                  <tr>
-                    <td>Accepted Blockers</td>
-                    <td className="bugscount">{this.props.data.final_blockers}</td>
-                  </tr>
-                  <tr>
-                    <td>Proposed FEs</td>
-                    <td className="bugscount">{this.props.data.final_fe_proposed}</td>
-                  </tr>
-                  <tr>
-                    <td>Accepted FEs</td>
-                    <td className="bugscount">{this.props.data.final_fe}</td>
-                  </tr>
-                </tbody>
-              </table>
-            </div>
-          </Row>
-        </div>
-      )
-  }
-}
-
-export default Blockers
+export default Blockers;
diff --git a/src/landingpage/FinalStats.js b/src/landingpage/FinalStats.js
new file mode 100644
index 0000000..8d55cbf
--- /dev/null
+++ b/src/landingpage/FinalStats.js
@@ -0,0 +1,36 @@
+import React from "react";
+
+const FinalStats = (props) => {
+  return (
+    <div className="col-md-6">
+      <table className="events">
+        <thead>
+          <tr>
+            <td colSpan="2">
+              <b>Final</b>
+            </td>
+          </tr>
+        </thead>
+        <tbody>
+          <tr>
+            <td>Proposed Blockers</td>
+            <td className="bugscount">{props.data.final_blockers_proposed}</td>
+          </tr>
+          <tr>
+            <td>Accepted Blockers</td>
+            <td className="bugscount">{props.data.final_blockers}</td>
+          </tr>
+          <tr>
+            <td>Proposed FEs</td>
+            <td className="bugscount">{props.data.final_fe_proposed}</td>
+          </tr>
+          <tr>
+            <td>Accepted FEs</td>
+            <td className="bugscount">{props.data.final_fe}</td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+  );
+};
+export default FinalStats;

From fc0d71b318db3027f5e0c5ed1387b770a3f0ca54 Mon Sep 17 00:00:00 2001
From: [Alisina92] <asb92.jobs@gmail.com>
Date: Apr 08 2021 18:46:26 +0000
Subject: [PATCH 2/2] fixed the redundancy


---

diff --git a/src/landingpage/BetaStats.js b/src/landingpage/BetaStats.js
deleted file mode 100644
index f0dd7ea..0000000
--- a/src/landingpage/BetaStats.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from "react";
-
-const BetaStats = (props) => {
-  return (
-    <div className="col-md-6">
-      <table className="events">
-        <thead>
-          <tr>
-            <td colSpan="2">
-              <b>Beta</b>
-            </td>
-          </tr>
-        </thead>
-        <tbody>
-          <tr>
-            <td>Proposed Blockers</td>
-            <td className="bugscount">{props.data.beta_blockers_proposed}</td>
-          </tr>
-          <tr>
-            <td>Accepted Blockers</td>
-            <td className="bugscount">{props.data.beta_blockers}</td>
-          </tr>
-          <tr>
-            <td>Proposed FEs</td>
-            <td className="bugscount">{props.data.beta_fe_proposed}</td>
-          </tr>
-          <tr>
-            <td>Accepted FEs</td>
-            <td className="bugscount">{props.data.beta_fe}</td>
-          </tr>
-        </tbody>
-      </table>
-    </div>
-  );
-};
-export default BetaStats;
diff --git a/src/landingpage/Blockers.js b/src/landingpage/Blockers.js
index 907549e..139d4ca 100644
--- a/src/landingpage/Blockers.js
+++ b/src/landingpage/Blockers.js
@@ -1,8 +1,8 @@
 import React, { useState } from "react";
 import { Row } from "reactstrap";
 import SourceLink from "./SourceLink";
-import BetaStats from "./BetaStats";
-import FinalStats from "./FinalStats";
+import BugStats from "./BugStats";
+
 
 const Blockers = (props) => {
   const [blockerbugs] = useState({});
@@ -16,8 +16,7 @@ const Blockers = (props) => {
           <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />
         </h1>
         <Row>
-          <BetaStats data={props.data} />
-          <FinalStats data={props.data} />
+          <BugStats data={props.data} />
         </Row>
       </div>
     );
diff --git a/src/landingpage/BugStats.js b/src/landingpage/BugStats.js
new file mode 100644
index 0000000..83a9015
--- /dev/null
+++ b/src/landingpage/BugStats.js
@@ -0,0 +1,77 @@
+import React from "react";
+
+const BugStats = ({
+  beta_blockers,
+  beta_blockers_proposed,
+  beta_fe,
+  beta_fe_proposed,
+  final_blockers_proposed,
+  final_blockers,
+  final_fe_proposed,
+  final_fe
+}) => {
+  return (
+    <>
+      <div className="col-md-6">
+        <table className="events">
+          <thead>
+            <tr>
+              <td colSpan="2">
+                <b>Beta</b>
+              </td>
+            </tr>
+          </thead>
+          <tbody>
+            <tr>
+              <td>Proposed Blockers</td>
+              <td className="bugscount">{beta_blockers_proposed}</td>
+            </tr>
+            <tr>
+              <td>Accepted Blockers</td>
+              <td className="bugscount">{beta_blockers}</td>
+            </tr>
+            <tr>
+              <td>Proposed FEs</td>
+              <td className="bugscount">{beta_fe_proposed}</td>
+            </tr>
+            <tr>
+              <td>Accepted FEs</td>
+              <td className="bugscount">{beta_fe}</td>
+            </tr>
+          </tbody>
+        </table>
+      </div>
+
+      <div className="col-md-6">
+        <table className="events">
+          <thead>
+            <tr>
+              <td colSpan="2">
+                <b>Final</b>
+              </td>
+            </tr>
+          </thead>
+          <tbody>
+            <tr>
+              <td>Proposed Blockers</td>
+              <td className="bugscount">{final_blockers_proposed}</td>
+            </tr>
+            <tr>
+              <td>Accepted Blockers</td>
+              <td className="bugscount">{final_blockers}</td>
+            </tr>
+            <tr>
+              <td>Proposed FEs</td>
+              <td className="bugscount">{final_fe_proposed}</td>
+            </tr>
+            <tr>
+              <td>Accepted FEs</td>
+              <td className="bugscount">{final_fe}</td>
+            </tr>
+          </tbody>
+        </table>
+      </div>
+    </>
+  );
+};
+export default BugStats;
diff --git a/src/landingpage/FinalStats.js b/src/landingpage/FinalStats.js
deleted file mode 100644
index 8d55cbf..0000000
--- a/src/landingpage/FinalStats.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import React from "react";
-
-const FinalStats = (props) => {
-  return (
-    <div className="col-md-6">
-      <table className="events">
-        <thead>
-          <tr>
-            <td colSpan="2">
-              <b>Final</b>
-            </td>
-          </tr>
-        </thead>
-        <tbody>
-          <tr>
-            <td>Proposed Blockers</td>
-            <td className="bugscount">{props.data.final_blockers_proposed}</td>
-          </tr>
-          <tr>
-            <td>Accepted Blockers</td>
-            <td className="bugscount">{props.data.final_blockers}</td>
-          </tr>
-          <tr>
-            <td>Proposed FEs</td>
-            <td className="bugscount">{props.data.final_fe_proposed}</td>
-          </tr>
-          <tr>
-            <td>Accepted FEs</td>
-            <td className="bugscount">{props.data.final_fe}</td>
-          </tr>
-        </tbody>
-      </table>
-    </div>
-  );
-};
-export default FinalStats;

