mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
parent
d558a185de
commit
10e65f7fe8
3 changed files with 6 additions and 12 deletions
|
@ -11,8 +11,8 @@ import ActionHandler from './actions';
|
|||
import './App.css';
|
||||
import NotificationParser from './utils/notifications';
|
||||
import {allowCompMemberUpgrade, createPopupNotification, getCurrencySymbol, getFirstpromoterId, getPriceIdFromPageQuery, getProductCadenceFromPrice, getProductFromId, getQueryPrice, getSiteDomain, isActiveOffer, isComplimentaryMember, isInviteOnlySite, isPaidMember, isSentryEventAllowed, removePortalLinkFromUrl} from './utils/helpers';
|
||||
import {handleDataAttributes} from './data-attributes';
|
||||
|
||||
const {handleDataAttributes} = require('./data-attributes');
|
||||
const React = require('react');
|
||||
|
||||
const DEV_MODE_DATA = {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import {getQueryPrice, getUrlHistory} from './utils/helpers';
|
||||
|
||||
function formSubmitHandler({event, form, errorEl, siteUrl, submitHandler}) {
|
||||
export function formSubmitHandler({event, form, errorEl, siteUrl, submitHandler}) {
|
||||
form.removeEventListener('submit', submitHandler);
|
||||
event.preventDefault();
|
||||
if (errorEl) {
|
||||
|
@ -59,7 +59,7 @@ function formSubmitHandler({event, form, errorEl, siteUrl, submitHandler}) {
|
|||
});
|
||||
}
|
||||
|
||||
function planClickHandler({event, el, errorEl, siteUrl, site, member, clickHandler}) {
|
||||
export function planClickHandler({event, el, errorEl, siteUrl, site, member, clickHandler}) {
|
||||
el.removeEventListener('click', clickHandler);
|
||||
event.preventDefault();
|
||||
let plan = el.dataset.membersPlan;
|
||||
|
@ -140,7 +140,7 @@ function planClickHandler({event, el, errorEl, siteUrl, site, member, clickHandl
|
|||
});
|
||||
}
|
||||
|
||||
function handleDataAttributes({siteUrl, site, member}) {
|
||||
export function handleDataAttributes({siteUrl, site, member}) {
|
||||
if (!siteUrl) {
|
||||
return;
|
||||
}
|
||||
|
@ -350,10 +350,4 @@ function handleDataAttributes({siteUrl, site, member}) {
|
|||
}
|
||||
el.addEventListener('click', clickHandler);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
handleDataAttributes,
|
||||
formSubmitHandler,
|
||||
planClickHandler
|
||||
};
|
||||
}
|
|
@ -3,7 +3,7 @@ import {site as FixturesSite, member as FixtureMember} from '../utils/test-fixtu
|
|||
import {fireEvent, appRender, within} from '../utils/test-utils';
|
||||
import setupGhostApi from '../utils/api';
|
||||
import * as helpers from '../utils/helpers';
|
||||
const {formSubmitHandler, planClickHandler} = require('../data-attributes');
|
||||
import {formSubmitHandler, planClickHandler} from '../data-attributes';
|
||||
|
||||
// Mock data
|
||||
function getMockData() {
|
||||
|
|
Loading…
Add table
Reference in a new issue