Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
wip.
Browse files Browse the repository at this point in the history
  • Loading branch information
nisarhassan12 committed Dec 1, 2020
1 parent aa82a2b commit 8b6cabd
Show file tree
Hide file tree
Showing 14 changed files with 587 additions and 71 deletions.
41 changes: 41 additions & 0 deletions src/components/MinimalFooter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react'

import styled from '@emotion/styled'
import { Link } from 'gatsby'
import { colors } from '../styles/variables'

const StyledMinimalFooter = styled.footer`
padding: 5rem 0 6rem;
text-align: center;
color: ${colors.lightGrey};
background: ${colors.offWhite};
p {
margin-bottom: 2rem;
}
a {
padding: 0 1rem;
color: inherit;
font-weight: 400;
&:not(:last-child) {
border-right: 1px solid;
}
}
`

const MinimalFooter = () => (
<StyledMinimalFooter role="footer">
<div className="row">
<p>Copyright TypeFox All Right Reserved</p>
<div>
<Link to="/imprint">Imprint</Link>
<Link to="/terms">Terms of Service</Link>
<Link to="/privacy">Privacy Policy</Link>
</div>
</div>
</StyledMinimalFooter>
)

export default MinimalFooter
123 changes: 64 additions & 59 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const StyledNav = styled.nav`
}
`

const Nav = () => {
const Nav = ({ isAFlowPage }: { isAFlowPage?: boolean }) => {
const [isNavRendered, setIsNavRendered] = useState(false)

const unLock = () => {
Expand Down Expand Up @@ -240,68 +240,73 @@ const Nav = () => {
/>
<div className="row">
<StyledNav role="navigation" className="nav">
<div className="nav__burger-container">
<div className="nav__burger-container" style={ isAFlowPage ? {width: '100%'} : {}}>
<Link to="/"><img alt="Gitpod Logo" src={GitpodLogoDark} /></Link>
<div className="btns">
<a href="https://gitpod.io/login/" rel="noopener" style={{ display: isNavRendered ? 'none' : '' }}>Log In</a>
<div className="nav__btn-container" aria-live="assertive">
<button
className="nav__btn"
aria-label={isNavRendered ? "Hide the Navigation Items" : "Show the Navigation Items"}
onClick={toggleNavigation}
>
<svg
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31.112 31.112"
className={isNavRendered ? 'is-shown--multiply' : 'is-hidden'}
aria-hidden={isNavRendered ? false : true}
id="multiply"
{
!isAFlowPage ? <div className="btns">
<a href="https://gitpod.io/login/" rel="noopener" style={{ display: isNavRendered ? 'none' : '' }}>Log In</a>
<div className="nav__btn-container" aria-live="assertive">
<button
className="nav__btn"
aria-label={isNavRendered ? "Hide the Navigation Items" : "Show the Navigation Items"}
onClick={toggleNavigation}
>
<title>close menu icon</title>
<path d="M31.112 1.414L29.698 0 15.556 14.142 1.414 0 0 1.414l14.142 14.142L0 29.698l1.414 1.414L15.556 16.97l14.142 14.142 1.414-1.414L16.97 15.556z" />
</svg>
<svg
className={isNavRendered ? 'is-hidden' : 'is-shown'}
aria-hidden={isNavRendered ? true : false}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 26 18"
id="hamburger"
>
<title>hamburger menu icon</title>
<g transform="translate(-647.5 -86.5)" strokeWidth="2"><line x2="24" transform="translate(648.5 87.5)" /><line x2="24" transform="translate(648.5 95.5)" /><line x2="24" transform="translate(648.5 103.5)" /></g>
</svg>
</button>
</div>
</div>
<svg
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31.112 31.112"
className={isNavRendered ? 'is-shown--multiply' : 'is-hidden'}
aria-hidden={isNavRendered ? false : true}
id="multiply"
>
<title>close menu icon</title>
<path d="M31.112 1.414L29.698 0 15.556 14.142 1.414 0 0 1.414l14.142 14.142L0 29.698l1.414 1.414L15.556 16.97l14.142 14.142 1.414-1.414L16.97 15.556z" />
</svg>
<svg
className={isNavRendered ? 'is-hidden' : 'is-shown'}
aria-hidden={isNavRendered ? true : false}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 26 18"
id="hamburger"
>
<title>hamburger menu icon</title>
<g transform="translate(-647.5 -86.5)" strokeWidth="2"><line x2="24" transform="translate(648.5 87.5)" /><line x2="24" transform="translate(648.5 95.5)" /><line x2="24" transform="translate(648.5 103.5)" /></g>
</svg>
</button>
</div>
</div> : null
}
{
isAFlowPage ? <a className="btn">Reinstall Extension</a> : null
}
</div>


<ul className={`nav__items ${isNavRendered ? 'navIsRendered' : 'navIsNotRendered'}`} >
<li className="nav__item"><Link activeClassName="active" to='/features/' className="link">Features</Link></li>
<li className="nav__item"><Link activeClassName="active" to='/self-hosted/' className="link">Self-Hosted</Link></li>
<li className="nav__item"><Link activeClassName="active" to='/pricing/' className="link">Pricing</Link></li>
<li className="nav__item">
<DropDown
title="Resources"
links={[
{
text: 'Docs',
to: '/docs/'
},
{
text: 'Blog',
to: '/blog/'
},
{
text: 'Community',
to: 'https://community.gitpod.io/',
target: true
}
]}
/>
</li>
<li className="nav__item"><a href="https://gitpod.io/login/" rel="noopener" className="btn btn--small">Log In</a></li>
</ul>

{
!isAFlowPage ? <ul className={`nav__items ${isNavRendered ? 'navIsRendered' : 'navIsNotRendered'}`} >
<li className="nav__item"><Link activeClassName="active" to='/features/' className="link">Features</Link></li>
<li className="nav__item"><Link activeClassName="active" to='/self-hosted/' className="link">Self-Hosted</Link></li>
<li className="nav__item"><Link activeClassName="active" to='/pricing/' className="link">Pricing</Link></li>
<li className="nav__item">
<DropDown
title="Resources"
links={[
{
text: 'Docs',
to: '/docs/'
},
{
text: 'Blog',
to: '/blog/'
},
{
text: 'Community',
to: 'https://community.gitpod.io/',
target: true
}
]}
/>
</li>
<li className="nav__item"><a href="https://gitpod.io/login/" rel="noopener" className="btn btn--small">Log In</a></li>
</ul> : null
}
</StyledNav>
</div>
</div>
Expand Down
142 changes: 142 additions & 0 deletions src/components/extension-deletion/Form.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
import React, { useState, useEffect } from 'react'
import styled from '@emotion/styled'
import { borders } from '../../styles/variables'
import { Email } from '../../functions/submit-form'
import tick from '../../resources/tick.svg'

const StyledForm = styled.form`
p {
margin-bottom: 1.2rem;
}
label, textarea {
display: flex;
align-items: center;
}
label {
&:not(:last-of-type) {
margin-bottom: .7rem;
}
}
textarea {
width: 100%;
min-height: 100px;
margin: 1.5rem 0;
padding: 1rem;
border: ${borders.light2};
border-radius: 3px;
}
input {
margin-right: 1rem;
}
.sucess {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
}
.tick {
margin-bottom: 3rem;
}
`

const Form = () => {
const [state, setState] = useState<{
feedback: string
otherFeedback?: string
messageSent?: boolean
}>({
feedback: ''
})

useEffect(() => {
console.log(state)
}, [state])

const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const text = e.target.getAttribute('data-text')
setState({
...state,
feedback: e.target.checked ? state.feedback + `\n${text}` : state.feedback.replace(`\n${text}`, '')
})
}

const handleTextAreaChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
setState({
...state,
[e.target.name]: e.target.value
})
}

const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault()

const email: Email = {
subject: 'Why did I uninstall the browser extension?',
feedback: state.feedback,
otherFeedback: state.otherFeedback
}

fetch('/.netlify/functions/submit-form', {
method: 'POST',
body: JSON.stringify(email)
})
.then(() =>
setState({
...state,
messageSent: true
})
)
.catch((error) => alert(error))
}

return (
<StyledForm
method="POST"
name="Extension Deletion"
onSubmit={handleSubmit}
>
{
!state.messageSent ? (
<>
<input type="hidden" name="form-name" value="extension-deletion" />
<h3>Why did you uninstall the browser extension?</h3>
<p>Check all that apply:</p>
<div>
<label>
<input type="checkbox" onChange={handleChange} name="usage" data-text="I never used it" />
I never used it
</label>
<label>
<input type="checkbox" onChange={handleChange} name="configuring" data-text="I have problems configuring my projects" />
I have problems configuring my projects
</label>
<label>
<input type="checkbox" onChange={handleChange} name="local" data-text="I prefer my local development" />
I prefer my local development
</label>
<label>
<input type="checkbox" onChange={handleChange} name="expected" data-text="Gitpod isn’t what I expected" />
Gitpod isn’t what I expected
</label>
<textarea onChange={handleTextAreaChange} aria-label="Do you have any other feedback?" placeholder="Do you have any other feedback?" name="otherFeedback"></textarea>
<button className="btn" disabled={!state.feedback}>Send</button>
</div>
</>) : (
<div className="sucess">
<img src={tick} className="tick" alt="Tick" />
<h3>Thanks for your Feedback</h3>
</div>
)
}
</StyledForm>
)
}

export default Form
47 changes: 47 additions & 0 deletions src/components/extension-deletion/Message.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from 'react'
import Sven from '../../resources/sven.png'
import SvenName from '../../resources/sven-signature-style-name.svg'
import styled from '@emotion/styled'
import { colors } from '../../styles/variables'

const StyledMessage = styled.blockquote`
padding: 4rem 5rem;
background: ${colors.offWhite};
@media(min-width: 1001px) {
min-width: 400px;
}
.sig {
display: block;
margin-top: 1.5rem;
}
.ceo {
display: flex;
align-items: center;
margin-top: 5rem;
img {
height: 6rem;
margin-right: 1rem;
}
}
`

const Message = () => (
<StyledMessage>
<p>Hey there,</p>
<p>It’d be great if you could shortly let us know why you uninstalled the browser extension.</p>
<p>We’d like your feedback to understand how we can make Gitpod more useful. We’re committed to improving it, and we’re hoping to see you soon again.
</p>
<p>Best,</p>
<img src={SvenName} className="sig" alt="Sven" title="Sven" />
<div className="ceo">
<img src={Sven} alt="Sven Efftinge" />
<p>Co-Founder & CEO</p>
</div>
</StyledMessage>
)

export default Message
Loading

0 comments on commit 8b6cabd

Please sign in to comment.