@@ -4,7 +4,11 @@ import { useI18n } from '@wordpress/react-i18n';
4
4
5
5
const LoadingContentWrapper = styled . div `
6
6
display: flex;
7
- padding-top: 50px;
7
+ padding: 25px 24px 0;
8
+
9
+ @media ( ${ ( props ) => props . theme . breakpoints . tabletUp } ) {
10
+ padding: 25px 0 0;
11
+ }
8
12
9
13
@media ( ${ ( props ) => props . theme . breakpoints . desktopUp } ) {
10
14
align-items: flex-start;
@@ -19,8 +23,6 @@ const LoadingContentInnerWrapper = styled.div`
19
23
width: 100%;
20
24
21
25
@media ( ${ ( props ) => props . theme . breakpoints . tabletUp } ) {
22
- border: 1px solid ${ ( props ) => props . theme . colors . borderColorLight } ;
23
- max-width: 556px;
24
26
margin: 0 auto;
25
27
}
26
28
@@ -30,8 +32,7 @@ const LoadingContentInnerWrapper = styled.div`
30
32
` ;
31
33
32
34
const LoadingCard = styled . div `
33
- padding: 24px;
34
- border-top: 1px solid ${ ( props ) => props . theme . colors . borderColorLight } ;
35
+ padding: 24px 0;
35
36
36
37
:first-of-type {
37
38
border-top: 0;
@@ -52,69 +53,66 @@ const pulse = keyframes`
52
53
}
53
54
` ;
54
55
55
- const LoadingTitle = styled . h1 `
56
+ interface LoadingContainerProps {
57
+ width ?: string ;
58
+ height ?: string ;
59
+ }
60
+
61
+ const LoadingTitle = styled . h1 < LoadingContainerProps > `
56
62
font-size: 14px;
57
63
content: '';
58
64
font-weight: ${ ( props ) => props . theme . weights . normal } ;
59
65
background: ${ ( props ) => props . theme . colors . borderColorLight } ;
60
66
color: ${ ( props ) => props . theme . colors . borderColorLight } ;
61
- width: 40%;
62
- margin: 3px 0 0 35px ;
67
+ width: ${ ( props ) => props . width ?? ' 40%' } ;
68
+ margin: 3px 0 0 40px ;
63
69
padding: 0;
64
70
position: relative;
65
71
animation: ${ pulse } 2s ease-in-out infinite;
66
72
height: 20px;
73
+ width: 125px;
67
74
68
75
.rtl & {
69
- margin: 3px 35px 0 0;
76
+ margin: 3px 40px 0 0;
70
77
}
71
78
72
79
::before {
73
80
content: '';
74
81
display: block;
75
82
position: absolute;
76
- left: -35px ;
83
+ left: -40px ;
77
84
top: -3px;
78
85
width: 27px;
79
86
height: 27px;
80
87
background: ${ ( props ) => props . theme . colors . borderColorLight } ;
81
88
border-radius: 100%;
82
89
83
90
.rtl & {
84
- right: -35px ;
91
+ right: -40px ;
85
92
left: auto;
86
93
}
87
94
}
88
95
` ;
89
- const LoadingCopy = styled . p `
96
+
97
+ const LoadingRow = styled . div `
98
+ display: flex;
99
+ justify-content: space-between;
100
+ ` ;
101
+
102
+ const LoadingCopy = styled . p < LoadingContainerProps > `
90
103
font-size: 14px;
91
- height: 16px;
104
+ height: ${ ( props ) => props . height ?? ' 16px' } ;
92
105
content: '';
93
106
background: ${ ( props ) => props . theme . colors . borderColorLight } ;
94
107
color: ${ ( props ) => props . theme . colors . borderColorLight } ;
95
- margin: 8px 0 0 35px ;
108
+ margin: 8px 0 0 40px ;
96
109
padding: 0;
97
110
animation: ${ pulse } 2s ease-in-out infinite;
111
+ width: ${ ( props ) => props . width ?? 'inherit' } ;
112
+ box-sizing: border-box;
98
113
99
114
.rtl & {
100
- margin: 8px 35px 0 0;
101
- }
102
- ` ;
103
-
104
- const LoadingFooter = styled . div `
105
- background: ${ ( props ) => props . theme . colors . background } ;
106
- content: '';
107
- border-top: 1px solid ${ ( props ) => props . theme . colors . borderColorLight } ;
108
- padding: 24px;
109
-
110
- ::before {
111
- content: '';
112
- display: block;
113
- border: 1px solid ${ ( props ) => props . theme . colors . borderColorLight } ;
114
- border-radius: 3px;
115
- font-size: 14px;
116
- width: 100%;
117
- height: 40px;
115
+ margin: 8px 40px 0 0;
118
116
}
119
117
` ;
120
118
@@ -126,21 +124,32 @@ export default function LoadingContent() {
126
124
< LoadingContentInnerWrapper >
127
125
< LoadingCard >
128
126
< LoadingTitle > { __ ( 'Loading checkout' ) } </ LoadingTitle >
129
- < LoadingCopy />
130
- < LoadingCopy />
127
+ < LoadingCopy width = "225px" />
131
128
</ LoadingCard >
132
129
< LoadingCard >
133
- < LoadingTitle />
134
- < LoadingCopy />
135
- < LoadingCopy />
130
+ < LoadingRow >
131
+ < LoadingCopy width = "150px" />
132
+ < LoadingCopy width = "45px" />
133
+ </ LoadingRow >
134
+ < LoadingCopy height = "35px" width = "225px" />
135
+ < LoadingCopy width = "100px" />
136
+ </ LoadingCard >
137
+ < LoadingCard >
138
+ < LoadingRow >
139
+ < LoadingCopy width = "150px" />
140
+ < LoadingCopy width = "45px" />
141
+ </ LoadingRow >
142
+ < LoadingCopy height = "35px" width = "225px" />
143
+ < LoadingCopy width = "100px" />
136
144
</ LoadingCard >
137
145
< LoadingCard >
138
146
< LoadingTitle />
147
+ < LoadingCopy width = "300px" />
139
148
</ LoadingCard >
140
149
< LoadingCard >
141
150
< LoadingTitle />
151
+ < LoadingCopy width = "300px" />
142
152
</ LoadingCard >
143
- < LoadingFooter />
144
153
</ LoadingContentInnerWrapper >
145
154
</ LoadingContentWrapper >
146
155
) ;
0 commit comments