From 873de264af3c5b7b6a2fa752d1f55c973af6bc8b Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 15:59:26 +0530 Subject: [PATCH 01/40] add button core component --- .../src/components/core/ButtonComponent.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 react-frontend/src/components/core/ButtonComponent.js diff --git a/react-frontend/src/components/core/ButtonComponent.js b/react-frontend/src/components/core/ButtonComponent.js new file mode 100644 index 000000000..f894ab34e --- /dev/null +++ b/react-frontend/src/components/core/ButtonComponent.js @@ -0,0 +1,43 @@ +import React from "react"; +import { Button } from "react-bootstrap"; +import PropTypes from "prop-types"; + +const ButtonComponent = ({ + className, + type, + onClick, + size, + text, + style, + icon, +}) => ( + +); + +ButtonComponent.propTypes = { + className: PropTypes.string, + type: PropTypes.string.isRequired, + onClick: PropTypes.func.isRequired, + size: PropTypes.oneOf(["sm", "lg"]), + text: PropTypes.string.isRequired, + style: PropTypes.object, + icon: PropTypes.object, +}; + +ButtonComponent.defaultProps = { + type: "submit", + onClick: () => { + /* ToDo completing in future */ + }, +}; + +export default ButtonComponent; From 2fd54856832463455d21a356e1ec85bf4635e2fc Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 16:03:22 +0530 Subject: [PATCH 02/40] add button core component --- .../src/components/core/ButtonComponent.js | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/react-frontend/src/components/core/ButtonComponent.js b/react-frontend/src/components/core/ButtonComponent.js index f894ab34e..bd56fd2d2 100644 --- a/react-frontend/src/components/core/ButtonComponent.js +++ b/react-frontend/src/components/core/ButtonComponent.js @@ -2,22 +2,8 @@ import React from "react"; import { Button } from "react-bootstrap"; import PropTypes from "prop-types"; -const ButtonComponent = ({ - className, - type, - onClick, - size, - text, - style, - icon, -}) => ( - @@ -29,7 +15,6 @@ ButtonComponent.propTypes = { onClick: PropTypes.func.isRequired, size: PropTypes.oneOf(["sm", "lg"]), text: PropTypes.string.isRequired, - style: PropTypes.object, icon: PropTypes.object, }; From d332d05ca5fafc6f264627fca89a1451824e7263 Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 16:18:53 +0530 Subject: [PATCH 03/40] add Label core component --- .../src/components/core/LabelComponent.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 react-frontend/src/components/core/LabelComponent.js diff --git a/react-frontend/src/components/core/LabelComponent.js b/react-frontend/src/components/core/LabelComponent.js new file mode 100644 index 000000000..06dd42769 --- /dev/null +++ b/react-frontend/src/components/core/LabelComponent.js @@ -0,0 +1,14 @@ +import React from "react"; +import { Form } from "react-bootstrap"; +import PropTypes from "prop-types"; + +const LabelComponent = ({ text, className }) => ( + {text} +); + +LabelComponent.propTypes = { + className: PropTypes.string, + text: PropTypes.string.isRequired, +}; + +export default LabelComponent; From 66b3619e6359fc3dd7b8192d3dbb6b452be58fa3 Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 16:37:11 +0530 Subject: [PATCH 04/40] restructure of core component --- .../src/components/core/{ => Button}/ButtonComponent.js | 0 react-frontend/src/components/core/{ => Label}/LabelComponent.js | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename react-frontend/src/components/core/{ => Button}/ButtonComponent.js (100%) rename react-frontend/src/components/core/{ => Label}/LabelComponent.js (100%) diff --git a/react-frontend/src/components/core/ButtonComponent.js b/react-frontend/src/components/core/Button/ButtonComponent.js similarity index 100% rename from react-frontend/src/components/core/ButtonComponent.js rename to react-frontend/src/components/core/Button/ButtonComponent.js diff --git a/react-frontend/src/components/core/LabelComponent.js b/react-frontend/src/components/core/Label/LabelComponent.js similarity index 100% rename from react-frontend/src/components/core/LabelComponent.js rename to react-frontend/src/components/core/Label/LabelComponent.js From 105d5a16d7693af56eb4f7e0a514895018e03d97 Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 17:12:50 +0530 Subject: [PATCH 05/40] add test case files of button and core components --- .../src/components/core/Button/ButtonComponent.test.js | 10 ++++++++++ .../src/components/core/Label/LabelComponent.test.js | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 react-frontend/src/components/core/Button/ButtonComponent.test.js create mode 100644 react-frontend/src/components/core/Label/LabelComponent.test.js diff --git a/react-frontend/src/components/core/Button/ButtonComponent.test.js b/react-frontend/src/components/core/Button/ButtonComponent.test.js new file mode 100644 index 000000000..23b415334 --- /dev/null +++ b/react-frontend/src/components/core/Button/ButtonComponent.test.js @@ -0,0 +1,10 @@ +import React from "react"; +import { render } from "@testing-library/react"; +import ButtonComponent from "components/core/Button/ButtonComponent"; + +it("ButtonComponent should equal to submit text", () => { + const { getByText } = render( + + ); + expect(getByText("submit")).toHaveTextContent("submit"); +}); diff --git a/react-frontend/src/components/core/Label/LabelComponent.test.js b/react-frontend/src/components/core/Label/LabelComponent.test.js new file mode 100644 index 000000000..87d3bfc54 --- /dev/null +++ b/react-frontend/src/components/core/Label/LabelComponent.test.js @@ -0,0 +1,10 @@ +import React from "react"; +import { render } from "@testing-library/react"; +import LabelComponent from "components/core/Label/LabelComponent"; + +it("LabelComponent should equal to submit text", () => { + const { getByText } = render( + + ); + expect(getByText("submit")).toHaveTextContent("submit"); +}); From 88c8d3459fed4c79faec3267e6c75bf6c4825212 Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 18:51:33 +0530 Subject: [PATCH 06/40] add video core component with test file --- .../core/Button/ButtonComponent.test.js | 4 +-- .../core/Label/LabelComponent.test.js | 4 +-- .../components/core/video/VideoComponent.js | 29 +++++++++++++++++++ .../core/video/VideoComponent.test.js | 10 +++++++ 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 react-frontend/src/components/core/video/VideoComponent.js create mode 100644 react-frontend/src/components/core/video/VideoComponent.test.js diff --git a/react-frontend/src/components/core/Button/ButtonComponent.test.js b/react-frontend/src/components/core/Button/ButtonComponent.test.js index 23b415334..05715b0f3 100644 --- a/react-frontend/src/components/core/Button/ButtonComponent.test.js +++ b/react-frontend/src/components/core/Button/ButtonComponent.test.js @@ -3,8 +3,6 @@ import { render } from "@testing-library/react"; import ButtonComponent from "components/core/Button/ButtonComponent"; it("ButtonComponent should equal to submit text", () => { - const { getByText } = render( - - ); + const { getByText } = render(); expect(getByText("submit")).toHaveTextContent("submit"); }); diff --git a/react-frontend/src/components/core/Label/LabelComponent.test.js b/react-frontend/src/components/core/Label/LabelComponent.test.js index 87d3bfc54..029130849 100644 --- a/react-frontend/src/components/core/Label/LabelComponent.test.js +++ b/react-frontend/src/components/core/Label/LabelComponent.test.js @@ -3,8 +3,6 @@ import { render } from "@testing-library/react"; import LabelComponent from "components/core/Label/LabelComponent"; it("LabelComponent should equal to submit text", () => { - const { getByText } = render( - - ); + const { getByText } = render(); expect(getByText("submit")).toHaveTextContent("submit"); }); diff --git a/react-frontend/src/components/core/video/VideoComponent.js b/react-frontend/src/components/core/video/VideoComponent.js new file mode 100644 index 000000000..0b498feec --- /dev/null +++ b/react-frontend/src/components/core/video/VideoComponent.js @@ -0,0 +1,29 @@ +import React from "react"; +import PropTypes from "prop-types"; + +const VideoComponent = ({ className, src, controls, height, width, title }) => ( + /*eslint-disable-next-line jsx-a11y/media-has-caption */ +