4
4
totalPrice: totalPrice$ | async,
5
5
cartEmpty: cartEmpty$ | async
6
6
} as state "
7
- class ="container "
7
+ class ="row "
8
8
>
9
- < div class ="row ">
10
- < div class ="col mx-auto py-3 py-md-5 ">
11
- < mat-card >
12
- < h1 class ="text-center pt-4 " mat-card-title > Checkout</ h1 >
9
+ < div class ="col mx-auto ">
10
+ < mat-card >
11
+ < h1 class ="text-center pt-4 " mat-card-title > Checkout</ h1 >
13
12
14
- < mat-card-content >
15
- < mat-vertical-stepper #stepper [linear] ="true ">
16
- <!-- Review your cart STEP -->
17
- < mat-step label ="Review your cart " [completed] ="state.cartEmpty ">
18
- < ng-container *ngIf ="state.cartEmpty; else emptyCartTemplate ">
19
- < app-order-summary
20
- *ngIf ="state.products; else loaderTemplate "
21
- (add) ="add($event) "
22
- (remove) ="remove($event) "
23
- [products] ="state.products "
24
- [totalPrice] ="state.totalPrice! "
25
- [showControls] ="true "
26
- > </ app-order-summary >
27
-
28
- < ng-template #loaderTemplate >
29
- < div class ="py-5 ">
30
- < mat-spinner [diameter] ="40 " class ="mx-auto "> </ mat-spinner >
31
- </ div >
32
- </ ng-template >
13
+ < mat-card-content >
14
+ < mat-vertical-stepper #stepper [linear] ="true ">
15
+ <!-- Review your cart STEP -->
16
+ < mat-step label ="Review your cart " [completed] ="state.cartEmpty ">
17
+ < ng-container *ngIf ="state.cartEmpty; else emptyCartTemplate ">
18
+ < app-order-summary
19
+ *ngIf ="state.products; else loaderTemplate "
20
+ (add) ="add($event) "
21
+ (remove) ="remove($event) "
22
+ [products] ="state.products "
23
+ [totalPrice] ="state.totalPrice! "
24
+ [showControls] ="true "
25
+ > </ app-order-summary >
33
26
34
- < div class ="text-right ">
35
- < button
36
- color ="primary "
37
- class ="text-uppercase "
38
- mat-flat-button
39
- matStepperNext
40
- >
41
- next
42
- </ button >
27
+ < ng-template #loaderTemplate >
28
+ < div class ="py-5 ">
29
+ < mat-spinner [diameter] ="40 " class ="mx-auto "> </ mat-spinner >
43
30
</ div >
44
- </ ng-container >
45
- </ mat-step >
46
-
47
- <!-- Shipping address STEP -->
48
- < mat-step label ="Shipping address " [stepControl] ="shippingInfo ">
49
- < h2 > Shipping address</ h2 >
50
-
51
- < app-cart-shipping-form
52
- (nextStep) ="stepper.next() "
53
- [shippingInfo] ="shippingInfo "
54
- > </ app-cart-shipping-form >
31
+ </ ng-template >
55
32
56
33
< div class ="text-right ">
57
- < button class ="text-uppercase " mat-button matStepperPrevious >
58
- back
59
- </ button >
60
34
< button
61
35
color ="primary "
62
36
class ="text-uppercase "
@@ -66,42 +40,66 @@ <h2>Shipping address</h2>
66
40
next
67
41
</ button >
68
42
</ div >
69
- </ mat-step >
43
+ </ ng-container >
44
+ </ mat-step >
70
45
71
- <!-- Review your order STEP -->
72
- < mat-step label ="Review your order ">
73
- < app-order-summary
74
- *ngIf ="state.products "
75
- [products] ="state.products "
76
- [totalPrice] ="state.totalPrice! "
77
- [showControls] ="false "
78
- > </ app-order-summary >
46
+ <!-- Shipping address STEP -->
47
+ < mat-step label ="Shipping address " [stepControl] ="shippingInfo ">
48
+ < h2 > Shipping address</ h2 >
79
49
80
- < div class ="row ">
81
- < div class ="col col-md-6 ">
82
- < h2 > Shipping</ h2 >
83
- < p > {{ fullName }}</ p >
84
- < p > {{ address }}</ p >
85
- </ div >
86
- < div class ="col col-md-6 ">
87
- < h2 > Comment</ h2 >
88
- < p > {{ comment }}</ p >
89
- </ div >
90
- </ div >
50
+ < app-cart-shipping-form
51
+ (nextStep) ="stepper.next() "
52
+ [shippingInfo] ="shippingInfo "
53
+ > </ app-cart-shipping-form >
91
54
92
- < div class ="text-right ">
93
- < button class ="text-uppercase " mat-button matStepperPrevious >
94
- back
95
- </ button >
96
- < button color ="primary " class ="text-uppercase " mat-flat-button >
97
- place order
98
- </ button >
55
+ < div class ="text-right ">
56
+ < button class ="text-uppercase " mat-button matStepperPrevious >
57
+ back
58
+ </ button >
59
+ < button
60
+ color ="primary "
61
+ class ="text-uppercase "
62
+ mat-flat-button
63
+ matStepperNext
64
+ >
65
+ next
66
+ </ button >
67
+ </ div >
68
+ </ mat-step >
69
+
70
+ <!-- Review your order STEP -->
71
+ < mat-step label ="Review your order ">
72
+ < app-order-summary
73
+ *ngIf ="state.products "
74
+ [products] ="state.products "
75
+ [totalPrice] ="state.totalPrice! "
76
+ [showControls] ="false "
77
+ > </ app-order-summary >
78
+
79
+ < div class ="row ">
80
+ < div class ="col col-md-6 ">
81
+ < h2 > Shipping</ h2 >
82
+ < p > {{ fullName }}</ p >
83
+ < p > {{ address }}</ p >
99
84
</ div >
100
- </ mat-step >
101
- </ mat-vertical-stepper >
102
- </ mat-card-content >
103
- </ mat-card >
104
- </ div >
85
+ < div class ="col col-md-6 ">
86
+ < h2 > Comment</ h2 >
87
+ < p > {{ comment }}</ p >
88
+ </ div >
89
+ </ div >
90
+
91
+ < div class ="text-right ">
92
+ < button class ="text-uppercase " mat-button matStepperPrevious >
93
+ back
94
+ </ button >
95
+ < button color ="primary " class ="text-uppercase " mat-flat-button >
96
+ place order
97
+ </ button >
98
+ </ div >
99
+ </ mat-step >
100
+ </ mat-vertical-stepper >
101
+ </ mat-card-content >
102
+ </ mat-card >
105
103
</ div >
106
104
</ div >
107
105
0 commit comments