-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from bocoup/form-flow-improvements
Re-structure annotation form for better ux flow with fewer errors
- Loading branch information
Showing
12 changed files
with
315 additions
and
95 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
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 |
---|---|---|
@@ -1,32 +1,20 @@ | ||
label { | ||
display: block; | ||
margin: 10px 0px; | ||
} | ||
|
||
.radioButton { | ||
text-transform: capitalize; | ||
} | ||
@import './shared/mixins.styl'; | ||
|
||
.carousel { | ||
.progressBar { | ||
margin: 0.5em 0; | ||
width: 100%; | ||
text-align: center; | ||
} | ||
.prev, | ||
.current, | ||
.next { | ||
display: inline-block; | ||
text-align: center; | ||
} | ||
|
||
.prev, | ||
.next { | ||
padding: 5px 10px; | ||
border: 1px solid grey; | ||
background-color: #ececec; | ||
.save { | ||
button(); | ||
} | ||
.prev { | ||
float: left; | ||
} | ||
.next { | ||
.save { | ||
float: right; | ||
} | ||
|
||
.hidden { | ||
visually-hidden(); | ||
} |
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,46 @@ | ||
import React, { PropTypes } from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
import styles from './ProgressBar.styl'; | ||
|
||
const ProgressBar = ({ | ||
className, | ||
incrementName, | ||
current, | ||
total, | ||
}) => { | ||
const complete = current - 1; | ||
const widthPct = (100 / total) * complete; | ||
return ( | ||
<div className={classNames(className, styles.barContainer)}> | ||
<span className={styles.label}> | ||
{incrementName} {current} of {total} | ||
</span> | ||
<div | ||
className={classNames(styles.bar, { | ||
// Add a class to apply smooth transitions after the first step | ||
[styles.inProgress]: complete > 0, | ||
})} | ||
style={{ | ||
width: `${widthPct}%`, | ||
}} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
ProgressBar.propTypes = { | ||
className: PropTypes.string, | ||
// e.g. "Step" or "Image" | ||
incrementName: PropTypes.string.isRequired, | ||
// "current" starts at 1 | ||
current: PropTypes.number.isRequired, | ||
// Total item count | ||
total: PropTypes.number.isRequired, | ||
}; | ||
|
||
ProgressBar.defaultProps = { | ||
className: '', | ||
}; | ||
|
||
export default ProgressBar; |
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,20 @@ | ||
@import './shared/mixins.styl'; | ||
|
||
.label { | ||
visually-hidden(); | ||
} | ||
|
||
.barContainer { | ||
height: 5px; | ||
width: 100%; | ||
border: 1px solid #444; | ||
} | ||
|
||
.bar { | ||
height: 5px; | ||
background: #222; | ||
} | ||
|
||
.inProgress { | ||
transition: width 200ms; | ||
} |
Oops, something went wrong.