Skip to content

Commit

Permalink
settings — app info
Browse files Browse the repository at this point in the history
  • Loading branch information
bukinoshita committed Feb 13, 2018
1 parent 596e01c commit 766cba8
Show file tree
Hide file tree
Showing 11 changed files with 435 additions and 205 deletions.
49 changes: 20 additions & 29 deletions renderer/components/hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,35 @@ import { colors, typography } from './../theme'
const Hero = ({ type }) => {
return (
<header>
<div>
<h1>{type}</h1>

<Link href="/settings" prefetch>
<svg
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<circle cx="12" cy="12" r="3" />
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" />
</svg>
</Link>
</div>
<h1>{type}</h1>

<Link href="/settings" prefetch>
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<circle cx="12" cy="12" r="3" />
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" />
</svg>
</Link>

<style jsx>{`
header {
flex-basis: 115px;
display: flex;
align-items: flex-end;
padding-bottom: 20px;
}
div {
width: 100%;
padding-top: 50px;
display: flex;
justify-content: space-between;
align-items: center;
justify-content: space-between;
}
h1 {
color: ${colors.white};
font-size: ${typography.f30};
font-size: ${typography.f32};
}
svg {
Expand Down
32 changes: 32 additions & 0 deletions renderer/components/icons/arrow-right.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict'

const ArrowRight = () => {
return (
<svg width="12px" height="10px" viewBox="0 0 12 10">
<g
stroke="none"
strokeWidth="1"
fill="none"
fillRule="evenodd"
transform="translate(-284.000000, -239.000000)"
strokeLinecap="round"
strokeLinejoin="round"
>
<g
transform="translate(25.000000, 167.000000)"
stroke="#FFFFFF"
strokeWidth="1.25"
>
<g transform="translate(0.000000, 58.000000)">
<g transform="translate(260.000000, 15.000000)">
<path d="M0,4 L10,4" />
<polyline points="6.25 0 10 4 6.25 8" />
</g>
</g>
</g>
</g>
</svg>
)
}

export default ArrowRight
27 changes: 27 additions & 0 deletions renderer/components/icons/github.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions renderer/components/icons/product-hunt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict'

const ProductHunt = () => {
return (
<svg width="16px" height="16px" viewBox="0 0 16 16">
<g
stroke="none"
strokeWidth="1"
fill="none"
fillRule="evenodd"
transform="translate(-183.000000, -534.000000)"
>
<g transform="translate(121.000000, 534.000000)" fillRule="nonzero">
<g transform="translate(62.000000, 0.000000)">
<path
d="M8,16 C12.4184,16 16,12.4184 16,8 C16,3.5816 12.4184,0 8,0 C3.5816,0 0,3.5816 0,8 C0,12.4184 3.5816,16 8,16 Z"
fill="#FFFFFF"
/>
<path
d="M6,4.8 L6,11.2 L7.2,11.2 L7.2,9.2 L9.016,9.2 C10.222,9.168 11.2,8.19 11.2,7 C11.2,5.778 10.222,4.8 9.016,4.8 L6,4.8 Z M9.0308,8 L7.2,8 L7.2,6 L9.0308,6 C9.566,6 10,6.448 10,7 C10,7.552 9.566,8 9.0308,8 Z"
fill="#000000"
/>
</g>
</g>
</g>
</svg>
)
}

export default ProductHunt
27 changes: 27 additions & 0 deletions renderer/components/icons/twitter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict'

const Twitter = () => {
return (
<svg width="16px" height="13px" viewBox="0 0 16 13">
<g
stroke="none"
strokeWidth="1"
fill="none"
fillRule="evenodd"
transform="translate(-121.000000, -535.000000)"
>
<g
transform="translate(121.000000, 534.000000)"
fill="#FFFFFF"
fillRule="nonzero"
>
<g transform="translate(0.000000, 1.000000)">
<path d="M16,1.58301597 C15.4113026,1.84284437 14.7786532,2.01845133 14.1146348,2.09743078 C14.7924064,1.69309794 15.3128644,1.05287516 15.5579648,0.290047842 C14.9237353,0.664384799 14.2212078,0.936269803 13.4734994,1.08281279 C12.8746772,0.44789025 12.0215662,0.0511291866 11.0774498,0.0511291866 C9.26453781,0.0511291866 7.79475475,1.51382158 7.79475475,3.31794283 C7.79475475,3.57398535 7.82384137,3.82332976 7.87979075,4.06242314 C5.15161491,3.92618942 2.73285782,2.62559128 1.11383737,0.649124758 C0.831281319,1.13162162 0.669402687,1.69280672 0.669402687,2.29150122 C0.669402687,3.42487961 1.24897034,4.42482 2.12976334,5.01064248 C1.59163101,4.99369335 1.08551154,4.84674265 0.642891106,4.6020578 C0.642657012,4.615687 0.642657012,4.62937444 0.642657012,4.64312012 C0.642657012,6.22597076 1.77416877,7.54637205 3.27584769,7.84644732 C3.00037309,7.92111671 2.71038443,7.96101414 2.41097334,7.96101414 C2.19946596,7.96101414 1.99381104,7.94057031 1.79342331,7.90242022 C2.21111233,9.20033916 3.42338783,10.1448308 4.85981199,10.1712156 C3.73637661,11.0473865 2.32096272,11.5696644 0.783057169,11.5696644 C0.518116976,11.5696644 0.256805296,11.5542296 0,11.5240589 C1.45269396,12.4509608 3.17817038,12.9917604 5.03193241,12.9917604 C11.0697831,12.9917604 14.3714986,8.01378357 14.3714986,3.69676461 C14.3714986,3.55511416 14.3683383,3.41422088 14.3620176,3.27414302 C15.0033286,2.81354606 15.5598961,2.23814932 16,1.58301597" />
</g>
</g>
</g>
</svg>
)
}

export default Twitter
67 changes: 67 additions & 0 deletions renderer/components/navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
'use strict'

// Packages
import Link from 'next/link'
import PropTypes from 'prop-types'

// Theme
import { colors, typography } from './../theme'

const Navigation = ({ list, tabSelected }) => {
return (
<nav>
<ul>
{list.map(({ name, href }) => {
return (
<li key={name} className={tabSelected === name ? 'active' : ''}>
<Link href={href}>
<span>{name}</span>
</Link>
</li>
)
})}
</ul>

<style jsx>{`
ul {
width: 100%;
overflow-x: auto;
white-space: nowrap;
padding-top: 30px;
padding-bottom: 30px;
}
li {
display: inline-block;
font-size: ${typography.f14};
margin-right: 15px;
font-weight: ${typography.semibold};
}
li:last-child {
margin-right: 0;
}
.active span {
color: ${colors.white};
}
span {
color: ${colors.romanSilver};
cursor: pointer;
transition: 0.2s;
}
span:hover {
color: ${colors.white};
}
`}</style>
</nav>
)
}

Navigation.propTypes = {
list: PropTypes.array.isRequired
}

export default Navigation
71 changes: 71 additions & 0 deletions renderer/components/settings/app-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
'use strict'

// Packages
import { remote } from 'electron'

// Components
import Item from './item'
import ArrowRightIcon from './../icons/arrow-right'

// Theme
import { colors, typography } from './../../theme'

const AppInfo = () => {
const appVersion = remote && remote.app ? remote.app.getVersion() : '1.0.0'

return (
<ul>
<Item name="Version" description="macOS app version">
<span>v{appVersion}</span>
</Item>

<Item
name="Website"
description="Taskr official website"
url="https://gettaskr.now.sh"
>
<ArrowRightIcon />
</Item>

<Item
name="Support"
description="Send an email to us for support or to report a bug"
url="https://gettaskr.now.sh/support"
>
<ArrowRightIcon />
</Item>

<Item
name="Terms of Services"
description="Our Terms of Services"
url="https://gettaskr.now.sh/tos"
>
<ArrowRightIcon />
</Item>

<Item
name="Privacy Policy"
description="Our Policy"
url="https://gettaskr.now.sh/privacy"
>
<ArrowRightIcon />
</Item>

<style jsx>{`
ul {
height: calc(580px - 215px);
padding-bottom: 10px;
overflow-y: auto;
}
span {
color: ${colors.white};
font-size: ${typography.f16};
font-weight: ${typography.bold};
}
`}</style>
</ul>
)
}

export default AppInfo
56 changes: 56 additions & 0 deletions renderer/components/settings/item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
'use strict'

// Packages
import { shell } from 'electron'

// Theme
import { colors, typography } from './../../theme'

const Item = ({ children, name, description, url }) => {
return (
<li onClick={url ? () => shell.openExternal(url) : undefined}>
<div>
<span>{name}</span>
<p>{description}</p>
</div>

{children}

<style jsx>{`
li {
display: flex;
justify-content: space-between;
width: 100%;
margin-bottom: 20px;
align-items: center;
cursor: ${url ? 'pointer' : 'default'};
transition: 0.2s;
}
li:hover {
transform: ${url ? 'translateY(-4px)' : 'translateY(0)'};
}
div {
flex-basis: 70%;
}
span {
color: ${colors.white};
font-size: ${typography.f16};
font-weight: ${typography.bold};
}
p {
color: ${colors.romanSilver};
font-size: ${typography.f12};
font-weight: ${typography.regular};
line-height: 16px;
margin-top: 5px;
}
`}</style>
</li>
)
}

export default Item

0 comments on commit 766cba8

Please sign in to comment.