-
Notifications
You must be signed in to change notification settings - Fork 4
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 #431 from codaco/feature/inline-forms
Edit forms inline
- Loading branch information
Showing
112 changed files
with
1,303 additions
and
909 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "", | ||
"variableRegistry": { | ||
"codebook": { | ||
"node": {}, | ||
"edge": {} | ||
}, | ||
|
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,26 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const Badge = ({ color, children }) => { | ||
const style = color ? | ||
{ backgroundColor: color } : | ||
{}; | ||
|
||
return ( | ||
<div className="badge" style={style}> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
|
||
Badge.propTypes = { | ||
color: PropTypes.string, | ||
children: PropTypes.node, | ||
}; | ||
|
||
Badge.defaultProps = { | ||
color: null, | ||
children: null, | ||
}; | ||
|
||
export default Badge; |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import cx from 'classnames'; | ||
import Icon from '../../ui/components/Icon'; | ||
|
||
const FieldError = ({ error, show }) => { | ||
const errorClasses = cx( | ||
'form-field-error', | ||
{ 'form-field-error--show': show }, | ||
); | ||
|
||
return ( | ||
<div className={errorClasses}> | ||
<Icon name="warning" /> { error } | ||
</div> | ||
); | ||
}; | ||
|
||
FieldError.propTypes = { | ||
error: PropTypes.string, | ||
show: PropTypes.bool, | ||
}; | ||
|
||
FieldError.defaultProps = { | ||
show: false, | ||
error: null, | ||
}; | ||
|
||
export default FieldError; |
Oops, something went wrong.