Skip to content

Commit 976d02c

Browse files
author
Wesley
committed
update styles bottomsheet & popupmenu
1 parent 7f46c65 commit 976d02c

File tree

5 files changed

+56
-57
lines changed

5 files changed

+56
-57
lines changed

styles/native/js/core/widgets/bottomsheet.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { background, border } from "../variables";
1+
import { background, border, brand, contrast, font } from "../variables";
22
//
33
// DISCLAIMER:
44
// Do not change this file because it is core styling.
@@ -17,7 +17,7 @@ export const com_mendix_widget_native_bottomsheet_BottomSheet = {
1717
borderRadius: border.radius,
1818
elevation: 20,
1919
shadowColor: "#000",
20-
shadowOpacity: 0.1,
20+
shadowOpacity: 0.05,
2121
shadowRadius: 6,
2222
shadowOffset: {
2323
width: 0,
@@ -31,28 +31,37 @@ export const com_mendix_widget_native_bottomsheet_BottomSheet = {
3131
backgroundColor: background.primary,
3232
},
3333
modal: {
34-
// All ViewStyle properties are allowed
34+
// All ViewStyle properties are allowed
35+
margin: 0,
36+
justifyContent: "flex-end",
3537
},
3638
modalItems: {
39+
container: {
40+
// rippleColor & All TextStyle properties are allowed
41+
height: 50,
42+
marginTop: 0,
43+
rippleColor: contrast.lower,
44+
backgroundColor: background.primary,
45+
},
3746
defaultStyle: {
3847
// All TextStyle properties are allowed
3948
fontSize: 16,
40-
color: "black",
49+
color: font.color,
4150
},
4251
primaryStyle: {
4352
// All TextStyle properties are allowed
4453
fontSize: 16,
45-
color: "#0595DB",
54+
color: brand.primary,
4655
},
4756
dangerStyle: {
4857
// All TextStyle properties are allowed
4958
fontSize: 16,
50-
color: "#ed1c24",
59+
color: brand.danger,
5160
},
5261
customStyle: {
5362
// All TextStyle properties are allowed
5463
fontSize: 16,
55-
color: "#76CA02",
64+
color: font.color,
5665
},
5766
},
5867
};

styles/native/js/core/widgets/popupmenu.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,28 @@ export const com_mendix_widget_native_popupmenu_PopupMenu = {
1616
// All ViewStyle properties are allowed
1717
borderRadius: 10,
1818
shadowColor: "#000",
19-
overflow: "hidden",
2019
shadowOpacity: 0.2,
2120
shadowRadius: 10,
2221
elevation: 16,
2322
backgroundColor: background.primary,
2423
},
25-
itemRippleColor: contrast.lower,
24+
custom: {
25+
container: {
26+
// All ViewStyle properties are allowed
27+
},
28+
itemStyle: {
29+
rippleColor: contrast.lower,
30+
},
31+
},
2632
basic: {
2733
dividerColor: font.color,
34+
container: {
35+
// All ViewStyle properties are allowed
36+
height: 40,
37+
},
2838
itemStyle: {
2939
ellipsizeMode: "tail",
40+
rippleColor: contrast.lower,
3041
defaultStyle: {
3142
// All TextStyle properties are allowed
3243
color: font.color,
@@ -43,9 +54,5 @@ export const com_mendix_widget_native_popupmenu_PopupMenu = {
4354
// All TextStyle properties are allowed
4455
},
4556
},
46-
containerStyle: {
47-
// All ViewStyle properties are allowed
48-
height: 40,
49-
},
5057
},
5158
};

styles/native/ts/core/widgets/bottomsheet.ts

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { background, border, contrast } from "../variables";
2-
import { isIphoneWithNotch } from "../helpers/_functions/device";
3-
import { BottomSheetType } from "../../types/widgets";
1+
import { background, border, brand, contrast, font } from "../variables";
2+
import { BottomSheetType } from "../../types/widgets";
43

54
//
65
// DISCLAIMER:
@@ -23,7 +22,7 @@ export const com_mendix_widget_native_bottomsheet_BottomSheet: BottomSheetType =
2322
borderRadius: border.radius,
2423
elevation: 20,
2524
shadowColor: "#000",
26-
shadowOpacity: 0.1,
25+
shadowOpacity: 0.05,
2726
shadowRadius: 6,
2827
shadowOffset: {
2928
width: 0,
@@ -39,49 +38,35 @@ export const com_mendix_widget_native_bottomsheet_BottomSheet: BottomSheetType =
3938
modal: {
4039
// All ViewStyle properties are allowed
4140
margin: 0,
42-
justifyContent: "flex-end"
41+
justifyContent: "flex-end",
4342
},
44-
basicModal: {
45-
backdrop: {
46-
// All ViewStyle properties are allowed
47-
paddingBottom: isIphoneWithNotch ? 24 : 0,
48-
flex: 1,
49-
flexDirection: "row",
50-
},
43+
modalItems: {
5144
container: {
52-
// All ViewStyle properties are allowed
53-
flex: 1,
54-
alignSelf: "flex-end",
55-
backgroundColor: "#e5e5e5"
56-
},
57-
item: {
58-
// All ViewStyle properties + rippleColor: string
45+
// rippleColor & All TextStyle properties are allowed
5946
height: 50,
60-
alignItems: "center",
61-
justifyContent: "center",
47+
marginTop: 0,
6248
rippleColor: contrast.lower,
49+
backgroundColor: background.primary,
6350
},
64-
},
65-
modalItems: {
6651
defaultStyle: {
6752
// All TextStyle properties are allowed
6853
fontSize: 16,
69-
color: "black",
54+
color: font.color,
7055
},
7156
primaryStyle: {
7257
// All TextStyle properties are allowed
7358
fontSize: 16,
74-
color: "#0595DB",
59+
color: brand.primary,
7560
},
7661
dangerStyle: {
7762
// All TextStyle properties are allowed
7863
fontSize: 16,
79-
color: "#ed1c24",
64+
color: brand.danger,
8065
},
8166
customStyle: {
8267
// All TextStyle properties are allowed
8368
fontSize: 16,
84-
color: "#76CA02",
69+
color: font.color,
8570
},
8671
},
8772
};

styles/native/ts/core/widgets/popupmenu.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ export const com_mendix_widget_native_popupmenu_PopupMenu: PopupMenuType = {
2323
backgroundColor: background.primary,
2424
},
2525
custom: {
26-
itemStyle: {
27-
rippleColor: contrast.lower,
28-
},
2926
container: {
3027
// All ViewStyle properties are allowed
3128
},
29+
itemStyle: {
30+
rippleColor: contrast.lower,
31+
},
3232
},
3333
basic: {
3434
dividerColor: font.color,
35+
container: {
36+
// All ViewStyle properties are allowed
37+
height: 40,
38+
},
3539
itemStyle: {
3640
ellipsizeMode: "tail", // 'head' | 'middle' | 'tail' | 'clip';
3741
rippleColor: contrast.lower,
@@ -51,9 +55,5 @@ export const com_mendix_widget_native_popupmenu_PopupMenu: PopupMenuType = {
5155
// All TextStyle properties are allowed
5256
},
5357
},
54-
container: {
55-
// All ViewStyle properties are allowed
56-
height: 40,
57-
},
5858
},
5959
};

styles/native/ts/types/widgets.d.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ImageStyle, TextStyle, ViewStyle, TextProps } from "react-native";
1+
import { ImageStyle, TextProps, TextStyle, ViewStyle } from "react-native";
22

33
declare type ActivityIndicatorSizeType = "small" | "large";
44

@@ -45,13 +45,11 @@ export interface BadgeType {
4545
export interface BottomSheetType {
4646
container?: ViewStyle,
4747
containerWhenExpandedFullscreen?: ViewStyle,
48-
basicModal?: {
49-
backdrop?: ViewStyle;
50-
container?: ViewStyle;
51-
item?: ViewStyle & { rippleColor?: string };
52-
},
5348
modal?: ViewStyle,
5449
modalItems?: {
50+
container?: ViewStyle & {
51+
rippleColor?: string;
52+
}
5553
defaultStyle?: TextStyle;
5654
primaryStyle?: TextStyle;
5755
dangerStyle?: TextStyle;
@@ -156,14 +154,14 @@ export interface DropDownType {
156154
container?: ViewStyle,
157155
label?: InputLabelType,
158156
value?: {
159-
placeholderTextColor?: string
160-
} & TextStyle,
157+
placeholderTextColor?: string
158+
} & TextStyle,
161159
valueDisabled?: TextStyle,
162160
validationMessage?: TextStyle,
163161
/* New dropdown styles start */
164162
valueContainer?: {
165-
rippleColor?: string
166-
} & ViewStyle;
163+
rippleColor?: string
164+
} & ViewStyle;
167165
menuWrapper?: ViewStyle
168166
item?: TextStyle;
169167
itemContainer?: ViewStyle;

0 commit comments

Comments
 (0)