From a9b3e79932b6399a079419600d084cef20404004 Mon Sep 17 00:00:00 2001 From: Hyunwoo Nam Date: Mon, 3 Feb 2025 16:01:54 +0900 Subject: [PATCH 1/3] tabBarLabel polymorphic --- src/BottomTabs.res | 6 +++++- src/MaterialBottomTabs.res | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/BottomTabs.res b/src/BottomTabs.res index c1dca65..13d8e3c 100644 --- a/src/BottomTabs.res +++ b/src/BottomTabs.res @@ -18,9 +18,13 @@ module TabBarBadge = { external string: string => t = "%identity" } +@unboxed +type rec tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element) +and tabBarLabelArgs = {focused: bool, color: string} + type rec options = { title?: string, - tabBarLabel?: string, + tabBarLabel?: tabBarLabel, tabBarShowLabel?: bool, tabBarLabelPosition?: tabBarLabelPosition, tabBarLabelStyle?: Style.t, diff --git a/src/MaterialBottomTabs.res b/src/MaterialBottomTabs.res index cda340d..b2af0e0 100644 --- a/src/MaterialBottomTabs.res +++ b/src/MaterialBottomTabs.res @@ -16,11 +16,15 @@ module TabBarBadge = { external string: string => t = "%identity" } +@unboxed +type rec tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element) +and tabBarLabelArgs = {focused: bool, color: string} + type options = { title?: string, tabBarIcon?: tabBarIconOptions => React.element, tabBarColor?: Color.t, - tabBarLabel?: string, + tabBarLabel?: tabBarLabel, tabBarBadge?: TabBarBadge.t, tabBarAccessibilityLabel?: string, tabBarTestID?: string, From 246d25e0b63798006f40ce9d2a8199702ab7f670 Mon Sep 17 00:00:00 2001 From: Hyunwoo Nam Date: Mon, 24 Feb 2025 14:17:00 +0900 Subject: [PATCH 2/3] BottomTabs - add tabBarLabel.position arg --- src/BottomTabs.res | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/BottomTabs.res b/src/BottomTabs.res index 13d8e3c..b370a40 100644 --- a/src/BottomTabs.res +++ b/src/BottomTabs.res @@ -20,7 +20,11 @@ module TabBarBadge = { @unboxed type rec tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element) -and tabBarLabelArgs = {focused: bool, color: string} +and tabBarLabelArgs = { + focused: bool, + color: string, + position: tabBarLabelPosition, +} type rec options = { title?: string, From 7eec56cd32017d4aab28fcf7f63b96338833a0a2 Mon Sep 17 00:00:00 2001 From: Hyunwoo Nam Date: Fri, 28 Feb 2025 11:02:14 +0900 Subject: [PATCH 3/3] added missing props --- src/BottomTabs.res | 8 +++++--- src/MaterialBottomTabs.res | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/BottomTabs.res b/src/BottomTabs.res index b370a40..65195ca 100644 --- a/src/BottomTabs.res +++ b/src/BottomTabs.res @@ -18,14 +18,16 @@ module TabBarBadge = { external string: string => t = "%identity" } -@unboxed -type rec tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element) -and tabBarLabelArgs = { +type tabBarLabelArgs = { focused: bool, color: string, position: tabBarLabelPosition, + children: string, } +@unboxed +type tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element) + type rec options = { title?: string, tabBarLabel?: tabBarLabel, diff --git a/src/MaterialBottomTabs.res b/src/MaterialBottomTabs.res index b2af0e0..721453f 100644 --- a/src/MaterialBottomTabs.res +++ b/src/MaterialBottomTabs.res @@ -16,9 +16,14 @@ module TabBarBadge = { external string: string => t = "%identity" } +type tabBarLabelArgs = { + focused: bool, + color: string, + children: string, +} + @unboxed -type rec tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element) -and tabBarLabelArgs = {focused: bool, color: string} +type tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element) type options = { title?: string,