From edb613a39ad2e987ad191fdd7c2b78c6a1aeb7c6 Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 15:59:26 +0530 Subject: [PATCH 01/62] 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 ac460fb6a535f5727c6b34b7a4fdd964e053eea8 Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 16:03:22 +0530 Subject: [PATCH 02/62] 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 e4625633a58cec2b8fc9da77f6d998950f67a40e Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 16:18:53 +0530 Subject: [PATCH 03/62] 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 7b1d6fede6057d1c7a41c54f7dfbe8ae9ad34795 Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 16:37:11 +0530 Subject: [PATCH 04/62] 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 f72b8450e6cc429d710c4340ec1fd0ff589fad4e Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 17:12:50 +0530 Subject: [PATCH 05/62] 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 0fca63ef71db544539b6d41d9541eac5be7ff2b1 Mon Sep 17 00:00:00 2001 From: Jitu007-Bunde Date: Tue, 19 May 2020 18:51:33 +0530 Subject: [PATCH 06/62] 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 */ +