diff --git a/packages/campus-online-frontend/src/components/Layout/index.js b/packages/campus-online-frontend/src/components/Layout/index.js index 5ffe2b38..920d0eca 100644 --- a/packages/campus-online-frontend/src/components/Layout/index.js +++ b/packages/campus-online-frontend/src/components/Layout/index.js @@ -19,6 +19,8 @@ export const Wrapper = styled.div` const Inner = styled.div` flex: 1 0 auto; width: 100%; + display: flex; + flex-direction: column; ` const Layout = ({children}) => ( diff --git a/packages/campus-online-frontend/src/pages/contato/index.js b/packages/campus-online-frontend/src/pages/contato/index.js new file mode 100644 index 00000000..97223331 --- /dev/null +++ b/packages/campus-online-frontend/src/pages/contato/index.js @@ -0,0 +1,182 @@ +import React from 'react' +import styled from 'styled-components' +import {navigateTo} from 'gatsby-link' +import {compose} from 'recompose' +import {Form, withFormik} from 'formik' +import {colors} from '../../constants' +import {above} from '../../utils/responsive' +import {withLayout} from '../../components/Layout' +import Navbar from '../../components/Navbar' +import AboutHero from '../../components/AboutHero' +import MetaTags from '../../components/MetaTags' +import Container from '../../components/Container' +import {Row, Cell} from '../../components/Grid' +import {FormikField as Input} from '../../components/Input' +import {FormikField as TextArea} from '../../components/TextArea' +import Button from '../../components/Button' +import Link from '../../components/StylableLink' +import UnstyledMap from '../../components/Map' +import meta from './index.json' + + +const MapWrapper = styled.div` + position: relative; + margin-top: 2rem; + ${above.md` + margin-top: 6rem; + `}; +` + +const MapLabel = styled(Link)` + text-decoration: none; + color: currentColor; + display: inline-block; + display: inline-flex; + flex-direction: column; + padding: 1rem 0; + color: ${colors.white}; + ${above.md` + margin-top: 3rem; + padding: 2rem; + background: ${colors.base}; + z-index: 1; + position: absolute; + `}; +` + +const Address = styled.div` + font-size: 1rem; + line-height: 1.5rem; + font-weight: 600; + color: ${colors.base22}; +` + +const City = styled(Address)` + font-weight: 300; +` + +const MapZIP = styled.div` + font-size: 0.875rem; + font-weight: 400; + color: ${colors.base44}; + line-height: 1.5rem; +` + +const Map = styled(UnstyledMap)` + width: 100%; + height: 16rem; + ${above.md` + height: 25rem; + `}; +` + +const validation = ({values}) => { + const errors = {} + if (!values.name) { + errors.name = 'Nome é obrigatório' + } + if (!values.message) { + errors.message = 'Mensagem é obrigatório' + } + if (!values.email) { + errors.email = 'Email é obrigatório' + } else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(values.email)) { + errors.email = 'Email inválido' + } + return errors +} + +function encode(data) { + return Object.keys(data) + .map(key => encodeURIComponent(key) + '=' + encodeURIComponent(data[key])) + .join('&') +} + + +const ContactPage = () => ( +
+ + + + + + +
+ + + + + + + + + + +