Repository URL to install this package:
Version:
0.9.5 ▾
|
ui-component-library
/
dist
/
components
/
presets
/
PaymentMethods
/
PaymentEditCard
/
renderProps.js
|
---|
"use strict";
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const Icons_1 = require("atoms/Icons");
const styled_1 = require("./styled");
/**
* render payment card icon
*/
function renderPaymentCardIcon(props) {
return (react_1.default.createElement(styled_1.PaymentCardIcon, null,
react_1.default.createElement(Icons_1.PaymentsCardIcon, { type: 'visa', breed: 'visaWithBg', width: 76 })));
}
exports.renderPaymentCardIcon = renderPaymentCardIcon;
/**
* render payment card title / number
*/
function renderPaymentCardTitle(props) {
return react_1.default.createElement(styled_1.CardTitle, { content: 'Visa card ending in 1234' });
}
exports.renderPaymentCardTitle = renderPaymentCardTitle;
/**
* render payment expiry date
*/
function renderPaymentCardExpiry(props) {
return react_1.default.createElement(styled_1.CardExpiry, { content: 'Expires 06/19' });
}
exports.renderPaymentCardExpiry = renderPaymentCardExpiry;
/**
* render payment method type
*/
function renderPaymentMethod(props) {
return (react_1.default.createElement(styled_1.DefaultPaymentOption, null,
react_1.default.createElement(Icons_1.RadioIcon, null),
react_1.default.createElement(styled_1.MakeDefaultLabel, { content: "Make Payment Method" })));
}
exports.renderPaymentMethod = renderPaymentMethod;
/**
* render payment balance
*/
function renderGiftCardBalance(props) {
return (react_1.default.createElement(styled_1.BalanceElement, null,
react_1.default.createElement(styled_1.GiftBalance, { content: 'Balance' }),
react_1.default.createElement(styled_1.GiftAmount, { content: '$145.52' })));
}
exports.renderGiftCardBalance = renderGiftCardBalance;
/**
* render edit button
*/
function renderPaymentCardToggleButton(props) {
return react_1.default.createElement(styled_1.EditInfoButton, { breedType: "icon-with-text", text: "Edit Information", iconType: "arrow", iconAlignType: "suffix" });
}
exports.renderPaymentCardToggleButton = renderPaymentCardToggleButton;
/**
* render remove button
*/
function renderPaymentRemoveButton(props) {
return react_1.default.createElement(styled_1.RemoveButton, { text: "Remove", iconType: "close", iconAlignType: "prefix" });
}
exports.renderPaymentRemoveButton = renderPaymentRemoveButton;
/**
* Render Payment Edit Header
*/
function renderPaymentCardHeader(props) {
const { renderPaymentCardToggleButton, renderPaymentCardIcon, renderPaymentCardTitle, renderPaymentCardExpiry, renderGiftCardBalance } = props, remainingProps = __rest(props, ["renderPaymentCardToggleButton", "renderPaymentCardIcon", "renderPaymentCardTitle", "renderPaymentCardExpiry", "renderGiftCardBalance"]);
return (react_1.default.createElement(styled_1.PaymentEditHeader, null,
react_1.default.createElement(styled_1.PaymentDetailsWrapper, null,
renderPaymentCardIcon(remainingProps),
react_1.default.createElement(styled_1.PaymentCardDetail, null,
renderPaymentCardTitle(remainingProps),
renderPaymentCardExpiry(remainingProps))),
renderGiftCardBalance(remainingProps),
react_1.default.createElement(styled_1.PaymentEditButton, null, renderPaymentCardToggleButton(remainingProps))));
}
exports.renderPaymentCardHeader = renderPaymentCardHeader;
/**
* Render Payment Edit Footer
*/
function renderPaymentCardFooter(props) {
const { renderPaymentMethod, renderPaymentRemoveButton } = props, remainingProps = __rest(props, ["renderPaymentMethod", "renderPaymentRemoveButton"]);
return (react_1.default.createElement(styled_1.PaymentEditFooter, null,
renderPaymentMethod(remainingProps),
react_1.default.createElement(styled_1.PaymentRemoveButton, null, renderPaymentRemoveButton(remainingProps))));
}
exports.renderPaymentCardFooter = renderPaymentCardFooter;
/**
* Render Wrapper
*/
function renderWrapper(props) {
const { className, children } = props;
return (react_1.default.createElement(styled_1.PaymentEditCardWrapper, { className: className }, children));
}
exports.renderWrapper = renderWrapper;
//# sourceMappingURL=renderProps.js.map