@chainplatform/layout 0.2.8 → 0.3.0

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.
Files changed (3) hide show
  1. package/index.js +2 -0
  2. package/package.json +1 -1
  3. package/src/Exam.js +21 -0
package/index.js CHANGED
@@ -14,6 +14,7 @@ import { getScreenLanding } from "./src/Landing";
14
14
  import sdkStyles, { setSize } from "./src/styles";
15
15
  import sdkColors from "./src/colors";
16
16
  import mobileCheck from "./src/DeviceDetect";
17
+ import { getDoExamLayout } from "./src/Exam";
17
18
 
18
19
  export default sdkStyles;
19
20
  export {
@@ -29,6 +30,7 @@ export {
29
30
  getCourseLearingLayout,
30
31
  getScreenWebinarSize,
31
32
  getScreenLanding,
33
+ getDoExamLayout,
32
34
  sdkColors,
33
35
  setSize,
34
36
  mobileCheck
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainplatform/layout",
3
- "version": "0.2.8",
3
+ "version": "0.3.0",
4
4
  "description": "@chainplatform/layout",
5
5
  "main": "index.js",
6
6
  "devDependencies": {
package/src/Exam.js ADDED
@@ -0,0 +1,21 @@
1
+ import sdkStyles, { setSize } from './styles';
2
+
3
+ export function getDoExamLayout(layoutWidth) {
4
+ let totalItem = 1;
5
+ let basePadding = setSize(15);
6
+ let mainViewWidth = layoutWidth;
7
+ let subViewWitdh = mainViewWidth;
8
+ if (layoutWidth > sdkStyles.base_desktop) {
9
+ totalItem = 2;
10
+ let width = layoutWidth - (2 * (totalItem + 1)) * basePadding;
11
+ mainViewWidth = width * 0.7;
12
+ subViewWitdh = width - mainViewWidth;
13
+ }
14
+
15
+ return {
16
+ totalItem,
17
+ mainViewWidth,
18
+ subViewWitdh,
19
+ basePadding
20
+ };
21
+ }