diff --git a/react-frontend/public/assets/images/cat-img.png b/react-frontend/public/assets/images/cat-img.png new file mode 100644 index 000000000..fd3dd7dbf Binary files /dev/null and b/react-frontend/public/assets/images/cat-img.png differ diff --git a/react-frontend/public/assets/images/cat-mobile-img.png b/react-frontend/public/assets/images/cat-mobile-img.png new file mode 100644 index 000000000..3c6f486f0 Binary files /dev/null and b/react-frontend/public/assets/images/cat-mobile-img.png differ diff --git a/react-frontend/src/login/LoginImageComponent.js b/react-frontend/src/login/LoginImageComponent.js new file mode 100644 index 000000000..242d13f97 --- /dev/null +++ b/react-frontend/src/login/LoginImageComponent.js @@ -0,0 +1,28 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { IMG_BASE_PATH } from "constants/appConstants"; +import ImageComponent from "core-components/image/ImageComponent"; + +const getImagePath = (size) => + size === "lg" + ? `${IMG_BASE_PATH}/cat-img.png` + : `${IMG_BASE_PATH}/cat-mobile-img.png`; + +const LoginImageComponent = ({ className, size }) => { + const imagePath = React.useMemo(() => getImagePath(size), [size]); + + return ( + + ); +}; + +LoginImageComponent.propTypes = { + className: PropTypes.string, + size: PropTypes.oneOf(["md", "lg"]), +}; + +LoginImageComponent.defaultProps = { + size: "md", +}; + +export default React.memo(LoginImageComponent); diff --git a/react-frontend/src/login/LoginImageComponent.test.js b/react-frontend/src/login/LoginImageComponent.test.js new file mode 100644 index 000000000..490c9dc9d --- /dev/null +++ b/react-frontend/src/login/LoginImageComponent.test.js @@ -0,0 +1,19 @@ +import React from "react"; +import { render } from "@testing-library/react"; +import path from "path"; + +import LoginImageComponent from "login/LoginImageComponent"; + +describe("Image component test", () => { + test("renders image component with image", () => { + const { getByAltText } = render(); + const testImage = getByAltText("login image"); + expect(testImage).toBeInTheDocument(); + }); + + test("render image with correct size", () => { + const { getByAltText } = render(); + const testImage = getByAltText("login image"); + expect(path.parse(testImage.src).base).toBe("cat-img.png"); + }); +}); diff --git a/react-frontend/src/login/MobileDashboardComponent.js b/react-frontend/src/login/MobileDashboardComponent.js new file mode 100644 index 000000000..794b9599e --- /dev/null +++ b/react-frontend/src/login/MobileDashboardComponent.js @@ -0,0 +1,26 @@ +import React from "react"; +import styled from "styled-components"; + +import PeerlyTextAndLogo from "shared-components/peerly-logo/PeerlyTextAndLogo"; +import InformativeTextComponent from "login/InformativeTextComponent"; +import LoginImageComponent from "login/LoginImageComponent"; + +const Wrapper = styled.div` + height: 100vh; + background-color: var(--atomic); +`; + +const MobileDashboardComponent = () => ( + + + + + +); + +export default React.memo(MobileDashboardComponent); diff --git a/react-frontend/src/login/MobileDashboardComponent.test.js b/react-frontend/src/login/MobileDashboardComponent.test.js new file mode 100644 index 000000000..83651f936 --- /dev/null +++ b/react-frontend/src/login/MobileDashboardComponent.test.js @@ -0,0 +1,10 @@ +import React from "react"; +import { render } from "@testing-library/react"; +import MobileDashboardComponent from "login/MobileDashboardComponent"; + +describe("mobile dashboard component test", () => { + test("should render dashboard component", () => { + const { asFragment } = render(); + expect(asFragment()).toMatchSnapshot(); + }); +}); diff --git a/react-frontend/src/login/__snapshots__/MobileDashboardComponent.test.js.snap b/react-frontend/src/login/__snapshots__/MobileDashboardComponent.test.js.snap new file mode 100644 index 000000000..2260d8636 --- /dev/null +++ b/react-frontend/src/login/__snapshots__/MobileDashboardComponent.test.js.snap @@ -0,0 +1,94 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`mobile dashboard component test should render dashboard component 1`] = ` + + .c2 { + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + font-size: 30px; + color: var(--white); +} + +.c1 { + text-align: center; + margin-top: 15px; + width: 50px; + height: 50px; + border: 3px solid var(--white); + background-color: var(--atomic); + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} + +.c3 { + color: var(--white); + background-color: var(--atomic); + font-size: 30px; +} + +.c5 { + width: 10%; + background: var(--white); +} + +.c4 { + color: var(--white); + background-color: var(--atomic); +} + +.c0 { + height: 100vh; + background-color: var(--atomic); +} + +
+
+
+
+ + +
+
+
+ Peerly +
+
+ login image +
+

+ Lets Create the Office Positive +

+
+
+ Encouragement Driven +
+
+
+
+`; diff --git a/react-frontend/src/shared-components/peerly-logo/PeerlyLogo.js b/react-frontend/src/shared-components/peerly-logo/PeerlyLogo.js index 803599a3d..556fa84a5 100644 --- a/react-frontend/src/shared-components/peerly-logo/PeerlyLogo.js +++ b/react-frontend/src/shared-components/peerly-logo/PeerlyLogo.js @@ -7,8 +7,8 @@ import PlusSign from "shared-components/plus-sign/PlusSign"; const Logo = styled.div` text-align: center; margin-top: 15px; - width: 83px; - height: 83px; + width: 50px; + height: 50px; border: 3px solid ${({ theme }) => (theme === "dark" ? "var(--white)" : "var(--atomic)")}; background-color: ${({ theme }) => @@ -24,7 +24,7 @@ const PeerlyLogo = ({ theme, fontSize }) => ( PeerlyLogo.defaultProps = { theme: "dark", - fontSize: "48px", + fontSize: "30px", }; PeerlyLogo.propTypes = { diff --git a/react-frontend/src/shared-components/peerly-logo/PeerlyTextAndLogo.js b/react-frontend/src/shared-components/peerly-logo/PeerlyTextAndLogo.js index d6d64ec81..cf72de1ce 100644 --- a/react-frontend/src/shared-components/peerly-logo/PeerlyTextAndLogo.js +++ b/react-frontend/src/shared-components/peerly-logo/PeerlyTextAndLogo.js @@ -5,19 +5,15 @@ import PeerlyLogo from "shared-components/peerly-logo/PeerlyLogo"; import PeerlyTextComponent from "shared-components/peerly-logo/PeerlyTextComponent"; const PeerlyTextAndLogo = ({ theme, fontSize }) => ( - <> -
- -
-
- -
- +
+ + +
); PeerlyTextAndLogo.defaultProps = { theme: "dark", - fontSize: "48px", + fontSize: "30px", }; PeerlyTextAndLogo.propTypes = { diff --git a/react-frontend/src/shared-components/peerly-logo/PeerlyTextComponent.js b/react-frontend/src/shared-components/peerly-logo/PeerlyTextComponent.js index d4c8662a7..b16887751 100644 --- a/react-frontend/src/shared-components/peerly-logo/PeerlyTextComponent.js +++ b/react-frontend/src/shared-components/peerly-logo/PeerlyTextComponent.js @@ -22,7 +22,7 @@ const PeerlyTextComponent = ({ theme, fontSize }) => ( PeerlyTextComponent.defaultProps = { theme: "dark", - fontSize: "48px", + fontSize: "30px", }; PeerlyTextComponent.propTypes = { diff --git a/react-frontend/src/shared-components/peerly-logo/__snapshots__/PeerlyLogo.test.js.snap b/react-frontend/src/shared-components/peerly-logo/__snapshots__/PeerlyLogo.test.js.snap index e55b57f6d..7ec3fa511 100644 --- a/react-frontend/src/shared-components/peerly-logo/__snapshots__/PeerlyLogo.test.js.snap +++ b/react-frontend/src/shared-components/peerly-logo/__snapshots__/PeerlyLogo.test.js.snap @@ -13,8 +13,8 @@ exports[`should render PeerlyLogo Component 1`] = ` .c0 { text-align: center; margin-top: 15px; - width: 83px; - height: 83px; + width: 50px; + height: 50px; border: 3px solid var(--white); background-color: var(--atomic); -webkit-transform: rotate(45deg); diff --git a/react-frontend/src/shared-components/peerly-logo/__snapshots__/PeerlyTextAndLogo.test.js.snap b/react-frontend/src/shared-components/peerly-logo/__snapshots__/PeerlyTextAndLogo.test.js.snap index c906239bd..0d5f24846 100644 --- a/react-frontend/src/shared-components/peerly-logo/__snapshots__/PeerlyTextAndLogo.test.js.snap +++ b/react-frontend/src/shared-components/peerly-logo/__snapshots__/PeerlyTextAndLogo.test.js.snap @@ -13,8 +13,8 @@ exports[`should equal to Peerly text 1`] = ` .c0 { text-align: center; margin-top: 15px; - width: 83px; - height: 83px; + width: 50px; + height: 50px; border: 3px solid var(--white); background-color: var(--atomic); -webkit-transform: rotate(45deg); @@ -22,8 +22,14 @@ exports[`should equal to Peerly text 1`] = ` transform: rotate(45deg); } +.c2 { + color: var(--white); + background-color: var(--atomic); + font-size: 48px; +} +
-
- .c0 { - color: var(--white); - background-color: var(--atomic); - font-size: 48px; -} - -
diff --git a/react-frontend/src/shared-components/plus-sign/PlusSign.js b/react-frontend/src/shared-components/plus-sign/PlusSign.js index 947d104a5..d3d013564 100644 --- a/react-frontend/src/shared-components/plus-sign/PlusSign.js +++ b/react-frontend/src/shared-components/plus-sign/PlusSign.js @@ -22,7 +22,7 @@ const PlusSign = ({ theme, cross, fontSize }) => ( PlusSign.defaultProps = { theme: "dark", - fontSize: "48px", + fontSize: "36px", cross: false, };