@chainplatform/layout 0.2.9 → 0.3.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/Exam.js +7 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainplatform/layout",
3
- "version": "0.2.9",
3
+ "version": "0.3.1",
4
4
  "description": "@chainplatform/layout",
5
5
  "main": "index.js",
6
6
  "devDependencies": {
package/src/Exam.js CHANGED
@@ -1,18 +1,21 @@
1
- import sdkStyles from './styles';
1
+ import sdkStyles, { setSize } from './styles';
2
2
 
3
3
  export function getDoExamLayout(layoutWidth) {
4
4
  let totalItem = 1;
5
+ let basePadding = setSize(15);
5
6
  let mainViewWidth = layoutWidth;
6
7
  let subViewWitdh = mainViewWidth;
7
8
  if (layoutWidth > sdkStyles.base_desktop) {
8
9
  totalItem = 2;
9
- mainViewWidth = layoutWidth * 0.7;
10
- subViewWitdh = layoutWidth - mainViewWidth;
10
+ let width = layoutWidth - ((totalItem + 1)) * basePadding;
11
+ mainViewWidth = width * 0.7;
12
+ subViewWitdh = width - mainViewWidth;
11
13
  }
12
14
 
13
15
  return {
14
16
  totalItem,
15
17
  mainViewWidth,
16
- subViewWitdh
18
+ subViewWitdh,
19
+ basePadding
17
20
  };
18
21
  }