-
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
cd294c4
commit 2723f52
Showing
5 changed files
with
54 additions
and
78 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
File renamed without changes.
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,43 @@ | ||
/** | ||
* HoneypotCaptchaWidget component. | ||
* @module components/manage/Widgets/HoneypotCaptchaWidget | ||
*/ | ||
|
||
import React, { useState } from 'react'; | ||
|
||
import TextWidget from '@plone/volto/components/manage/Widgets/TextWidget'; | ||
import './HoneypotCaptchaWidget.css'; | ||
|
||
/** | ||
* HoneypotCaptchaWidget component class. | ||
* @function HoneypotCaptchaWidget | ||
* @returns {string} Markup of the component. | ||
*/ | ||
const HoneypotCaptchaWidget = ({ id, id_check, title, captchaToken }) => { | ||
const createToken = (id, id_check, value) => { | ||
const token = { | ||
id: id, | ||
id_check: id_check, | ||
value: value, | ||
}; | ||
return JSON.stringify(token); | ||
}; | ||
const [value, setValue] = useState(); | ||
return ( | ||
<div className="honey-wrapper" key={'honeypot-captcha'}> | ||
<TextWidget | ||
id={id} | ||
name={id} | ||
label={title} | ||
title={title} | ||
onChange={(field, value) => { | ||
captchaToken.current = createToken(id, id_check, value); | ||
setValue(value); | ||
}} | ||
value={value} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default HoneypotCaptchaWidget; |
This file was deleted.
Oops, something went wrong.