@chainplatform/layout 0.2.7 → 0.2.9
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/index.js +4 -0
- package/package.json +1 -1
- package/src/Exam.js +18 -0
- package/src/Layout.js +26 -0
package/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
getUserCourseLayout,
|
|
7
7
|
getUserOrderLayout,
|
|
8
8
|
getCourseLearingLayout,
|
|
9
|
+
getCartConfirmLayout,
|
|
9
10
|
getScreenWebinarSize
|
|
10
11
|
} from "./src/Layout";
|
|
11
12
|
import { getCartLayout } from "./src/Cart";
|
|
@@ -13,6 +14,7 @@ import { getScreenLanding } from "./src/Landing";
|
|
|
13
14
|
import sdkStyles, { setSize } from "./src/styles";
|
|
14
15
|
import sdkColors from "./src/colors";
|
|
15
16
|
import mobileCheck from "./src/DeviceDetect";
|
|
17
|
+
import { getDoExamLayout } from "./src/Exam";
|
|
16
18
|
|
|
17
19
|
export default sdkStyles;
|
|
18
20
|
export {
|
|
@@ -20,6 +22,7 @@ export {
|
|
|
20
22
|
getScreenSizeAdmin,
|
|
21
23
|
getScreenSize,
|
|
22
24
|
getCartLayout,
|
|
25
|
+
getCartConfirmLayout,
|
|
23
26
|
getTransactionLayout,
|
|
24
27
|
getCourseLayout,
|
|
25
28
|
getUserCourseLayout,
|
|
@@ -27,6 +30,7 @@ export {
|
|
|
27
30
|
getCourseLearingLayout,
|
|
28
31
|
getScreenWebinarSize,
|
|
29
32
|
getScreenLanding,
|
|
33
|
+
getDoExamLayout,
|
|
30
34
|
sdkColors,
|
|
31
35
|
setSize,
|
|
32
36
|
mobileCheck
|
package/package.json
CHANGED
package/src/Exam.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import sdkStyles from './styles';
|
|
2
|
+
|
|
3
|
+
export function getDoExamLayout(layoutWidth) {
|
|
4
|
+
let totalItem = 1;
|
|
5
|
+
let mainViewWidth = layoutWidth;
|
|
6
|
+
let subViewWitdh = mainViewWidth;
|
|
7
|
+
if (layoutWidth > sdkStyles.base_desktop) {
|
|
8
|
+
totalItem = 2;
|
|
9
|
+
mainViewWidth = layoutWidth * 0.7;
|
|
10
|
+
subViewWitdh = layoutWidth - mainViewWidth;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
totalItem,
|
|
15
|
+
mainViewWidth,
|
|
16
|
+
subViewWitdh
|
|
17
|
+
};
|
|
18
|
+
}
|
package/src/Layout.js
CHANGED
|
@@ -173,6 +173,32 @@ export function getTransactionLayout(layoutWidth, isDesktop) {
|
|
|
173
173
|
return view;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
export function getCartConfirmLayout(layoutWidth, isDesktop, side_bar_width) {
|
|
177
|
+
let viewPadding = 0;
|
|
178
|
+
let viewSplit = sdkStyles.w100pc;
|
|
179
|
+
let borderRadius = 0;
|
|
180
|
+
let marginBottom = setSize(1);
|
|
181
|
+
let sideBarWidth = 0;
|
|
182
|
+
if (isDesktop && layoutWidth > sdkStyles.base_desktop) {
|
|
183
|
+
sideBarWidth = side_bar_width;
|
|
184
|
+
borderRadius = setSize(4);
|
|
185
|
+
marginBottom = setSize(10);
|
|
186
|
+
}
|
|
187
|
+
if (layoutWidth >= sdkStyles.wide_split_desktop) {
|
|
188
|
+
viewSplit = sdkStyles.w50pc;
|
|
189
|
+
}
|
|
190
|
+
if (layoutWidth >= 767) {
|
|
191
|
+
viewPadding = setSize(15);
|
|
192
|
+
}
|
|
193
|
+
let view = {};
|
|
194
|
+
view.viewPadding = viewPadding;
|
|
195
|
+
view.viewSplit = viewSplit;
|
|
196
|
+
view.sideBarWidth = sideBarWidth;
|
|
197
|
+
view.itemBorderRadius = borderRadius;
|
|
198
|
+
view.itemMarginBottom = marginBottom;
|
|
199
|
+
return view;
|
|
200
|
+
}
|
|
201
|
+
|
|
176
202
|
export function getCourseLayout(layoutWidth, isDesktop) {
|
|
177
203
|
let viewSplit = sdkStyles.w100pc;
|
|
178
204
|
let viewPadding = 0;
|