Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@f02c6aa from refs/heads/release/5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed Feb 14, 2024
1 parent 08fc6af commit d207455
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion blocks/form-captcha/build/render.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
namespace PRC\Platform\Blocks;
use PRC_HCAPTCHA_KEY;

wp_enqueue_script('cloudflare-turnstile');

Expand All @@ -10,6 +9,7 @@
'data-wp-interactive' => wp_json_encode(array('namespace' => 'prc-block/form-captcha')),
'data-wp-context' => wp_json_encode(array(
'targetNamespace' => $interactive_namespace,
'siteKey' => PRC_PLATFORM_TURNSTILE_SITE_KEY
)),
'data-wp-watch--onDisplayCaptcha' => 'callbacks.onDisplayCaptcha',
'data-wp-bind--hidden' => $interactive_namespace . '::' . 'context.captchaHidden',
Expand Down
2 changes: 1 addition & 1 deletion blocks/form-captcha/build/view.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('@wordpress/interactivity', 'wp-polyfill'), 'version' => 'f9005b390391434549a8', 'type' => 'module');
<?php return array('dependencies' => array('@wordpress/interactivity', 'wp-polyfill'), 'version' => 'db36ecb026780aef8f11', 'type' => 'module');
2 changes: 1 addition & 1 deletion blocks/form-captcha/build/view.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/form-captcha/build/view.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/form-captcha/src/render.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
namespace PRC\Platform\Blocks;
use PRC_HCAPTCHA_KEY;

wp_enqueue_script('cloudflare-turnstile');

Expand All @@ -10,6 +9,7 @@
'data-wp-interactive' => wp_json_encode(array('namespace' => 'prc-block/form-captcha')),
'data-wp-context' => wp_json_encode(array(
'targetNamespace' => $interactive_namespace,
'siteKey' => PRC_PLATFORM_TURNSTILE_SITE_KEY
)),
'data-wp-watch--onDisplayCaptcha' => 'callbacks.onDisplayCaptcha',
'data-wp-bind--hidden' => $interactive_namespace . '::' . 'context.captchaHidden',
Expand Down
4 changes: 2 additions & 2 deletions blocks/form-captcha/src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ store('prc-block/form-captcha', {
callbacks: {
onDisplayCaptcha: () => {
const context = getContext();
const { targetNamespace } = context;
const { targetNamespace, siteKey } = context;
const targetContext = getContext(targetNamespace);
const isHidden = targetContext.captchaHidden;
// When we reach the point of the form where the captcha should be displayed, render it.
Expand All @@ -27,7 +27,7 @@ store('prc-block/form-captcha', {
const { turnstile } = window;
turnstile.ready(() => {
turnstile.render(target, {
sitekey: '0x4AAAAAAAPM0JJJz5nbcTZZ',
sitekey: siteKey,
callback: (token) => {
console.log(`Challenge Success ${token}`);
targetContext.captchaToken = token;
Expand Down

0 comments on commit d207455

Please sign in to comment.