From 2fc448d051afc1037dab20bc6ad2093db536e318 Mon Sep 17 00:00:00 2001 From: Joe Jackson Date: Thu, 28 May 2020 21:39:02 +0100 Subject: [PATCH] Add img and basic styling to landing page Relates #1 --- client-app/src/components/shared/header.js | 8 ++--- client-app/src/components/shared/landing.js | 23 +++++++++----- client-app/src/components/shared/login.js | 7 ++++- client-app/src/components/shared/user.js | 34 ++++++++++++++------- client-app/src/styles/buttons.js | 10 ++++-- client-app/src/styles/header.js | 11 +++++-- client-app/src/styles/landing.js | 18 +++++++++++ 7 files changed, 82 insertions(+), 29 deletions(-) diff --git a/client-app/src/components/shared/header.js b/client-app/src/components/shared/header.js index e72db3f..9e43191 100644 --- a/client-app/src/components/shared/header.js +++ b/client-app/src/components/shared/header.js @@ -1,6 +1,6 @@ import React, { useContext } from "react"; import { AppContext } from "../AppContext"; -import { Title, HeaderArea, LogInOption } from "../../styles/header.js"; +import { Title, HeaderArea, StyledLogInLink } from "../../styles/header.js"; export default function Header() { const { logInStatus, setLogInStatus } = useContext(AppContext); @@ -13,13 +13,13 @@ export default function Header() { let token = localStorage.getItem("token"); if (!token) { setLogInStatus(false); - return Log In or Sign Up Here!; + return Log In or Sign Up Here!; } else { setLogInStatus(true); return ( - + Log Out - + ); } } diff --git a/client-app/src/components/shared/landing.js b/client-app/src/components/shared/landing.js index 2934446..5ab3390 100644 --- a/client-app/src/components/shared/landing.js +++ b/client-app/src/components/shared/landing.js @@ -2,21 +2,30 @@ import React, { useContext } from "react"; import { Link } from "react-router-dom"; import { AppContext } from "../AppContext"; -import { BlueButton, PinkButton, PageContainer } from "../../styles/buttons.js"; +import { + BlueButton, + PinkButton, + PageContainer, + StyledLink, +} from "../../styles/buttons"; +import { LandingImg, Title2 } from "../../styles/landing"; export default function Landing() { const { isVendor, setIsVendor } = useContext(AppContext); return ( -

Tired of waiting for the jingle?

- illustation - setIsVendor(true)}> + Tired of waiting for the jingle? + + setIsVendor(true)}> Vendors - - setIsVendor(false)}> + + setIsVendor(false)}> Customers - +
); } diff --git a/client-app/src/components/shared/login.js b/client-app/src/components/shared/login.js index 61e00ff..af930f3 100644 --- a/client-app/src/components/shared/login.js +++ b/client-app/src/components/shared/login.js @@ -1,5 +1,10 @@ import React, { useContext } from "react"; -import { Button, BlueButton, PinkButton } from "../../styles/buttons"; +import { + Button, + BlueButton, + PinkButton, + StyledLink, +} from "../../styles/buttons"; import { textStyle } from "../../styles/text"; import { Label, Input, FormContainer } from "../../styles/form"; diff --git a/client-app/src/components/shared/user.js b/client-app/src/components/shared/user.js index 04719da..1a8ba2b 100644 --- a/client-app/src/components/shared/user.js +++ b/client-app/src/components/shared/user.js @@ -2,7 +2,13 @@ import React, { useContext } from "react"; import { Link } from "react-router-dom"; import { AppContext } from "../AppContext"; -import { BlueButton, PinkButton, PageContainer } from "../../styles/buttons"; +import { + BlueButton, + PinkButton, + PageContainer, + StyledLink, +} from "../../styles/buttons"; +import { LandingImg } from "../../styles/landing"; export default function User() { const { isVendor, setIsVendor } = useContext(AppContext); @@ -11,28 +17,34 @@ export default function User() { {isVendor ? (

Find ice cream lovers today

- + - setIsVendor(true)}> + setIsVendor(true)}> Sign Up - + - setIsVendor(true)}> + setIsVendor(true)}> Log In - +
) : (

Find ice cream today

- + - setIsVendor(false)}> + setIsVendor(false)}> Sign Up - + - setIsVendor(false)}> + setIsVendor(false)}> Log In - +
)} diff --git a/client-app/src/styles/buttons.js b/client-app/src/styles/buttons.js index ba6e4e3..dfb087d 100644 --- a/client-app/src/styles/buttons.js +++ b/client-app/src/styles/buttons.js @@ -15,11 +15,15 @@ const Button = ` display: block; width: 75vw; max-width: 400px; + + &:hover { + cursor: pointer; + } `; const BlueButton = styled.button` -${Button} -background-color: ${lightBlue} + ${Button} + background-color: ${lightBlue} `; const PinkButton = styled.button` @@ -45,4 +49,4 @@ const StyledLink = styled(Link)` text-decoration: none; `; -export { BlueButton, PinkButton, PinkSmallButton, PageContainer }; +export { BlueButton, PinkButton, PinkSmallButton, PageContainer, StyledLink }; diff --git a/client-app/src/styles/header.js b/client-app/src/styles/header.js index 45a4823..75a09c2 100644 --- a/client-app/src/styles/header.js +++ b/client-app/src/styles/header.js @@ -1,4 +1,5 @@ import styled from "styled-components"; +import { Link } from "react-router-dom"; // import Montserrat from ‘./fonts/Montserrat-Regular.ttf’ // injectGlobal` @@ -22,7 +23,7 @@ const Title = styled.h1` font-style: italic; color: ${navy}; font-size: 2.5rem; - margin-bottom: 0; + margin-bottom: 0.5rem; `; const HeaderArea = styled.header` @@ -32,6 +33,10 @@ const HeaderArea = styled.header` padding-bottom: 5%; `; -const LogInOption = styled.a``; +const StyledLogInLink = styled(Link)` + font-size: 1rem; + color: ${navy}; + text-decoration: none; +`; -export { Title, HeaderArea, LogInOption }; +export { Title, HeaderArea, StyledLogInLink }; diff --git a/client-app/src/styles/landing.js b/client-app/src/styles/landing.js index 9899a41..077ff25 100644 --- a/client-app/src/styles/landing.js +++ b/client-app/src/styles/landing.js @@ -2,3 +2,21 @@ import styled from "styled-components"; const lightBlue = "#C3DDED"; const navy = "#1f4068"; + +const Title2 = styled.h2` + color: ${navy}; + font-size: 1.5rem; + margin-bottom: 0.5rem; +`; + +const Img = ` +max-width: 20vw; +`; + +const LandingImg = styled.img` + ${Img} + max-width: 20rem; + margin: 2.5rem; +`; + +export { LandingImg, Title2 };