Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit db12984

Browse files
authored
Improve binding of BottomTabs, MaterialBottomTabs (#75)
* tabBarLabel polymorphic * BottomTabs - add tabBarLabel.position arg * added missing props
1 parent b3751bc commit db12984

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

‎src/BottomTabs.res‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,19 @@ module TabBarBadge = {
2828
external string: string => t = "%identity"
2929
}
3030

31+
type tabBarLabelArgs = {
32+
focused: bool,
33+
color: string,
34+
position: tabBarLabelPosition,
35+
children: string,
36+
}
37+
38+
@unboxed
39+
type tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element)
40+
3141
type rec options = {
3242
title?: string,
33-
tabBarLabel?: string,
43+
tabBarLabel?: tabBarLabel,
3444
tabBarShowLabel?: bool,
3545
tabBarLabelPosition?: tabBarLabelPosition,
3646
tabBarLabelStyle?: Style.t,

‎src/MaterialBottomTabs.res‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@ module TabBarBadge = {
1616
external string: string => t = "%identity"
1717
}
1818

19+
type tabBarLabelArgs = {
20+
focused: bool,
21+
color: string,
22+
children: string,
23+
}
24+
25+
@unboxed
26+
type tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element)
27+
1928
type options = {
2029
title?: string,
2130
tabBarIcon?: tabBarIconOptions => React.element,
2231
tabBarColor?: Color.t,
23-
tabBarLabel?: string,
32+
tabBarLabel?: tabBarLabel,
2433
tabBarBadge?: TabBarBadge.t,
2534
tabBarAccessibilityLabel?: string,
2635
tabBarTestID?: string,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /