diff --git a/webnode/.babelrc b/webnode/.babelrc index ad9f29a..142a3ca 100644 --- a/webnode/.babelrc +++ b/webnode/.babelrc @@ -1,4 +1,4 @@ { "presets": ["env", "react", "es2015", "stage-2", "react-app"], - "plugins": ["transform-class-properties", "transform-object-rest-spread"] + "plugins": ["transform-class-properties", "transform-object-rest-spread", "styled-componets"] } \ No newline at end of file diff --git a/webnode/package.json b/webnode/package.json index 0c2ccd6..96faaf4 100644 --- a/webnode/package.json +++ b/webnode/package.json @@ -100,6 +100,7 @@ "interpolate-html-plugin": "^3.0.0", "jest-cli": "^23.1.0", "jest-enzyme": "^4.2.0", + "jest-styled-components": "^6.2.2", "jsdom-worker": "^0.1.0", "lodash-webpack-plugin": "^0.11.5", "mini-css-extract-plugin": "^0.4.1", diff --git a/webnode/src/components/consent-overlay/button-group/index.tsx b/webnode/src/components/consent-overlay/button-group/index.tsx index 0be8543..80630d9 100644 --- a/webnode/src/components/consent-overlay/button-group/index.tsx +++ b/webnode/src/components/consent-overlay/button-group/index.tsx @@ -1,60 +1,27 @@ import React from "react"; import styled from "styled-components"; - -const Button = styled.button` - border: none; - border-radius: 12px; - cursor: pointer; - font: 600 23px Poppins; - height: 50px; - margin: 15px; - min-width: 300px; - outline: none; - padding: 0; - width: 100%; - @media (max-width: 1200px) { - border-radius: 8px; - font-size: 16px; - height: 40px; - margin: 5px; - min-width: 180px; - } -`; +import { Container, Flexbox, Button } from "../../generic"; const ContinueButton = styled(Button)` - background: rgba(8, 143, 252); - color: white; :hover: { background: #088ffc; } `; const DenyButton = styled(Button)` - background: #ffffff; - border: 1px solid #f76868; - color: #f76868; :hover: { background: #f76868; border-color: #f76868; } `; -const DesktopContainer = styled.div` - list-style-type: none; - margin-right: 0; - min-width: 200px; - width: 15%; +const DesktopContainer = styled(Container)` @media (max-width: 1200px) { display: none; } `; -const MobileContainer = styled.div` - display: flex; - flex-direction: row; - margin-right: 0; - min-width: 200px; - width: 90%; +const MobileContainer = styled(Flexbox)` @media (min-width: 1201px) { display: none; } @@ -70,7 +37,11 @@ class ButtonGroup extends React.Component { const { giveConsent, denyConsent } = this.props; return (
- +
  • {" "} @@ -79,14 +50,31 @@ class ButtonGroup extends React.Component {
  • {" "} - Deny Consent + + Deny Consent +
  • - + Continue Ad-Free - Deny Consent + + Deny Consent +
    ); diff --git a/webnode/src/components/consent-overlay/index.tsx b/webnode/src/components/consent-overlay/index.tsx index b249bd3..91ea47b 100644 --- a/webnode/src/components/consent-overlay/index.tsx +++ b/webnode/src/components/consent-overlay/index.tsx @@ -5,6 +5,7 @@ import MiddleGroup from "./middle-group"; import LogoGroup from "./logo-group"; import WebFont from "webfontloader"; import styled from "styled-components"; +import { Container, Flexbox } from "../generic"; WebFont.load({ google: { @@ -12,34 +13,16 @@ WebFont.load({ } }); -const Container = styled.div` - font-family: Poppins; - overflow: hidden; - bottom: 0; - left: 0; - right: 0; - position: fixed; - background-color: #ffffff; - text-align: center; - height: 300px; +const OuterContainer = styled(Container)` @media (max-width: 1200px) { height: 200px; } `; -const BlueBar = styled.div` - top: 0; - height: 6px; - width: 100%; - border-bottom: solid 6px #088ffc; +const BlueBar = styled(Container)` `; -const Inner = styled.div` - flex-direction: row; - display: flex; - justify-content: space-around; - align-items: center; - height: 300px; +const InnerContainer = styled(Flexbox)` @media (max-width: 1200px) { flex-direction: column; height: 200px; @@ -56,14 +39,34 @@ class ConsentOverlay extends React.Component { render() { const { denyConsent, giveConsent } = this.props; return ( - - - + + + - - + + ); } } diff --git a/webnode/src/components/consent-overlay/logo-group/index.tsx b/webnode/src/components/consent-overlay/logo-group/index.tsx index 89bc269..fca572b 100644 --- a/webnode/src/components/consent-overlay/logo-group/index.tsx +++ b/webnode/src/components/consent-overlay/logo-group/index.tsx @@ -3,34 +3,33 @@ import styled from "styled-components"; import { ASSET_URL } from "../../../config"; import LogoImg from "../../../assets/images/oyster-logo-with-dot.svg"; +import { Flexbox, Text, Image } from "../../generic"; -const Container = styled.div` - width: 20%; - flex-direction: column; - justify-content: space-around; +const LogoGroupContainer = styled(Flexbox)` @media (max-width: 1200px) { display: none; } `; -const Logo = styled.img` - height: 100px; -`; - -const Text = styled.div` - font: 600 32px Poppins; - padding-top: 25px; - line-height: 1.25; - color: #088ffc; -`; - class LogoGroup extends React.Component { render() { return ( - - - Oyster Protocol in use - + + logo + + Oyster Protocol in use + + ); } } diff --git a/webnode/src/components/consent-overlay/middle-group/index.tsx b/webnode/src/components/consent-overlay/middle-group/index.tsx index 6db15ee..499b972 100644 --- a/webnode/src/components/consent-overlay/middle-group/index.tsx +++ b/webnode/src/components/consent-overlay/middle-group/index.tsx @@ -1,45 +1,26 @@ import React from "react"; import styled from "styled-components"; +import { Container, Text, Link } from "../../generic"; -const Container = styled.div` - width: 45%; +const MiddleGroupContainer = styled(Container)` @media (max-width: 1200px) { width: 90%; } `; -const Headline = styled.div` - font: 600 18px Poppins; - color: #088ffc; - text-align: left; - padding-bottom: 10px; +const Headline = styled(Text)` @media (max-width: 1200px) { font-size: 12px; } `; -const Link = styled.a` - color: #778291; - font-weight: 600; -`; - -const DesktopText = styled.div` - color: #778291; - font-size: 16px; - font-family: Open Sans; - text-align: justify; - line-height: 1.5; +const DesktopText = styled(Text)` @media (max-width: 1200px) { display: none; } `; -const MobileText = styled.div` - color: #778291; - font-size: 12px; - font-family: Open Sans; - text-align: justify; - line-height: 1.5; +const MobileText = styled(Text)` @media (min-width: 1201px) { display: none; } @@ -48,8 +29,16 @@ const MobileText = styled.div` class MiddleGroup extends React.Component { render() { return ( - - Consent to an Ad-Free Experience + + + Consent to an Ad-Free Experience + This website is revolutionizing the way content is monetized on the internet. We use the Oyster Protocol as a way to generate revenue, @@ -71,7 +60,7 @@ class MiddleGroup extends React.Component { - + This website is using the Oyster protocol to generate revenue. By using a small portion of your unused device resources, this website generates revenue without the use of intrusive ads. Choosing to deny @@ -85,7 +74,7 @@ class MiddleGroup extends React.Component { Learn more... - + ); } } diff --git a/webnode/src/components/generic/button.test.js b/webnode/src/components/generic/button.test.js new file mode 100644 index 0000000..a07a0ab --- /dev/null +++ b/webnode/src/components/generic/button.test.js @@ -0,0 +1,11 @@ +import React from "react"; +import Button from "./button"; + +test("Button test", () => { + const tree = renderer.create(