-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8414a8
commit 272e3c3
Showing
3 changed files
with
85 additions
and
1 deletion.
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,3 @@ | ||
.honey-wrapper { | ||
display: none; | ||
} |
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,70 @@ | ||
/** | ||
* HoneypotWidget component. | ||
* @module components/manage/Widgets/HoneypotWidget | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import TextWidget from '@plone/volto/components/manage/Widgets/TextWidget'; | ||
import './HoneypotWidget.css'; | ||
|
||
/** | ||
* HoneypotWidget component class. | ||
* @function HoneypotWidget | ||
* @returns {string} Markup of the component. | ||
*/ | ||
const HoneypotWidget = ({ | ||
id, | ||
title, | ||
required, | ||
description, | ||
error, | ||
value = [], | ||
valueList, | ||
onChange, | ||
}) => { | ||
return ( | ||
<div className="honey-wrapper"> | ||
<TextWidget | ||
id={id} | ||
name={id} | ||
title={title} | ||
description={description} | ||
onChange={onChange} | ||
value={value} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
/** | ||
* Property types. | ||
* @property {Object} propTypes Property types. | ||
* @static | ||
*/ | ||
HoneypotWidget.propTypes = { | ||
id: PropTypes.string.isRequired, | ||
title: PropTypes.string.isRequired, | ||
description: PropTypes.string, | ||
required: PropTypes.bool, | ||
error: PropTypes.arrayOf(PropTypes.string), | ||
wrapped: PropTypes.bool, | ||
}; | ||
|
||
/** | ||
* Default properties. | ||
* @property {Object} defaultProps Default properties. | ||
* @static | ||
*/ | ||
HoneypotWidget.defaultProps = { | ||
description: null, | ||
required: false, | ||
error: [], | ||
value: [], | ||
onChange: null, | ||
onEdit: null, | ||
onDelete: null, | ||
}; | ||
|
||
export default HoneypotWidget; |