Skip to content

Commit a283707

Browse files
Merge pull request #66 from mendix/fix/popup-bottomsheet-styles
Fix/popup bottomsheet styles
2 parents 5d7ba45 + 979b6ac commit a283707

File tree

5 files changed

+62
-34
lines changed

5 files changed

+62
-34
lines changed

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

Lines changed: 15 additions & 6 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.
@@ -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: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { background, border } from "../variables";
2-
import { BottomSheetType } from "../../types/widgets";
1+
import { background, border, brand, contrast, font } from "../variables";
2+
import { BottomSheetType } from "../../types/widgets";
33

44
//
55
// DISCLAIMER:
@@ -37,27 +37,36 @@ export const com_mendix_widget_native_bottomsheet_BottomSheet: BottomSheetType =
3737
},
3838
modal: {
3939
// All ViewStyle properties are allowed
40+
margin: 0,
41+
justifyContent: "flex-end",
4042
},
4143
modalItems: {
44+
container: {
45+
// rippleColor & All TextStyle properties are allowed
46+
height: 50,
47+
marginTop: 0,
48+
rippleColor: contrast.lower,
49+
backgroundColor: background.primary,
50+
},
4251
defaultStyle: {
4352
// All TextStyle properties are allowed
4453
fontSize: 16,
45-
color: "black",
54+
color: font.color,
4655
},
4756
primaryStyle: {
4857
// All TextStyle properties are allowed
4958
fontSize: 16,
50-
color: "#0595DB",
59+
color: brand.primary,
5160
},
5261
dangerStyle: {
5362
// All TextStyle properties are allowed
5463
fontSize: 16,
55-
color: "#ed1c24",
64+
color: brand.danger,
5665
},
5766
customStyle: {
5867
// All TextStyle properties are allowed
5968
fontSize: 16,
60-
color: "#76CA02",
69+
color: font.color,
6170
},
6271
},
6372
};

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+
container: {
27+
// All ViewStyle properties are allowed
28+
},
2629
itemStyle: {
2730
rippleColor: contrast.lower,
2831
},
29-
containerStyle: {
30-
// All ViewStyle properties are allowed
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-
containerStyle: {
55-
// All ViewStyle properties are allowed
56-
height: 40,
57-
},
5858
},
5959
};

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

Lines changed: 12 additions & 9 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

@@ -47,6 +47,9 @@ export interface BottomSheetType {
4747
containerWhenExpandedFullscreen?: ViewStyle,
4848
modal?: ViewStyle,
4949
modalItems?: {
50+
container?: ViewStyle & {
51+
rippleColor?: string;
52+
}
5053
defaultStyle?: TextStyle;
5154
primaryStyle?: TextStyle;
5255
dangerStyle?: TextStyle;
@@ -151,14 +154,14 @@ export interface DropDownType {
151154
container?: ViewStyle,
152155
label?: InputLabelType,
153156
value?: {
154-
placeholderTextColor?: string
155-
} & TextStyle,
157+
placeholderTextColor?: string
158+
} & TextStyle,
156159
valueDisabled?: TextStyle,
157160
validationMessage?: TextStyle,
158161
/* New dropdown styles start */
159162
valueContainer?: {
160-
rippleColor?: string
161-
} & ViewStyle;
163+
rippleColor?: string
164+
} & ViewStyle;
162165
menuWrapper?: ViewStyle
163166
item?: TextStyle;
164167
itemContainer?: ViewStyle;
@@ -334,28 +337,28 @@ export interface PopupMenuType {
334337
basic: BasicItemStyle;
335338
custom: CustomItemStyle
336339
buttonContainer?: ViewStyle;
337-
itemRippleColor: string;
338340
}
339341

340342
interface CustomItemStyle extends ViewStyle {
341-
containerStyle?: ViewStyle;
343+
container?: ViewStyle;
342344
itemStyle: { rippleColor?: string };
343345
}
344346

345347
interface BasicItemStyle {
346348
itemStyle?: ItemStyle;
347-
containerStyle?: ViewStyle;
349+
container?: ViewStyle;
348350
dividerColor?: string;
349351
}
352+
350353
interface ItemStyle {
354+
rippleColor?: string;
351355
ellipsizeMode?: TextProps["ellipsizeMode"];
352356
defaultStyle?: TextStyle;
353357
primaryStyle?: TextStyle;
354358
dangerStyle?: TextStyle;
355359
customStyle?: TextStyle;
356360
}
357361

358-
359362
// QR Code
360363
export interface QRCodeType {
361364
container?: ViewStyle,

0 commit comments

Comments
 (0)