-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
show task as done on done's tab (#31)
- Loading branch information
1 parent
5428f7d
commit f03cbb2
Showing
5 changed files
with
150 additions
and
132 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
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,53 @@ | ||
'use strict' | ||
|
||
// Packages | ||
import Link from 'next/link' | ||
|
||
const TaskActions = ({ task, onDelete, onMove }) => { | ||
const { id, type } = task | ||
const isToday = type === 'today' ? 'done' : 'today' | ||
const nextType = type === 'today' ? 'today' : 'backlog' | ||
|
||
return ( | ||
<ul> | ||
{type !== 'done' ? ( // eslint-disable-line no-negated-condition | ||
<li onClick={() => onMove(nextType, task)}>{isToday}</li> | ||
) : null} | ||
|
||
{type !== 'backlog' ? ( // eslint-disable-line no-negated-condition | ||
<li onClick={() => onMove('back', task)}>backlog</li> | ||
) : null} | ||
|
||
<li> | ||
<Link href={`/edit?id=${id}`}> | ||
<span>view</span> | ||
</Link> | ||
</li> | ||
|
||
<li onClick={() => onDelete(task)}>delete</li> | ||
|
||
<style jsx>{` | ||
li { | ||
color: white; | ||
display: inline-block; | ||
font-size: 11px; | ||
font-weight: 600; | ||
margin-right: 10px; | ||
color: #868e96; | ||
cursor: pointer; | ||
} | ||
span { | ||
color: #868e96; | ||
} | ||
li:hover, | ||
span:hover { | ||
color: white; | ||
} | ||
`}</style> | ||
</ul> | ||
) | ||
} | ||
|
||
export default TaskActions |
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,58 @@ | ||
'use strict' | ||
|
||
const TaskCheck = ({ task, onMove }) => { | ||
const { type } = task | ||
const isDone = type === 'done' ? 'is-done' : '' | ||
const nextMove = type === 'backlog' ? 'backlog' : 'today' | ||
const hasAction = type === 'done' ? null : nextMove | ||
|
||
return ( | ||
<div> | ||
<label className={isDone} onClick={() => onMove(hasAction, task)} /> | ||
|
||
<style jsx>{` | ||
label { | ||
height: 12px; | ||
width: 12px; | ||
display: block; | ||
border: 1px dotted rgba(255, 255, 255, 0.75); | ||
border-radius: 50%; | ||
margin-right: 10px; | ||
margin-top: 6px; | ||
cursor: pointer; | ||
transition: 0.15s; | ||
position: relative; | ||
} | ||
label:hover { | ||
border-color: white; | ||
border-style: solid; | ||
} | ||
.is-done { | ||
background-color: transparent; | ||
border: 0; | ||
cursor: default; | ||
} | ||
.is-done:after { | ||
display: inline-block; | ||
width: 6px; | ||
height: 2px; | ||
position: absolute; | ||
left: 2px; | ||
top: 3px; | ||
border: 2px solid #00e7c0; | ||
border-top: 0; | ||
border-right: 0; | ||
color: #00e7c0; | ||
opacity: 1; | ||
transform: rotate(-45deg) scale(1); | ||
content: ''; | ||
} | ||
`}</style> | ||
</div> | ||
) | ||
} | ||
|
||
export default TaskCheck |
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,25 @@ | ||
'use strict' | ||
|
||
// Packages | ||
import reactHashAvatar from 'react-hash-avatar' | ||
import renderHTML from 'react-render-html' | ||
|
||
const TaskProject = ({ project }) => { | ||
if (project) { | ||
return ( | ||
<span title={project}> | ||
{renderHTML(reactHashAvatar(project, { size: 8, radius: '50px' }))} | ||
|
||
<style jsx>{` | ||
span { | ||
flex-basis: 10px; | ||
} | ||
`}</style> | ||
</span> | ||
) | ||
} | ||
|
||
return null | ||
} | ||
|
||
export default TaskProject |
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