-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21faed3
commit cc82378
Showing
17 changed files
with
598 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import React, { useState } from 'react' | ||
import { designTokens } from '@components/Theme/designTokens' | ||
import styled, { css } from 'styled-components' | ||
import { ChevronDown } from 'react-feather' | ||
|
||
const ContainerStyles = css` | ||
border: 1px solid var(--grey200); | ||
border-radius: ${designTokens.space[2]}; | ||
margin-bottom: ${designTokens.space[4]}; | ||
position: relative; | ||
box-shadow: 0px 1px 3px rgba(0,0,0,0.12); | ||
transition: all 120ms ease-out 0s; | ||
` | ||
|
||
const AccordionContainer = styled.div` | ||
${ContainerStyles} | ||
` | ||
|
||
const AccordionControl = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: ${designTokens.space[3]} ${designTokens.space[4]}; | ||
font-size: ${designTokens.fontSizes[1]}; | ||
cursor: pointer; | ||
width: 100%; | ||
appearance: none; | ||
background: transparent; | ||
border-bottom: 1px solid var(--grey200); | ||
font-weight: ${designTokens.fontWeights.bold}; | ||
transition: all 120ms ease-out 0s; | ||
&:hover, &:focus { | ||
color: var(--grey700); | ||
} | ||
.icon { | ||
transition: all 200ms ease-out 0s; | ||
} | ||
.open { | ||
transform: rotate(180deg); | ||
} | ||
` | ||
|
||
const AccordionBody = styled.div` | ||
padding: ${designTokens.space[3]} ${designTokens.space[4]}; | ||
color: var(--grey700); | ||
p { | ||
&:last-of-type { | ||
margin-bottom: 0; | ||
} | ||
} | ||
` | ||
|
||
const Accordion = ({children, label, open}) => { | ||
|
||
const [active, setActive] = useState(open) | ||
|
||
return( | ||
<AccordionContainer> | ||
<AccordionControl role="button" onClick={() => setActive(!active)}> | ||
{label} | ||
<ChevronDown size="20" className={active ? 'icon open' : 'icon closed'}/> | ||
</AccordionControl> | ||
{ | ||
active ? ( | ||
<AccordionBody> | ||
{children} | ||
</AccordionBody> | ||
) | ||
: | ||
null | ||
} | ||
</AccordionContainer> | ||
) | ||
} | ||
|
||
export default Accordion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import styled, { css } from 'styled-components' | ||
import { designTokens } from '@components/Theme/designTokens' | ||
import { Send } from 'react-feather' | ||
|
||
const ContactContainer = styled.a` | ||
export const ContainerStyles = css` | ||
padding-top: ${designTokens.space[5]}; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: start; | ||
border: 1px solid var(--grey200); | ||
border-radius: ${designTokens.space[2]}; | ||
margin-bottom: ${designTokens.space[6]}; | ||
margin-bottom: ${designTokens.space[4]}; | ||
position: relative; | ||
box-shadow: 0px 1px 3px rgba(0,0,0,0.12); | ||
transition: all 120ms ease-out 0s; | ||
@media screen and (max-width: ${designTokens.breakpoints[4]}) { | ||
padding-top: ${designTokens.space[6]}; | ||
} | ||
` | ||
|
||
const ContactContainerLink = styled.a` | ||
${ContainerStyles} | ||
margin-bottom: ${designTokens.space[6]}; | ||
@media screen and (max-width: ${designTokens.breakpoints[4]}) { | ||
padding-top: ${designTokens.space[6]}; | ||
} | ||
&:hover, &:focus { | ||
text-decoration: none; | ||
img { | ||
|
@@ -25,9 +33,22 @@ const ContactContainer = styled.a` | |
} | ||
` | ||
|
||
const ContactTitle = styled.h3` | ||
const ContactContainer = styled.div` | ||
margin-top: ${designTokens.space[6]}; | ||
${ContainerStyles} | ||
` | ||
|
||
const ContactH3 = styled.h3` | ||
margin-top: 0; | ||
margin-bottom: ${designTokens.space[3]}; | ||
` | ||
|
||
const ContactH2 = styled.h2` | ||
margin-top: 0; | ||
` | ||
|
||
const ContactH1 = styled.h1` | ||
margin-top: 0; | ||
margin-bottom: ${designTokens.space[2]}; | ||
` | ||
|
||
const ContactContent = styled.div` | ||
|
@@ -94,16 +115,54 @@ const ImgContainer = styled.div` | |
} | ||
` | ||
|
||
export default function ContactBox() { | ||
const ProfileImageFlares = styled.div` | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
background: transparent; | ||
user-select: none; | ||
&:before, &:after { | ||
content: ''; | ||
position: absolute; | ||
top: -${designTokens.space[5]}; | ||
right: -${designTokens.space[2]}; | ||
width: ${designTokens.space[4]}; | ||
height: ${designTokens.space[4]}; | ||
display: block; | ||
background: var(--secondaryTransparent); | ||
border-radius: 50%; | ||
} | ||
&:after { | ||
top: 0; | ||
right: -${designTokens.space[4]}; | ||
width: ${designTokens.space[3]}; | ||
height: ${designTokens.space[3]}; | ||
background: var(--tertiaryTransparent); | ||
} | ||
` | ||
const ContactLink = styled.a` | ||
display: inline-flex; | ||
align-items: center; | ||
border-radius: calc(${designTokens.space[1]}/2); | ||
transition: all 120ms ease-out 0s; | ||
&:hover, &:focus { | ||
background: var(--primaryTransparent); | ||
box-shadow: 0px 0px 0px ${designTokens.space[2]} var(--primaryTransparent); | ||
} | ||
` | ||
|
||
const ContactBox = () => { | ||
return( | ||
<ContactContainer href="mailto:[email protected]"> | ||
<ContactContainerLink href="mailto:[email protected]"> | ||
<ImgContainer> | ||
<img src="/static/thanks.png"/> | ||
</ImgContainer> | ||
<ContactContent> | ||
<ContactTitle> | ||
<ContactH3> | ||
Hey, I'm Ryan! | ||
</ContactTitle> | ||
</ContactH3> | ||
<p> | ||
I'm a product designer - currently based in Tampa, FL. If you're looking for help or would like to chat, reach out! | ||
</p> | ||
|
@@ -112,6 +171,43 @@ export default function ContactBox() { | |
<Send size="20"/> | ||
Send me an email! | ||
</ContentFooter> | ||
</ContactContainerLink> | ||
) | ||
} | ||
|
||
export const ContactAbout = ({img, title, children}) => { | ||
return( | ||
<ContactContainer> | ||
{ | ||
img ? ( | ||
<ImgContainer> | ||
<img src={img}/> | ||
<ProfileImageFlares/> | ||
</ImgContainer> | ||
) | ||
: | ||
null | ||
} | ||
<ContactContent> | ||
{ | ||
title ? ( | ||
<ContactH1> | ||
{title} | ||
</ContactH1> | ||
) | ||
: | ||
null | ||
} | ||
{children} | ||
</ContactContent> | ||
<ContentFooter> | ||
<ContactLink href="mailto:[email protected]"> | ||
<Send size="20"/> | ||
Send me an email! | ||
</ContactLink> | ||
</ContentFooter> | ||
</ContactContainer> | ||
) | ||
} | ||
} | ||
|
||
export default ContactBox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.