@sikka/hawa 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/hawa-publish-push.yml +45 -0
- package/.github/workflows/hawa-publish.yml +2 -0
- package/es/index.es.js +1 -0
- package/lib/index.js +1 -0
- package/package.json +18 -8
- package/rollup.config.js +2 -2
- package/src/Assets/images/card-background/1.jpeg +0 -0
- package/src/Assets/images/card-background/10.jpeg +0 -0
- package/src/Assets/images/card-background/11.jpeg +0 -0
- package/src/Assets/images/card-background/12.jpeg +0 -0
- package/src/Assets/images/card-background/13.jpeg +0 -0
- package/src/Assets/images/card-background/14.jpeg +0 -0
- package/src/Assets/images/card-background/15.jpeg +0 -0
- package/src/Assets/images/card-background/16.jpeg +0 -0
- package/src/Assets/images/card-background/17.jpeg +0 -0
- package/src/Assets/images/card-background/18.jpeg +0 -0
- package/src/Assets/images/card-background/19.jpeg +0 -0
- package/src/Assets/images/card-background/2.jpeg +0 -0
- package/src/Assets/images/card-background/20.jpeg +0 -0
- package/src/Assets/images/card-background/21.jpeg +0 -0
- package/src/Assets/images/card-background/22.jpeg +0 -0
- package/src/Assets/images/card-background/23.jpeg +0 -0
- package/src/Assets/images/card-background/24.jpeg +0 -0
- package/src/Assets/images/card-background/25.jpeg +0 -0
- package/src/Assets/images/card-background/3.jpeg +0 -0
- package/src/Assets/images/card-background/4.jpeg +0 -0
- package/src/Assets/images/card-background/5.jpeg +0 -0
- package/src/Assets/images/card-background/6.jpeg +0 -0
- package/src/Assets/images/card-background/7.jpeg +0 -0
- package/src/Assets/images/card-background/8.jpeg +0 -0
- package/src/Assets/images/card-background/9.jpeg +0 -0
- package/src/Assets/images/card-type/amex.png +0 -0
- package/src/Assets/images/card-type/diners.png +0 -0
- package/src/Assets/images/card-type/discover.png +0 -0
- package/src/Assets/images/card-type/mastercard.png +0 -0
- package/src/Assets/images/card-type/troy.png +0 -0
- package/src/Assets/images/card-type/unionpay.png +0 -0
- package/src/Assets/images/card-type/visa.png +0 -0
- package/src/blocks/Payment/Form/CForm.js +326 -0
- package/src/blocks/Payment/Form/Card.js +242 -0
- package/src/blocks/Payment/Gateway/GooglePay.js +251 -0
- package/src/blocks/Payment/Gateway/Payfort.js +90 -0
- package/src/blocks/Payment/Gateway/Paypal.js +138 -0
- package/src/blocks/Payment/Gateway/Wallet.js +149 -0
- package/src/blocks/Payment/PaymentMethod.js +132 -0
- package/src/blocks/index.js +13 -0
- package/src/index.js +2 -1
- package/src/styles.scss +679 -0
- package/tools/build-styles.js +17 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import useTranslation from "next-translate/useTranslation";
|
|
2
|
+
import Button from "@material-ui/core/Button";
|
|
3
|
+
import Chip from "@material-ui/core/Chip";
|
|
4
|
+
|
|
5
|
+
const PaymentMethod = (props) => {
|
|
6
|
+
const { t } = useTranslation("common");
|
|
7
|
+
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
{props.wallet ? (
|
|
11
|
+
<PaymentMethodButton
|
|
12
|
+
imageURL={`/wallet.png`}
|
|
13
|
+
methodCode="wallet"
|
|
14
|
+
methodLabel={t("current-wallet")}
|
|
15
|
+
handlePaymentMethod={props.handlePaymentMethod}
|
|
16
|
+
/>
|
|
17
|
+
) : null}
|
|
18
|
+
{props.creditcard ? (
|
|
19
|
+
<PaymentMethodButton
|
|
20
|
+
imageURL={`/visa-master.png`}
|
|
21
|
+
methodCode="creditcard"
|
|
22
|
+
methodLabel={t("credit-card")}
|
|
23
|
+
handlePaymentMethod={props.handlePaymentMethod}
|
|
24
|
+
/>
|
|
25
|
+
) : null}
|
|
26
|
+
{props.mada ? (
|
|
27
|
+
<PaymentMethodButton
|
|
28
|
+
imageURL={`/mada.png`}
|
|
29
|
+
methodCode="mada"
|
|
30
|
+
methodLabel={t("mada")}
|
|
31
|
+
handlePaymentMethod={props.handlePaymentMethod}
|
|
32
|
+
/>
|
|
33
|
+
) : null}
|
|
34
|
+
{props.stcpay ? (
|
|
35
|
+
<PaymentMethodButton
|
|
36
|
+
methodCode="stcpay"
|
|
37
|
+
methodLabel={"STC Pay"}
|
|
38
|
+
chip={t("soon")}
|
|
39
|
+
handlePaymentMethod={props.handlePaymentMethod}
|
|
40
|
+
/>
|
|
41
|
+
) : null}
|
|
42
|
+
{props.paypal ? (
|
|
43
|
+
<PaymentMethodButton
|
|
44
|
+
methodCode="paypal"
|
|
45
|
+
methodLabel={t("paypal")}
|
|
46
|
+
handlePaymentMethod={props.handlePaymentMethod}
|
|
47
|
+
/>
|
|
48
|
+
) : null}
|
|
49
|
+
{isSafari && applepay && (
|
|
50
|
+
<PaymentMethodButton
|
|
51
|
+
methodCode="applepay"
|
|
52
|
+
methodLabel={t("applepay")}
|
|
53
|
+
handlePaymentMethod={props.handlePaymentMethod}
|
|
54
|
+
/>
|
|
55
|
+
)}
|
|
56
|
+
{props.googlepay ? (
|
|
57
|
+
<PaymentMethodButton
|
|
58
|
+
methodCode="googlepay"
|
|
59
|
+
chip={t("soon")}
|
|
60
|
+
methodLabel={t("googlepay")}
|
|
61
|
+
handlePaymentMethod={props.handlePaymentMethod}
|
|
62
|
+
/>
|
|
63
|
+
) : null}
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const PaymentMethodButton = (props) => {
|
|
69
|
+
return (
|
|
70
|
+
<Button
|
|
71
|
+
disabled={props?.chip ? true : false}
|
|
72
|
+
fullWidth
|
|
73
|
+
variant="contained"
|
|
74
|
+
color="secondary"
|
|
75
|
+
style={{
|
|
76
|
+
backgroundColor: "white",
|
|
77
|
+
opacity: props.chip ? 0.7 : 1,
|
|
78
|
+
padding: 20,
|
|
79
|
+
width: "90%",
|
|
80
|
+
margin: 10,
|
|
81
|
+
borderRadius: "var(--borderR)"
|
|
82
|
+
}}
|
|
83
|
+
onClick={(e) => props.handlePaymentMethod(e, props.methodCode)}
|
|
84
|
+
>
|
|
85
|
+
{props.imageURL ? (
|
|
86
|
+
<div
|
|
87
|
+
style={{
|
|
88
|
+
// backgroundColor: "red",
|
|
89
|
+
width: "50%",
|
|
90
|
+
textAlign: "right",
|
|
91
|
+
paddingRight: 20
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<img
|
|
95
|
+
src={props.imageURL}
|
|
96
|
+
// src={`https://qawaim-images.s3-ap-southeast-1.amazonaws.com/payments/visa.png`}
|
|
97
|
+
// alt=""
|
|
98
|
+
// srcset=""
|
|
99
|
+
// height={"100%"}
|
|
100
|
+
// width={"30%"}
|
|
101
|
+
style={{
|
|
102
|
+
// height: "100%",
|
|
103
|
+
// aspectRatio: "6/4",
|
|
104
|
+
maxWidth: 70,
|
|
105
|
+
maxHeight: 70,
|
|
106
|
+
height: "auto"
|
|
107
|
+
}}
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
) : null}
|
|
111
|
+
<div
|
|
112
|
+
style={{
|
|
113
|
+
// backgroundColor: "blue",
|
|
114
|
+
width: "50%",
|
|
115
|
+
textAlign: props.imageURL ? "left" : "center"
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
{props.methodLabel}
|
|
119
|
+
{props.chip ? (
|
|
120
|
+
<Chip
|
|
121
|
+
size="small"
|
|
122
|
+
color="primary"
|
|
123
|
+
label={props.chip}
|
|
124
|
+
style={{ marginRight: 10, marginLeft: 10 }}
|
|
125
|
+
/>
|
|
126
|
+
) : null}
|
|
127
|
+
</div>
|
|
128
|
+
</Button>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export default PaymentMethod;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _GooglePay = require('./Payment/Gateway/GooglePay');
|
|
4
|
+
var _Payfort = require('./Payment/Gateway/Payfort');
|
|
5
|
+
var _Paypal = require('./Payment/Gateway/Paypal');
|
|
6
|
+
var _Wallet = require('./Payment/Gateway/Wallet');
|
|
7
|
+
var _PaymentMethod = require('./Payment/PaymentMethod');
|
|
8
|
+
|
|
9
|
+
exports.GooglePay = _GooglePay.default;
|
|
10
|
+
exports.Payfort = _Payfort.default;
|
|
11
|
+
exports.Paypal = _Paypal.default;
|
|
12
|
+
exports.Wallet = _Wallet.default;
|
|
13
|
+
exports.PaymentMethod = _PaymentMethod.default;
|
package/src/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./blocks";
|
|
2
|
+
//export * from "./components/Hawa";
|