@chainplatform/layout 0.2.3 → 0.2.5
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 +1 -1
- package/package.json +1 -1
- package/src/Cart.js +16 -0
- package/src/Landing.js +1 -1
- package/src/Layout.js +0 -26
package/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getLayoutAdmin, getScreenSizeAdmin } from "./src/LayoutAdmin";
|
|
2
2
|
import {
|
|
3
3
|
getScreenSize,
|
|
4
|
-
getCartLayout,
|
|
5
4
|
getTransactionLayout,
|
|
6
5
|
getCourseLayout,
|
|
7
6
|
getUserCourseLayout,
|
|
@@ -9,6 +8,7 @@ import {
|
|
|
9
8
|
getCourseLearingLayout,
|
|
10
9
|
getScreenWebinarSize
|
|
11
10
|
} from "./src/Layout";
|
|
11
|
+
import { getCartLayout } from "./src/Cart";
|
|
12
12
|
import { getScreenLanding } from "./src/Landing";
|
|
13
13
|
import sdkStyles, { setSize } from "./src/styles";
|
|
14
14
|
import sdkColors from "./src/colors";
|
package/package.json
CHANGED
package/src/Cart.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import sdkStyles, { setSize } from './styles';
|
|
2
|
+
|
|
3
|
+
export function getCartLayout(layoutWidth, isDesktop = true) {
|
|
4
|
+
const basePadding = setSize(15);
|
|
5
|
+
let totalItem = 1;
|
|
6
|
+
if (layoutWidth > sdkStyles.base_desktop) {
|
|
7
|
+
totalItem = 2;
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
itemWidth = layoutWidth - (2 * (totalItem + 1) * basePadding);
|
|
11
|
+
|
|
12
|
+
let view = {};
|
|
13
|
+
view.basePadding = basePadding;
|
|
14
|
+
view.itemWidth = itemWidth;
|
|
15
|
+
return view;
|
|
16
|
+
}
|
package/src/Landing.js
CHANGED
package/src/Layout.js
CHANGED
|
@@ -163,32 +163,6 @@ export function getScreenSize(layoutWidth, isDesktop, side_bar_width) {
|
|
|
163
163
|
return view;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
export function getCartLayout(layoutWidth, isDesktop, side_bar_width) {
|
|
167
|
-
let viewPadding = 0;
|
|
168
|
-
let viewSplit = sdkStyles.w100pc;
|
|
169
|
-
let borderRadius = 0;
|
|
170
|
-
let marginBottom = setSize(1);
|
|
171
|
-
let sideBarWidth = 0;
|
|
172
|
-
if (isDesktop && layoutWidth > sdkStyles.base_desktop) {
|
|
173
|
-
sideBarWidth = side_bar_width;
|
|
174
|
-
borderRadius = setSize(4);
|
|
175
|
-
marginBottom = setSize(10);
|
|
176
|
-
}
|
|
177
|
-
if (layoutWidth >= sdkStyles.wide_split_desktop) {
|
|
178
|
-
viewSplit = sdkStyles.w50pc;
|
|
179
|
-
}
|
|
180
|
-
if (layoutWidth >= 767) {
|
|
181
|
-
viewPadding = setSize(15);
|
|
182
|
-
}
|
|
183
|
-
let view = {};
|
|
184
|
-
view.viewPadding = viewPadding;
|
|
185
|
-
view.viewSplit = viewSplit;
|
|
186
|
-
view.sideBarWidth = sideBarWidth;
|
|
187
|
-
view.itemBorderRadius = borderRadius;
|
|
188
|
-
view.itemMarginBottom = marginBottom;
|
|
189
|
-
return view;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
166
|
export function getTransactionLayout(layoutWidth, isDesktop) {
|
|
193
167
|
let viewSplit = sdkStyles.w100pc;
|
|
194
168
|
if (isDesktop && layoutWidth >= 767) {
|