Skip to content

Commit 6278321

Browse files
committed
back to explicit option type instead of optionnal fields
1 parent 2b69eda commit 6278321

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/Elements.res

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ open ReactNative
22

33
module Header = {
44
type headerTitleProps = {
5-
allowFontScaling?: bool,
6-
tintColor?: Color.t,
7-
style?: Style.t,
5+
allowFontScaling: option<bool>,
6+
tintColor: option<Color.t>,
7+
style: option<Style.t>,
88
children: string,
99
}
1010

@@ -15,23 +15,19 @@ module Header = {
1515

1616
type displayMode = [#default | #generic | #minimal]
1717

18-
type headerButtonCommonProps = {
19-
tintColor?: Color.t,
20-
pressColor?: Color.t,
21-
pressOpacity?: float,
22-
}
23-
2418
type headerRightProps = {
25-
...headerButtonCommonProps,
26-
canGoBack?: bool,
19+
tintColor: option<Color.t>,
20+
pressColor: option<Color.t>,
21+
pressOpacity: option<float>,
22+
canGoBack: option<bool>,
2723
}
2824
type headerLeftProps = {
2925
...headerRightProps,
30-
displayMode?: displayMode,
31-
href?: string,
26+
displayMode: option<displayMode>,
27+
href: option<string>,
3228
}
3329

34-
type headerBackgroundOptions = {style?: Style.t}
30+
type headerBackgroundOptions = {style: option<Style.t>}
3531

3632
type headerTitleAlign = [#left | #center]
3733

@@ -110,7 +106,9 @@ module HeaderTitle = {
110106

111107
module HeaderButton = {
112108
type headerButtonProps = {
113-
...Header.headerButtonCommonProps,
109+
tintColor?: Color.t,
110+
pressColor?: Color.t,
111+
pressOpacity?: float,
114112
onPress?: unit => unit,
115113
href?: string,
116114
disabled?: bool,

0 commit comments

Comments
 (0)