Skip to content

Commit 8280f6d

Browse files
author
Artem
committed
Add the apple pay button
1 parent 2230f17 commit 8280f6d

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

demo/peacock/src/pages/checkout/checkout.css

+18-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
}
1414
}
1515

16+
.apple-pay {
17+
background-color: black;
18+
background-image: -webkit-named-image(apple-pay-logo-white);
19+
background-size: cover;
20+
background-origin: content-box;
21+
background-repeat: no-repeat;
22+
width: 100%;
23+
height: 44px;
24+
border-radius: 0;
25+
margin-top: 20px;
26+
padding: 10px 0;
27+
}
28+
1629
.wrapper {
1730
display: flex;
1831
height: 100vh;
@@ -143,14 +156,18 @@
143156

144157
.place-order-block {
145158
margin: 20px 0;
146-
height: 58px;
147159
}
148160

149161
.place-order-button {
150162
border-radius: 4px;
151163
height: 58px;
152164
}
153165

166+
.apple-pay {
167+
border-radius: 4px;
168+
height: 58px;
169+
}
170+
154171
.order-summary {
155172
margin-top: 40px;
156173
}

demo/peacock/src/pages/checkout/checkout.jsx

+13-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ import type { CheckoutActions } from './types';
3131
import type { AsyncStatus } from 'types/async-actions';
3232

3333
// actions
34-
import * as actions from 'modules/checkout';
34+
import * as actions from 'modules/checkout';
35+
import { checkApplePay } from 'modules/checkout';
3536
import { EditStages } from 'modules/checkout';
3637
import { fetch as fetchCart, hideCart } from 'modules/cart';
3738
import { fetchUser } from 'modules/auth';
@@ -181,6 +182,16 @@ class Checkout extends Component {
181182
return emailIsSet(user);
182183
}
183184

185+
get applePayButton() {
186+
if (!checkApplePay()) return null;
187+
188+
return (
189+
<Button
190+
styleName="apple-pay"
191+
/>
192+
);
193+
}
194+
184195
get orderTotals() {
185196
const { cart } = this.props;
186197
const { billingDone, shippingDone, deliveryDone } = this.state;
@@ -204,6 +215,7 @@ class Checkout extends Component {
204215
>
205216
Place order
206217
</Button>
218+
{this.applePayButton}
207219
</div>
208220
</div>
209221
);

0 commit comments

Comments
 (0)