Skip to content

Commit

Permalink
back to explicit option type instead of optionnal fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Freddy03h committed Jan 15, 2025
1 parent 2b69eda commit 6278321
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/Elements.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ open ReactNative

module Header = {
type headerTitleProps = {
allowFontScaling?: bool,
tintColor?: Color.t,
style?: Style.t,
allowFontScaling: option<bool>,
tintColor: option<Color.t>,
style: option<Style.t>,
children: string,
}

Expand All @@ -15,23 +15,19 @@ module Header = {

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

type headerButtonCommonProps = {
tintColor?: Color.t,
pressColor?: Color.t,
pressOpacity?: float,
}

type headerRightProps = {
...headerButtonCommonProps,
canGoBack?: bool,
tintColor: option<Color.t>,
pressColor: option<Color.t>,
pressOpacity: option<float>,
canGoBack: option<bool>,
}
type headerLeftProps = {
...headerRightProps,
displayMode?: displayMode,
href?: string,
displayMode: option<displayMode>,
href: option<string>,
}

type headerBackgroundOptions = {style?: Style.t}
type headerBackgroundOptions = {style: option<Style.t>}

type headerTitleAlign = [#left | #center]

Expand Down Expand Up @@ -110,7 +106,9 @@ module HeaderTitle = {

module HeaderButton = {
type headerButtonProps = {
...Header.headerButtonCommonProps,
tintColor?: Color.t,
pressColor?: Color.t,
pressOpacity?: float,
onPress?: unit => unit,
href?: string,
disabled?: bool,
Expand Down

0 comments on commit 6278321

Please sign in to comment.