Skip to content

Fix terms and conditions checkbox click surface #771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
"fee": "Withdrawal fee",
"feeinfo": "The indicated price is final, all fees are included.",
"byclickTC": "*By clicking <b>{{buttonName}}</b> you agree to our Terms and Conditions (<a href='/en/terms-and-conditions'>T&C</a>)",
"iAgreedTC": "I have read and agree to the <a href='/en/terms-and-conditions' target='_blank'>Terms and Conditions</a> and <a href='/en/privacy' target='_blank'>Privacy Policy</a>.",
"iAgreedTC": "I have read and agree to the <a id='terms-and-conditions' href='/en/terms-and-conditions' target='_blank'>Terms and Conditions</a> and <a id='privacy' href='/en/privacy' target='_blank'>Privacy Policy</a>.",
"iAcknowledgeKYC": "I acknowledge that I have to upload my Identity Document after the payment.",
"tooltipTC": "By clicking 'PAY NOW' You agree to our T&C and Privacy Policy.",
"refund": "Your order has been refunded. Please contact support in the live chat or at",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/ru/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"fee": "Комиссия за вывод средств",
"feeinfo": " Указанная цена является окончательной, все сборы включены.",
"byclickTC": "*Переходя по ссылке <b>{{buttonName}}</b> вы соглашаетесь с нашими Условиями использования (<a href='/terms-and-conditions'>T&C</a>)",
"iAgreedTC": "Я прочитал и согласен<a href='/terms-and-conditions' target='_blank'> с Условиями использования</a> и <a href='/privacy' target='_blank'> Политикой конфиденциальности </a>.",
"iAgreedTC": "Я прочитал и согласен<a id='terms-and-conditions' href='/terms-and-conditions' target='_blank'> с Условиями использования</a> и <a id='privacy' href='/privacy' target='_blank'> Политикой конфиденциальности </a>.",
"iAcknowledgeKYC": "Я осознаю, что после оплаты я должен загрузить документ, удостоверяющий личность.",
"tooltipTC": "Нажимая «ОПЛАТИТЬ СЕЙЧАС», Вы соглашаетесь с нашими условиями и положениями, а также политикой конфиденциальности.",
"refund": "Ваш заказ был восстановлен. Пожалуйста, обратитесь в службу поддержки в чате или в",
Expand Down
1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import './css/index.scss';

window.$ = window.jQuery = require('jquery');
require('./js/bootstrap.min.js');
require('./js/utils.js');

// const createStoreWithMiddleware = applyMiddleware(thunk)(createStore);
// const store = createStoreWithMiddleware(reducers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class Checkbox extends Component {
<div>
<I18n ns="translations">
{t => (
<label>
{/* eslint max-len: ["error", { "code": 200 }] */}
<div style={{marginBottom: "5px"}}>
<input
type="checkbox"
name={props.name}
Expand All @@ -36,8 +35,8 @@ class Checkbox extends Component {
}}
defaultChecked={true}
/>
<strong style={{ paddingLeft: '7px', cursor: 'pointer' }} dangerouslySetInnerHTML={{ __html: t(props.order) }} />
</label>
<strong style={{ paddingLeft: '7px' }} dangerouslySetInnerHTML={{ __html: t(props.order) }} />
</div>
)}
</I18n>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ class OrderInitial extends Component {

if (localStorage.termsAgreed) this.setState({ showPaymentIFrame: true });

window.addEventListener('message', this.iFrameMessage);
}
window.addEventListener('message', this.iFrameMessage);

//double click to open link on mobile
enableDoubleClickOnMobile();
}

UNSAFE_componentWillUpdate() {
const safechargeStatus = getUrlPram('ppp_status');
Expand Down Expand Up @@ -244,4 +247,28 @@ const getUrlPram = parameter => {
return value;
};

const enableDoubleClickOnMobile = () => {
if(window.mobileCheck()) {
const termsAndConditionsLink = document.getElementById("terms-and-conditions");
const termsAndConditionsHref = termsAndConditionsLink.href;
termsAndConditionsLink.removeAttribute("href");
termsAndConditionsLink.removeAttribute("target");
termsAndConditionsLink.setAttribute("data-toggle", "tooltip");
termsAndConditionsLink.setAttribute("title", "Double click to open");
$("#terms-and-conditions").dblclick(() => {
window.open(termsAndConditionsHref, '_blank');
});
const privacyLink = document.getElementById("privacy");
const privacyHref = privacyLink.href;
privacyLink.removeAttribute("href");
privacyLink.removeAttribute("target");
privacyLink.setAttribute("data-toggle", "tooltip");
privacyLink.setAttribute("title", "Double click to open");
$("#privacy").dblclick(() => {
window.open(privacyHref, '_blank');
});
$('[data-toggle="tooltip"]').tooltip();
}
}

export default OrderInitial;
6 changes: 6 additions & 0 deletions src/js/utils.js

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

2 changes: 1 addition & 1 deletion src/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
"fee": "Withdrawal fee",
"feeinfo": "The indicated price is final, all fees are included.",
"byclickTC": "*By clicking <b>{{buttonName}}</b> you agree to our Terms and Conditions (<a href='/terms-and-conditions'>T&C</a>)",
"iAgreedTC": "I have read and agree to the <a href='/terms-and-conditions' target='_blank'>Terms and Conditions</a> and <a href='/privacy' target='_blank'>Privacy Policy</a>.",
"iAgreedTC": "I have read and agree to the <a id='terms-and-conditions' href='/en/terms-and-conditions' target='_blank'>Terms and Conditions</a> and <a id='privacy' href='/privacy' target='_blank'>Privacy Policy</a>.",
"iAcknowledgeKYC": "I acknowledge that I have to upload my Identity Document after the payment.",
"tooltipTC": "You must agree with T&C and Privacy Policy.",
"refund": "Your order has been refunded. Please contact support in the live chat or at",
Expand Down