UNPKG

react-native-unit-components

Version:

Unit React Native components

42 lines 1.5 kB
import { CheckMessage } from '../../messages/webMessages/checkMessage'; import { LISTENERS } from '../../scripts/html/bodyScript'; export const getCheckDepositParams = props => { const feeParam = props.fee ? `fee="${props.fee}"` : ''; return ` account-id="${props.accountId}" ${feeParam} initial-stage-back-button="${props.initialStageBackButton ?? false}" final-stage-done-button="${props.finalStageDoneButton ?? false}" `; }; const CHECK_DEPOSIT_LISTENERS = { paymentCreated: ` window.addEventListener("${CheckMessage.CHECK_DEPOSIT_CREATED}", (e) => { const response = e.detail response.then((data) => { postMessageToSDK({ type: "${CheckMessage.CHECK_DEPOSIT_CREATED}", details: data.data }) }).catch((e) => { console.log(e) }) }); `, restartRequest: ` window.addEventListener("${CheckMessage.CHECK_DEPOSIT_RESTART_REQUEST}", (e) => { const response = e.detail response.then((data) => { postMessageToSDK({ type: "${CheckMessage.CHECK_DEPOSIT_RESTART_REQUEST}", details: data.data }) }).catch((e) => { console.log(e) }) }); ` }; export const getCheckDepositScript = () => { return ` ${CHECK_DEPOSIT_LISTENERS.paymentCreated} ${LISTENERS.unitPaymentInitialStageBackButtonClicked} ${LISTENERS.unitPaymentFinalStageDoneButtonClicked} ${CHECK_DEPOSIT_LISTENERS.restartRequest} `; }; //# sourceMappingURL=UNCheckDepositComponent.utils.js.map