@chainplatform/layout 0.3.1 → 0.3.2

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